fix(launcher): find previous season when current dir is missing

- findLastEpisodeInPreviousSeason now falls back to matching by season number when the current season dir isn't in the listed seasons (e.g. deleted file's season folder)
- test: delete season-2 dir contents so the fallback path is exercised
This commit is contained in:
2026-07-17 23:10:45 -07:00
parent 6a92f428a3
commit 85a139cd00
2 changed files with 14 additions and 3 deletions
+1
View File
@@ -240,6 +240,7 @@ test('findPreviousEpisode falls back to prior season when a deleted file was the
try {
const season1 = path.join(seriesRoot, 'Season-1');
const season2 = path.join(seriesRoot, 'Season-2');
fs.rmSync(path.join(season2, 'Show - S02E01.mkv'));
const missing = path.join(season2, 'Show - S02E01 - Deleted Cut.mkv');
assert.equal(findPreviousEpisode(missing), path.join(season1, 'Show - S01E03.mkv'));
} finally {