fix collections being deleted under certain conditions when using translations

This commit is contained in:
meisnate12 2024-05-02 09:23:55 -04:00
parent 8d5b59cdab
commit 83db5397d6
2 changed files with 3 additions and 2 deletions

View file

@ -16,5 +16,6 @@ Fixed `amazon` ID in `streaming` when region is `CA`
Catch bad ID data from Plex Catch bad ID data from Plex
Fixes `- git` file calls Fixes `- git` file calls
Ignore empty Environment Variables Ignore empty Environment Variables
Fixes collections being deleted under certain conditions when using translations
Various other Minor Fixes Various other Minor Fixes

View file

@ -370,7 +370,7 @@ class CollectionBuilder:
trans_summary = apply_vars(trans_summary, trans_vars, trans_key, self.limit) trans_summary = apply_vars(trans_summary, trans_vars, trans_key, self.limit)
delete_cols = [] delete_cols = []
if (self.name and self.name != en_name) or (not self.name and en_name != trans_name): if (self.name and self.name != en_name) or (not self.name and trans_name and en_name != trans_name):
delete_cols.append(en_name) delete_cols.append(en_name)
if self.name and self.name != trans_name and en_name != trans_name: if self.name and self.name != trans_name and en_name != trans_name:
delete_cols.append(trans_name) delete_cols.append(trans_name)
@ -390,7 +390,7 @@ class CollectionBuilder:
if not self.name: if not self.name:
self.name = trans_name if trans_name else en_name self.name = trans_name if trans_name else en_name
logger.info(self.name) logger.info(f"Final Name: {self.name}")
if en_summary or trans_summary: if en_summary or trans_summary:
self.summaries["translation"] = trans_summary if trans_summary else en_summary self.summaries["translation"] = trans_summary if trans_summary else en_summary