Handling if multiple videos exist at start of video download.

This commit is contained in:
Roland 2024-02-22 13:12:26 -07:00
parent 2aa30e1674
commit b705e08e48
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
2 changed files with 3 additions and 1 deletions

View file

@ -211,7 +211,8 @@ class VideoDownloader(Downloader, ABC):
# Video may have been downloaded previously, get its location for error reporting.
location = None
with get_db_session() as session:
video = Video.get_by_url(url, session=session)
videos = session.query(Video).join(FileGroup).filter_by(url=url).all()
video = videos[0] if videos else None
if video and video.channel_id:
location = f'/videos/channel/{video.channel_id}/video/{video.id}'
elif video: