refactor(application): strip comments, DRY ownership check + parse_content_type
This commit is contained in:
@@ -2,7 +2,6 @@ use std::sync::Arc;
|
||||
|
||||
use domain::ports::{ChannelQuery, ScheduleQuery};
|
||||
|
||||
/// Dependencies for IPTV export use cases.
|
||||
pub struct IptvDeps {
|
||||
pub channel_query: Arc<dyn ChannelQuery>,
|
||||
pub schedule_query: Arc<dyn ScheduleQuery>,
|
||||
|
||||
@@ -4,9 +4,6 @@ use domain::DomainResult;
|
||||
use super::deps::IptvDeps;
|
||||
use super::queries::GetM3uQuery;
|
||||
|
||||
/// Generate an M3U playlist for all channels.
|
||||
///
|
||||
/// Flow: fetch all channels -> delegate to domain::generate_m3u -> return string.
|
||||
pub async fn execute(deps: &IptvDeps, query: GetM3uQuery) -> DomainResult<String> {
|
||||
let channels = deps.channel_query.find_all().await?;
|
||||
let token = query.token.as_deref().unwrap_or("");
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/// Generate an M3U playlist for all channels.
|
||||
pub struct GetM3uQuery {
|
||||
pub base_url: String,
|
||||
pub token: Option<String>,
|
||||
}
|
||||
|
||||
/// Generate an XMLTV EPG document for all channels.
|
||||
pub struct GetXmltvQuery;
|
||||
|
||||
@@ -8,10 +8,6 @@ use domain::DomainResult;
|
||||
use super::deps::IptvDeps;
|
||||
use super::queries::GetXmltvQuery;
|
||||
|
||||
/// Generate an XMLTV EPG document for all channels with active schedules.
|
||||
///
|
||||
/// Flow: fetch all channels -> for each, find active schedule -> collect slots
|
||||
/// -> delegate to domain::generate_xmltv -> return string.
|
||||
pub async fn execute(deps: &IptvDeps, _query: GetXmltvQuery) -> DomainResult<String> {
|
||||
let channels = deps.channel_query.find_all().await?;
|
||||
let now = Utc::now();
|
||||
|
||||
Reference in New Issue
Block a user