Working on broken filter

This commit is contained in:
Fabrice Quenneville 2020-11-21 16:47:32 -05:00
parent 5f33525f24
commit 1b3390d349
2 changed files with 26 additions and 5 deletions

View File

@ -91,10 +91,30 @@ def main():
# if marked for deletion delete and unwatch the video
if "-del" in sys.argv:
medialibrary.unwatch(filepath, delete = True)
#medialibrary.unwatch(filepath, delete = True)
pass
elif sys.argv[1] == "test":
print(medialibrary)
exit()
# Pulling list of marked videos / original keys for the medialibrary.videos dictionary
keylist = [filepath for filepath in medialibrary.videos if medialibrary.videos[filepath].useful]
keylist.sort()
for filepath in keylist:
if medialibrary.videos[filepath].useful:
if "formated" in printop or "verbose" in printop:
if medialibrary.videos[filepath].error:
print(f"{BColors.FAIL}{medialibrary.videos[filepath].fprint()}{BColors.ENDC}")
else:
print(medialibrary.videos[filepath].fprint())
else:
if medialibrary.videos[filepath].error:
print(f"{BColors.FAIL}{medialibrary.videos[filepath]}{BColors.ENDC}")
else:
print(medialibrary.videos[filepath])
# if marked for deletion delete and unwatch the video
if "-del" in sys.argv:
medialibrary.unwatch(filepath, delete = True)
elif sys.argv[1] == "convert":
counter = 0
@ -148,7 +168,8 @@ def main():
# if marked for deletion delete and unwatch the video
if "-del" in sys.argv:
medialibrary.unwatch(filepath, delete = True)
#medialibrary.unwatch(filepath, delete = True)
pass

View File

@ -117,7 +117,7 @@ class MediaLibrary():
self.videos[filepath].useful = useful
# keep video if useful and user wants to also filter by selected resolutions
if self.videos[filepath].useful and len([filtr for filtr in self.filters if filtr in ["lowres", "subsd", "hd", "sd", "720p", "1080p", "uhd"]]) > 0:
if self.videos[filepath].useful and len([filtr for filtr in self.filters if filtr in ["lowres", "hd", "subsd", "sd", "720p", "1080p", "uhd"]]) > 0:
useful = False
if "subsd" in self.filters and self.videos[filepath].definition in ["subsd"]: