Loading from files and listing now working
This commit is contained in:
parent
b6c36624d3
commit
108a8a083f
@ -68,29 +68,35 @@ def main():
|
||||
|
||||
# Actions
|
||||
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:
|
||||
print(f"{BColors.FAIL}Missing directory: {BColors.ENDC}")
|
||||
for filepath in medialibrary.videos:
|
||||
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":
|
||||
if any("-files" in argv for argv in sys.argv):
|
||||
pass
|
||||
elif any("-dir" in argv for argv in sys.argv):
|
||||
print(medialibrary)
|
||||
#print(f"directories = {directories}, inputs = {inputs}, filters = {filters}, outputs = {outputs}")
|
||||
exit()
|
||||
else:
|
||||
print("{BColors.FAIL}Missing directory: {BColors.ENDC}")
|
||||
pass
|
||||
# if any("-files" in argv for argv in sys.argv):
|
||||
# pass
|
||||
# elif any("-dir" in argv for argv in sys.argv):
|
||||
# print(medialibrary)
|
||||
# #print(f"directories = {directories}, inputs = {inputs}, filters = {filters}, outputs = {outputs}")
|
||||
# exit()
|
||||
# else:
|
||||
# print("{BColors.FAIL}Missing directory: {BColors.ENDC}")
|
||||
|
||||
|
||||
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.
|
||||
'''
|
||||
if files:
|
||||
pass
|
||||
# self.files = files
|
||||
for filepath in files:
|
||||
self.videos[filepath] = Video(filepath)
|
||||
|
||||
elif directories:
|
||||
self.directories = directories
|
||||
else:
|
||||
@ -39,11 +40,6 @@ class MediaLibrary():
|
||||
|
||||
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