mirror of
https://github.com/LukeHagar/ytdl-sub.git
synced 2025-12-06 04:22:12 +00:00
[BACKEND] Mark entry as deleted if all entries deleted in update (#559)
* [BACKEND] Mark entry as deleted if all entries deleted in update * make subtitles not found debug
This commit is contained in:
@@ -109,13 +109,21 @@ class InfoJsonDownloader(BaseDownloader[InfoJsonDownloaderOptions]):
|
||||
|
||||
# If the original entry file_path is no longer maintained in the new mapping, then
|
||||
# delete it
|
||||
num_original_files_deleted: int = 0
|
||||
for file_name in self._original_entry_mappings[entry.uid].file_names:
|
||||
if (
|
||||
entry.uid not in self._entry_mappings
|
||||
or file_name not in self._entry_mappings[entry.uid].file_names
|
||||
):
|
||||
num_original_files_deleted += 1
|
||||
self._enhanced_download_archive.delete_file_from_output_directory(file_name)
|
||||
|
||||
# If all original entry files are deleted, mark it as deleted
|
||||
if num_original_files_deleted == len(
|
||||
self._original_entry_mappings[entry.uid].file_names
|
||||
):
|
||||
self._enhanced_download_archive.num_entries_removed += 1
|
||||
|
||||
def download(self, entry: Entry) -> Entry:
|
||||
"""
|
||||
Mock the download by copying the entry file from the output directory into
|
||||
|
||||
@@ -183,7 +183,7 @@ class SubtitlesPlugin(Plugin[SubtitleOptions]):
|
||||
"""
|
||||
requested_subtitles = entry.kwargs("requested_subtitles")
|
||||
if not requested_subtitles:
|
||||
logger.info("subtitles not found for %s", entry.title)
|
||||
logger.debug("subtitles not found for %s", entry.title)
|
||||
return None
|
||||
|
||||
file_metadata: Optional[FileMetadata] = None
|
||||
|
||||
Reference in New Issue
Block a user