Skip archive failes and removed unused print

This commit is contained in:
2017-09-29 13:46:54 +02:00
parent 0262ce9f18
commit 1db8d3584e

View File

@@ -130,12 +130,14 @@ def scan_files(path, age=None, archives=True):
logging.exception('Error scanning video') logging.exception('Error scanning video')
continue continue
elif archives and filename.endswith(ARCHIVE_EXTENSIONS): # archive elif archives and filename.endswith(ARCHIVE_EXTENSIONS): # archive
try: print('archive')
video = scan_archive(filepath) pass
mediafiles.append(video) # try:
except (NotRarFile, RarCannotExec, ValueError): # pragma: no cover # video = scan_archive(filepath)
logging.exception('Error scanning archive') # mediafiles.append(video)
continue # except (NotRarFile, RarCannotExec, ValueError): # pragma: no cover
# logging.exception('Error scanning archive')
# continue
elif filename.endswith(SUBTITLE_EXTENSIONS): # subtitle elif filename.endswith(SUBTITLE_EXTENSIONS): # subtitle
try: try:
subtitle = scan_subtitle(filepath) subtitle = scan_subtitle(filepath)
@@ -153,7 +155,7 @@ def scan_files(path, age=None, archives=True):
def organize_files(path): def organize_files(path):
hashList = {} hashList = {}
mediafiles = scan_files(path) mediafiles = scan_files(path)
print(mediafiles) # print(mediafiles)
for file in mediafiles: for file in mediafiles:
hashList.setdefault(file.__hash__(),[]).append(file) hashList.setdefault(file.__hash__(),[]).append(file)
@@ -252,7 +254,7 @@ def save_subtitles(files, single=False, directory=None, encoding=None):
def main(): def main():
# episodePath = '/Volumes/media/tv/Black Mirror/Black Mirror Season 01/' # episodePath = '/Volumes/media/tv/Black Mirror/Black Mirror Season 01/'
episodePath = '/Volumes/media/tv/Black Mirror/' episodePath = '/media/hdd1/tv/Black Mirror'
t = tvdb_api.Tvdb() t = tvdb_api.Tvdb()
@@ -262,4 +264,4 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
main() main()