mirror of
https://github.com/euzu/tuliprox.git
synced 2026-09-30 04:52:29 +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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ use std::fs::File;
|
||||
use std::io::{BufWriter, Write};
|
||||
use std::sync::Arc;
|
||||
use std::time::Instant;
|
||||
use log::{error, info, log_enabled, Level};
|
||||
use log::{error, info, log_enabled, warn, Level};
|
||||
use crate::model::{XtreamSeriesEpisode, XtreamSeriesInfoEpisode};
|
||||
use crate::utils;
|
||||
use crate::processing::processor::xtream::normalize_json_content;
|
||||
@@ -167,6 +167,10 @@ async fn process_series_info(
|
||||
{
|
||||
let Some(provider_id) = pli.header.get_provider_id() else { continue; };
|
||||
let Ok(content) = info_reader.get(&provider_id) else { continue; };
|
||||
if content.is_empty() {
|
||||
warn!("Series info content is empty, skipping series with provider id: {provider_id}");
|
||||
continue;
|
||||
}
|
||||
match serde_json::from_str::<serde_json::Value>(&content) {
|
||||
Ok(series_content) => {
|
||||
let (group, series_name) = {
|
||||
|
||||
@@ -42,6 +42,12 @@ fn extract_info_record_from_vod_info(content: &str) -> Option<(u32, InputVodInfo
|
||||
let tmdb_id = info_section
|
||||
.get(crate::model::XC_TAG_VOD_INFO_TMDB_ID)
|
||||
.and_then(get_u32_from_serde_value)
|
||||
.filter(|&id| id != 0)
|
||||
.or_else(|| {
|
||||
info_section
|
||||
.get(crate::model::XC_TAG_VOD_INFO_TMDB)
|
||||
.and_then(get_u32_from_serde_value)
|
||||
})
|
||||
.unwrap_or(0);
|
||||
|
||||
let release_date = info_section
|
||||
|
||||
Reference in New Issue
Block a user