refactor(domain): Row structs for from_persistence, ID newtypes, kill clippy.toml

- delete clippy.toml (too-many-arguments-threshold=20 hack)
- ChannelRow/MediaItemRow/LibraryItemRow structs for from_persistence
- SnapshotId/ActivityEventId/PlaybackRecordId newtypes
- DomainError variants use ChannelId/UserId instead of Uuid
- ActivityEvent.channel_id: Option<ChannelId> not Option<Uuid>
- InMemory repos key on newtype IDs
- AlgorithmicParams struct for schedule engine
- update all adapters/application/presentation callers
This commit is contained in:
2026-07-12 05:00:49 +02:00
parent 031cba5cfb
commit c0e685a4ee
65 changed files with 684 additions and 695 deletions

View File

@@ -475,25 +475,25 @@ fn media_item_to_library_item(item: domain::MediaItem, provider_id: &str) -> dom
let id = format!("{}::{}", provider_id, external_id);
let now = chrono::Utc::now().to_rfc3339();
domain::LibraryItem::from_persistence(
domain::LibraryItem::from_persistence(domain::LibraryItemRow {
id,
provider_id.to_string(),
provider_id: provider_id.to_string(),
external_id,
item.title().to_string(),
item.content_type().clone(),
item.duration_secs(),
item.series_name().map(|s| s.to_string()),
item.season_number(),
item.episode_number(),
item.year(),
item.genres().to_vec(),
item.tags().to_vec(),
item.collection_id().map(|s| s.to_string()),
None,
None,
item.thumbnail_url().map(|s| s.to_string()),
now,
)
title: item.title().to_string(),
content_type: item.content_type().clone(),
duration_secs: item.duration_secs(),
series_name: item.series_name().map(|s| s.to_string()),
season_number: item.season_number(),
episode_number: item.episode_number(),
year: item.year(),
genres: item.genres().to_vec(),
tags: item.tags().to_vec(),
collection_id: item.collection_id().map(|s| s.to_string()),
collection_name: None,
collection_type: None,
thumbnail_url: item.thumbnail_url().map(|s| s.to_string()),
synced_at: now,
})
}
struct SimpleSyncAdapter {