- for e in [e for e in scandir(PATH_DIR_DOWNLOADS) if isfile(e.path)]:
- before_ext = splitext(e.path)[0]
- id_ = VideoId(before_ext.split('[')[-1].split(']')[0])
- downloads_db[id_] = PathStr(e.path)
- return downloads_db
+ for path in [PathStr(e.path) for e
+ in scandir(PATH_DIR_DOWNLOADS) if isfile(e.path)]:
+ downloads_db[id_from_filename(path)] = PathStr(path)
+ unfinished = []
+ for path in [PathStr(e.path) for e
+ in scandir(PATH_DIR_TEMP) if isfile(e.path)]:
+ unfinished += [id_from_filename(path)]
+ return downloads_db, unfinished