Repository navigation
Keep OnDeck movies in year folders out of move-back - #233
Conversation
Movies stored as Film/2012/<movie>.mkv had no metadata match during move-back (lookups used the cache path, the OnDeck data is keyed by real path), so the folder-name fallback read 2012 as a TV season. A movie still on a user's OnDeck was queued to return to the array, kept by the later filter, and reported as a failed move on every run. The same fallback gave every movie in those folders the name "Film", so one OnDeck movie kept the watched ones on cache. - Keep a cached file whose real path is on the current OnDeck/Watchlist. - Look up metadata by real path first; a known movie skips the season folder check and the TV regex. - Drop anything this run keeps on cache (all_active_media) from the move-back lists, so it is not counted as a restore or a failed move.
|
Does this fix add any other complications? From the sound of it, it happened because they used a weird non-standard naming convention for movies folder names. There shouldnt be movie files just loose inside a year folder, it should be... Movies/2026/{moviename} (2026)/{moviename (2026).mkv} Or i guess various variations depending on radarr settings, but i dont recall any that put all the films in a year folder loose like that. I guess its fine, I just dont want to get into the habit of supporting all the weird badly-configured edge cases. That way madness lies. I may be misunderstanding the entire issue though. |
It was my case, i am not using Radarr/Sonarr and my folder structure are |
|
Fair concern, and I'm with you on not chasing every odd setup. This one turned out to be wider than the loose-files layout though. The fallback treats any numbers-only folder in the path as a TV season, so your example layout hits it too. With So the fix isn't really a special case for year folders. It stops guessing from folder names when we already know the answer:
On complications: all three only ever make it keep a file it would otherwise have moved, or use better information for the decision. TV handling is unchanged, including date-based shows that use 2012 as a season folder, and there's a test for that. Worst case if something's off is a file stays on cache an extra run, not anything being moved or deleted that shouldn't be. |
Fixes #232.
Movies stored in year folders (
Film/2012/<movie>.mkv) went through move-back with no metadata match. The lookup used the cache path, but the OnDeck data is keyed by real path, so it fell back to guessing from folder names. That guess treats a numbers-only folder as a TV season, so a movie still on a user's OnDeck was read as "Film, season 2012" and queued to go back to the array. The later filter kept it, which was correct, but by then it had been logged as a restore and the run reported "1 file(s) failed to move to array" every time.The same guess also gave every movie in those folders the name "Film", so as long as one of them was on someone's OnDeck or Watchlist, watched movies in the other year folders were never moved back.
Changes:
Numbers-only season folders still work for date-based shows (
Show/2012/Show - S2012E05.mkv), and there's a test for that.Testing
tests/test_year_folder_moveback.py: OnDeck movie in a year folder is kept, a watched movie in another year folder is moved back, a known movie's name ignores the year folder, a date-based show is still read as TV, and files kept this run never reach the move-back lists.