[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:
Jesse Bannon
2023-03-21 14:21:02 -07:00
committed by GitHub
parent 54b8b76034
commit 70d81bf20f
2 changed files with 9 additions and 1 deletions

View File

@@ -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

View File

@@ -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