many changes
This commit is contained in:
@@ -285,6 +285,7 @@ fn convert_params(params: &[QueryParam]) -> Vec<rusqlite::types::Value> {
|
||||
.collect()
|
||||
}
|
||||
|
||||
// TRACES: UR-002, UR-012 | DR-012 | UT-014, UT-015, UT-016, UT-017, UT-018, UT-019, UT-020, UT-021, UT-022, UT-023, UT-025
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
@@ -156,6 +156,7 @@ impl Database {
|
||||
}
|
||||
}
|
||||
|
||||
// TRACES: UR-002, UR-012, UR-019, UR-025 | DR-012 | UT-014, UT-015, UT-016, UT-017, UT-018, UT-019, UT-020, UT-021, UT-022, UT-023, UT-025
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
@@ -17,6 +17,7 @@ pub const MIGRATIONS: &[(&str, &str)] = &[
|
||||
("012_download_source", MIGRATION_012),
|
||||
("013_downloads_item_status_index", MIGRATION_013),
|
||||
("014_series_audio_preferences", MIGRATION_014),
|
||||
("015_device_id", MIGRATION_015),
|
||||
];
|
||||
|
||||
/// Initial schema migration
|
||||
@@ -638,3 +639,20 @@ CREATE TABLE IF NOT EXISTS series_audio_preferences (
|
||||
CREATE INDEX IF NOT EXISTS idx_series_audio_prefs_user_series
|
||||
ON series_audio_preferences(user_id, series_id);
|
||||
"#;
|
||||
|
||||
/// Migration to add device ID storage
|
||||
/// - Creates app_settings table for app-wide configuration (device ID, etc.)
|
||||
/// - Device ID is generated once and persisted for Jellyfin server identification
|
||||
const MIGRATION_015: &str = r#"
|
||||
-- App-wide settings table for device ID and other app-level configuration
|
||||
-- Device ID is a unique identifier for this app installation
|
||||
-- Required for Jellyfin server communication and session tracking
|
||||
CREATE TABLE IF NOT EXISTS app_settings (
|
||||
key TEXT PRIMARY KEY,
|
||||
value TEXT NOT NULL,
|
||||
updated_at TEXT DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- Create index for efficient lookups (though key is already primary key)
|
||||
CREATE INDEX IF NOT EXISTS idx_app_settings_key ON app_settings(key);
|
||||
"#;
|
||||
|
||||
Reference in New Issue
Block a user