use entertainarr_domain::media::entity::MediaTask;
use entertainarr_domain::media::prelude::MediaService;
use entertainarr_domain::task::entity::TaskParams;

impl<MS, PS, TS, TSS> crate::Runner<MS, PS, TS, TSS>
where
    MS: MediaService,
{
    pub(crate) async fn handle_media(
        &self,
        task: MediaTask,
        _params: &TaskParams,
    ) -> anyhow::Result<()> {
        match task {
            MediaTask::SynchronizeAll => self.media_service.synchronize_all().await,
            MediaTask::Synchronize { disk } => self.media_service.synchronize(&disk).await,
        }
    }
}
