mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-05 07:22:17 +02:00
Refactored playlist storage
This commit is contained in:
@@ -164,7 +164,7 @@ pub fn metadata_cache_entry_to_xtream_movie_info(
|
||||
name: movie.title.clone(),
|
||||
category_id: 0,
|
||||
stream_id: 0,
|
||||
stream_icon: String::new(),
|
||||
stream_icon: movie.poster.as_deref().or(movie.fanart.as_deref()).unwrap_or("").to_owned(),
|
||||
direct_source: String::new(),
|
||||
custom_sid: None,
|
||||
added: entry.file_modified.to_string(),
|
||||
|
||||
@@ -11,7 +11,7 @@ use shared::model::{PlaylistGroup, PlaylistItemType, XtreamCluster};
|
||||
use std::sync::Arc;
|
||||
use std::time::Instant;
|
||||
use crate::repository::storage::get_input_storage_path;
|
||||
use crate::repository::xtream_repository::persists_input_series_info;
|
||||
use crate::repository::xtream_repository::{persists_input_series_info};
|
||||
|
||||
create_resolve_options_function_for_xtream_target!(series);
|
||||
|
||||
@@ -64,9 +64,8 @@ async fn playlist_resolve_series_info(app_config: &Arc<AppConfig>, client: &reqw
|
||||
if let Some(episodes) = parse_xtream_series_info(&pli.get_uuid(), &series_stream_props, &group, &series_name, input) {
|
||||
group_series.extend(episodes.into_iter());
|
||||
}
|
||||
|
||||
// Update in-memory playlist items with the newly fetched vod info.
|
||||
// This makes the data available for subsequent processing steps like STRM export.
|
||||
// This makes the data available for later processing steps like STRM export.
|
||||
pli.header.additional_properties = Some(StreamProperties::Series(Box::new(series_stream_props)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,13 +3,13 @@ use crate::model::{AppConfig, ConfigTarget};
|
||||
use crate::processing::processor::xtream::playlist_resolve_download_playlist_item;
|
||||
use crate::processing::processor::create_resolve_options_function_for_xtream_target;
|
||||
use crate::repository::storage::get_input_storage_path;
|
||||
use crate::repository::xtream_repository::persists_input_vod_info;
|
||||
use log::{error, info, log_enabled, Level};
|
||||
use shared::error::TuliproxError;
|
||||
use shared::model::{InputType, PlaylistEntry, StreamProperties, VideoStreamProperties, XtreamVideoInfo};
|
||||
use shared::model::{PlaylistItemType, XtreamCluster};
|
||||
use std::sync::Arc;
|
||||
use std::time::Instant;
|
||||
use crate::repository::xtream_repository::{persist_input_vod_info};
|
||||
|
||||
create_resolve_options_function_for_xtream_target!(vod);
|
||||
|
||||
@@ -52,7 +52,7 @@ pub async fn playlist_resolve_vod(app_config: &Arc<AppConfig>, client: &reqwest:
|
||||
if let Some(content) = playlist_resolve_download_playlist_item(client, pli, fpl.input, errors, resolve_delay, XtreamCluster::Video).await {
|
||||
if let Ok(info) = serde_json::from_str::<XtreamVideoInfo>(&content) {
|
||||
let video_stream_props = VideoStreamProperties::from_info(&info, pli);
|
||||
if let Err(err) = persists_input_vod_info(app_config, &storage_path, pli.header.xtream_cluster, &input.name, provider_id, &video_stream_props).await {
|
||||
if let Err(err) = persist_input_vod_info(app_config, &storage_path, pli.header.xtream_cluster, &input.name, provider_id, &video_stream_props).await {
|
||||
error!("Failed to persist VOD info for provider_id {provider_id}: {err}");
|
||||
}
|
||||
// This makes the data available for subsequent processing steps like STRM export.
|
||||
|
||||
Reference in New Issue
Block a user