From 5a030671a2b05fa05bde321bf23aed36c93ec5f8 Mon Sep 17 00:00:00 2001 From: ske087 Date: Fri, 24 Jul 2026 16:10:23 +0300 Subject: [PATCH] Fix 3 bugs: delete_unused_media path mismatch, media not downloading on same-version, video EOS not advancing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - delete_unused_media: normalize Windows backslashes to forward slashes when comparing with playlist file_name (fixes file deleted after download) - update_playlist_if_needed: download media even when playlist version matches - _on_video_eos: now schedules next_media() — was an empty stub --- src/get_playlists_v2.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/get_playlists_v2.py b/src/get_playlists_v2.py index 8e039c9..c773b46 100644 --- a/src/get_playlists_v2.py +++ b/src/get_playlists_v2.py @@ -354,7 +354,9 @@ def delete_unused_media(playlist_data, media_dir): rel_path = os.path.relpath(full_path, media_dir) # Skip if file is in current playlist - if rel_path in referenced_files: + # Normalize paths to handle Windows backslashes vs server forward slashes + normalized_rel = rel_path.replace('\\', '/') + if normalized_rel in referenced_files or rel_path in referenced_files: continue # Delete unreferenced file