Skip to content

Commit

Permalink
fix: #122
Browse files Browse the repository at this point in the history
  • Loading branch information
lostb1t committed May 31, 2024
1 parent a5dc266 commit 6c6675c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ run:
REPLEX_ENABLE_CONSOLE=0 \
REPLEX_CACHE_TTL=0 \
RUST_LOG="info,replex=debug" \
cargo watch -x run
cargo run

fix:
cargo fix
Expand Down
12 changes: 12 additions & 0 deletions src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,9 @@ pub struct MetaData {
#[yaserde(attribute)]
#[serde(skip_serializing_if = "Option::is_none")]
pub composite: Option<String>,
#[yaserde(attribute, rename = "playlistType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub playlist_type: Option<String>,
#[yaserde(attribute)]
#[serde(skip_serializing_if = "Option::is_none")]
pub banner: Option<String>,
Expand Down Expand Up @@ -1327,6 +1330,15 @@ impl MetaData {
self.hub_identifier.is_some()
}

pub fn is_playlist(&self) -> bool {
self.context.is_some()
&& self
.context
.clone()
.unwrap()
.starts_with("hub.home.playlists")
}

pub fn is_media(&self) -> bool {
!self.is_hub() && (self.r#type == "movie" || self.r#type == "show")
}
Expand Down
7 changes: 2 additions & 5 deletions src/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ impl ClientHeroStyle {
Self {
style: Some("hero".to_string()),
// clip wil make the item info disappear on TV
r#type: "mixed".to_string(),
r#type: "clip".to_string(),
// using clip makes it load thumbs instead of art as cover art. So we don't have to touch the background
child_type: Some("clip".to_string()),
cover_art_as_art: false,
Expand Down Expand Up @@ -893,10 +893,7 @@ impl Transform for HubKeyTransform {
plex_client: PlexClient,
options: PlexContext,
) {
// if item.is_hub() {
// dbg!(&item.key);
// }
// let key = item.key.clone().unwrap();

if item.is_hub()
&& item.key.is_some()
&& !item.key.clone().unwrap().starts_with("/replex")
Expand Down

0 comments on commit 6c6675c

Please sign in to comment.