mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 20:00:15 +00:00
handle rescan name change
This commit is contained in:
parent
851fbae900
commit
f5f46349b2
@ -205,9 +205,16 @@ class YoutubeVideo(YouTubeItem, YoutubeSubtitle):
|
|||||||
# when indexing from download task
|
# when indexing from download task
|
||||||
vid_path = self.build_dl_cache_path()
|
vid_path = self.build_dl_cache_path()
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
# when reindexing
|
# when reindexing needs to handle title rename
|
||||||
base = self.app_conf["videos"]
|
channel = os.path.split(self.json_data["media_url"])[0]
|
||||||
vid_path = os.path.join(base, self.json_data["media_url"])
|
channel_dir = os.path.join(self.app_conf["videos"], channel)
|
||||||
|
all_files = os.listdir(channel_dir)
|
||||||
|
for file in all_files:
|
||||||
|
if self.youtube_id in file:
|
||||||
|
vid_path = os.path.join(channel_dir, file)
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
raise FileNotFoundError
|
||||||
|
|
||||||
duration_handler = DurationConverter()
|
duration_handler = DurationConverter()
|
||||||
duration = duration_handler.get_sec(vid_path)
|
duration = duration_handler.get_sec(vid_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user