mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Handling if multiple videos exist at start of video download.
This commit is contained in:
parent
2aa30e1674
commit
b705e08e48
2 changed files with 3 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ from sqlalchemy.orm.collections import InstrumentedList
|
|||
from wrolpi.common import Base, ModelHelper, tsvector, logger, recursive_map, get_media_directory
|
||||
from wrolpi.dates import TZDateTime, now, from_timestamp, strptime_ms, strftime
|
||||
from wrolpi.db import optional_session
|
||||
from wrolpi.downloader import download_manager
|
||||
from wrolpi.errors import FileGroupIsTagged
|
||||
from wrolpi.files import indexers
|
||||
from wrolpi.media_path import MediaPathType
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue