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

@@ -1,4 +1,4 @@
use domain::{ContentType, MediaItem, MediaItemId};
use domain::{ContentType, MediaItem, MediaItemId, MediaItemRow};
use crate::models::JellyfinItem;
@@ -16,19 +16,19 @@ pub(crate) fn map_jellyfin_item(item: JellyfinItem) -> Option<MediaItem> {
.map(|t| (t / TICKS_PER_SEC) as u32)
.unwrap_or(0);
Some(MediaItem::from_persistence(
MediaItemId::new(item.id),
item.name,
Some(MediaItem::from_persistence(MediaItemRow {
id: MediaItemId::new(item.id),
title: item.name,
content_type,
duration_secs,
item.overview,
item.genres.unwrap_or_default(),
item.production_year,
item.tags.unwrap_or_default(),
item.series_name,
item.parent_index_number,
item.index_number,
None,
None,
))
description: item.overview,
genres: item.genres.unwrap_or_default(),
year: item.production_year,
tags: item.tags.unwrap_or_default(),
series_name: item.series_name,
season_number: item.parent_index_number,
episode_number: item.index_number,
thumbnail_url: None,
collection_id: None,
}))
}