Skip to main content

MIGRATION_025

Constant MIGRATION_025 

Source
const MIGRATION_025: &str = r#"
UPDATE items SET synced_at = NULL;
"#;
Expand description

Force cached items to be re-fetched so library_id is populated.

save_to_cache bound library_id NULL for every row it wrote, so nothing in the cache knew which library it came from. The only available association was the collection_typeitem_type taxonomy, which cannot tell two libraries of the same type apart — a server with “TV” and “Shows” served both the same contents — and says nothing at all about a library whose type it does not map (Books, Photos, Collections, or a mixed library where Jellyfin sends no collection type).

The write path now records the library. Existing rows cannot be repaired locally — the association was never stored — so they are marked stale and re-fetched on next browse, exactly as MIGRATION_018 did for is_folder.

Deliberately does not delete anything: downloads, favourites and playback positions live in other tables and are untouched, and a cleared synced_at only means “ask the server again”, so an offline user keeps browsing what they already had until the next successful fetch.

TRACES: UR-007 | DR-278