cleanup: strip comments, extract constants, DRY shared helpers across adapters + infra-wiring

- strip all comments except WHY workaround notes (3 remain)
- remove all #[allow(dead_code)]; fix via _prefix rename
- extract named constants: JWT time units, token types, default config values, jellyfin fallback bitrate
- DRY: move serialize_enum_as_string, content_type_str, parse_content_type, parse_genres_blob to adapter-common
- sqlite+postgres library.rs use shared helpers instead of local copies
- sqlite+postgres channel.rs use shared serialize_enum_as_string
- remove dead `let _ = ext` in scanner.rs
This commit is contained in:
2026-07-12 04:21:21 +02:00
parent eff14228af
commit 25b33b6a0e
38 changed files with 188 additions and 630 deletions

View File

@@ -1,6 +1,3 @@
//! Wiring function that instantiates all SQLite repositories and returns them
//! as trait-object Arcs.
use std::sync::Arc;
use sqlx::SqlitePool;
@@ -27,7 +24,6 @@ use crate::{
user::SqliteUserRepository,
};
/// All SQLite adapter outputs, ready to be injected into the application layer.
pub struct SqliteWireOutput {
pub user_command: Arc<dyn UserCommand>,
pub user_query: Arc<dyn UserQuery>,
@@ -45,10 +41,6 @@ pub struct SqliteWireOutput {
pub transcode_settings: Arc<dyn TranscodeSettingsRepository>,
}
/// Create all SQLite repository implementations from a single pool.
///
/// Each struct wraps a clone of the same pool. Repositories that implement
/// both Command and Query traits share a single `Arc` via `.clone()`.
pub fn wire(pool: SqlitePool) -> SqliteWireOutput {
let user = Arc::new(SqliteUserRepository::new(pool.clone()));
let channel = Arc::new(SqliteChannelRepository::new(pool.clone()));