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

@@ -21,25 +21,25 @@ fn library_item_new_defaults_optional_fields() {
#[test]
fn library_item_from_persistence_all_fields() {
let item = LibraryItem::from_persistence(
"jf::abc".into(),
"jf".into(),
"abc".into(),
"Breaking Bad S01E01".into(),
ContentType::Episode,
2700,
Some("Breaking Bad".into()),
Some(1),
Some(1),
Some(2008),
vec!["Drama".into()],
vec!["tv".into()],
Some("col-1".into()),
Some("TV Shows".into()),
Some("tvshows".into()),
Some("http://thumb.jpg".into()),
"2026-03-19T00:00:00Z".into(),
);
let item = LibraryItem::from_persistence(LibraryItemRow {
id: "jf::abc".into(),
provider_id: "jf".into(),
external_id: "abc".into(),
title: "Breaking Bad S01E01".into(),
content_type: ContentType::Episode,
duration_secs: 2700,
series_name: Some("Breaking Bad".into()),
season_number: Some(1),
episode_number: Some(1),
year: Some(2008),
genres: vec!["Drama".into()],
tags: vec!["tv".into()],
collection_id: Some("col-1".into()),
collection_name: Some("TV Shows".into()),
collection_type: Some("tvshows".into()),
thumbnail_url: Some("http://thumb.jpg".into()),
synced_at: "2026-03-19T00:00:00Z".into(),
});
assert_eq!(item.series_name(), Some("Breaking Bad"));
assert_eq!(item.season_number(), Some(1));
assert_eq!(item.year(), Some(2008));