mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-23 08:12:34 +02:00
fixes for series tmdb id
This commit is contained in:
@@ -43,12 +43,11 @@ fn extract_tmdb_id_from_playlist_item(item: &PlaylistItem) -> Option<u32> {
|
||||
if let Some(additional_props) = &item.header.additional_properties {
|
||||
if let Some(props_str) = additional_props.as_str() {
|
||||
if let Ok(props) = serde_json::from_str::<serde_json::Map<String, serde_json::Value>>(props_str) {
|
||||
if let Some(tmdb_value) = props.get("tmdb") {
|
||||
return get_u32_from_serde_value(tmdb_value);
|
||||
}
|
||||
if let Some(tmdb_id_value) = props.get("tmdb_id") {
|
||||
return get_u32_from_serde_value(tmdb_id_value);
|
||||
}
|
||||
return props
|
||||
.get("tmdb_id")
|
||||
.and_then(get_u32_from_serde_value)
|
||||
.filter(|&id| id != 0)
|
||||
.or_else(|| props.get("tmdb").and_then(get_u32_from_serde_value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user