kill LibraryItem, unify to MediaItem; decouple schedule engine from providers

ADR-0001: MediaItem absorbs LibraryItem fields (provider_id, external_id,
collection_name, collection_type, synced_at, role/MediaRole).
LibraryItem + LibraryItemRow deleted. All ports/adapters/tests updated.

ADR-0002: schedule engine takes LibraryQuery instead of IProviderRegistry.
Algorithmic blocks query library via search(), manual blocks via get_by_id().
get_stream_url removed from engine; provider_registry moved to ScheduleDeps
for playback-time stream URL resolution in application layer.

BlockContent provider_id field removed (meaningless when querying library).
This commit is contained in:
2026-07-12 07:02:08 +02:00
parent 773e228e21
commit a6558e15b2
30 changed files with 324 additions and 354 deletions

View File

@@ -1,4 +1,4 @@
use domain::{ContentType, MediaItem, MediaItemId, MediaItemRow};
use domain::{ContentType, MediaItem, MediaItemId, MediaItemRow, MediaRole};
use crate::models::JellyfinItem;
@@ -17,7 +17,7 @@ pub(crate) fn map_jellyfin_item(item: JellyfinItem) -> Option<MediaItem> {
.unwrap_or(0);
Some(MediaItem::from_persistence(MediaItemRow {
id: MediaItemId::new(item.id),
id: MediaItemId::new(&item.id),
title: item.name,
content_type,
duration_secs,
@@ -30,5 +30,11 @@ pub(crate) fn map_jellyfin_item(item: JellyfinItem) -> Option<MediaItem> {
episode_number: item.index_number,
thumbnail_url: None,
collection_id: None,
provider_id: String::new(),
external_id: item.id,
collection_name: None,
collection_type: None,
synced_at: None,
role: MediaRole::default(),
}))
}