fix manual import cleanup metadata, #331

This commit is contained in:
simon 2022-08-26 17:07:55 +07:00
parent c70942ff90
commit e467beb1c7
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 6 additions and 4 deletions

View File

@ -555,11 +555,13 @@ class ManualImport:
def _cleanup(self, json_data):
"""cleanup leftover files"""
if os.path.exists(self.current_video["metadata"]):
os.remove(self.current_video["metadata"])
meta_data = self.current_video["metadata"]
if meta_data and os.path.exists(meta_data):
os.remove(meta_data)
if os.path.exists(self.current_video["thumb"]):
os.remove(self.current_video["thumb"])
thumb = self.current_video["thumb"]
if thumb and os.path.exists(thumb):
os.remove(thumb)
for subtitle_file in self.current_video["subtitle"]:
if os.path.exists(subtitle_file):