Loading from files and listing now working
This commit is contained in:
parent
b6c36624d3
commit
108a8a083f
@ -68,29 +68,35 @@ def main():
|
|||||||
|
|
||||||
# Actions
|
# Actions
|
||||||
if sys.argv[1] == "list":
|
if sys.argv[1] == "list":
|
||||||
if any("-files" in argv for argv in sys.argv):
|
|
||||||
pass
|
|
||||||
elif any("-dir" in argv for argv in sys.argv):
|
|
||||||
videolist = []
|
|
||||||
for directory in directories:
|
|
||||||
videolist += get_videolist(directory, inputs, filters)
|
|
||||||
videolist.sort()
|
|
||||||
for video in videolist:
|
|
||||||
print(f"{get_codec(video)} - {get_print_resolution(video)} - {get_size(video)}mb - {video}")
|
|
||||||
if len(filters) > 0 and "fferror" in filters:
|
|
||||||
print(f"{BColors.WARNING}WARNING: {get_fferror(video)}{BColors.ENDC}")
|
|
||||||
|
|
||||||
else:
|
for filepath in medialibrary.videos:
|
||||||
print(f"{BColors.FAIL}Missing directory: {BColors.ENDC}")
|
if medialibrary.videos[filepath].useful:
|
||||||
|
print(medialibrary.videos[filepath])
|
||||||
|
#print(self.videos[filepath])
|
||||||
|
# if any("-files" in argv for argv in sys.argv):
|
||||||
|
# pass
|
||||||
|
# elif any("-dir" in argv for argv in sys.argv):
|
||||||
|
# videolist = []
|
||||||
|
# for directory in directories:
|
||||||
|
# videolist += get_videolist(directory, inputs, filters)
|
||||||
|
# videolist.sort()
|
||||||
|
# for video in videolist:
|
||||||
|
# print(f"{get_codec(video)} - {get_print_resolution(video)} - {get_size(video)}mb - {video}")
|
||||||
|
# if len(filters) > 0 and "fferror" in filters:
|
||||||
|
# print(f"{BColors.WARNING}WARNING: {get_fferror(video)}{BColors.ENDC}")
|
||||||
|
|
||||||
|
# else:
|
||||||
|
# print(f"{BColors.FAIL}Missing directory: {BColors.ENDC}")
|
||||||
elif sys.argv[1] == "test":
|
elif sys.argv[1] == "test":
|
||||||
if any("-files" in argv for argv in sys.argv):
|
pass
|
||||||
pass
|
# if any("-files" in argv for argv in sys.argv):
|
||||||
elif any("-dir" in argv for argv in sys.argv):
|
# pass
|
||||||
print(medialibrary)
|
# elif any("-dir" in argv for argv in sys.argv):
|
||||||
#print(f"directories = {directories}, inputs = {inputs}, filters = {filters}, outputs = {outputs}")
|
# print(medialibrary)
|
||||||
exit()
|
# #print(f"directories = {directories}, inputs = {inputs}, filters = {filters}, outputs = {outputs}")
|
||||||
else:
|
# exit()
|
||||||
print("{BColors.FAIL}Missing directory: {BColors.ENDC}")
|
# else:
|
||||||
|
# print("{BColors.FAIL}Missing directory: {BColors.ENDC}")
|
||||||
|
|
||||||
|
|
||||||
elif sys.argv[1] == "convert":
|
elif sys.argv[1] == "convert":
|
||||||
|
|||||||
@ -25,8 +25,9 @@ class MediaLibrary():
|
|||||||
This is the library object who holds the information about the workspace and all the videos in it.
|
This is the library object who holds the information about the workspace and all the videos in it.
|
||||||
'''
|
'''
|
||||||
if files:
|
if files:
|
||||||
pass
|
for filepath in files:
|
||||||
# self.files = files
|
self.videos[filepath] = Video(filepath)
|
||||||
|
|
||||||
elif directories:
|
elif directories:
|
||||||
self.directories = directories
|
self.directories = directories
|
||||||
else:
|
else:
|
||||||
@ -39,11 +40,6 @@ class MediaLibrary():
|
|||||||
|
|
||||||
self.filter_videos()
|
self.filter_videos()
|
||||||
|
|
||||||
for filepath in self.videos:
|
|
||||||
if self.videos[filepath].useful:
|
|
||||||
print(self.videos[filepath])
|
|
||||||
#print(self.videos[filepath])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user