Dropping channel.next_download. Removing noisy download logs.

This commit is contained in:
Roland 2021-12-27 16:43:52 -07:00
parent 22031c5860
commit f830fe3dcc
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
4 changed files with 39 additions and 10 deletions

View file

@ -67,16 +67,18 @@ async def get_channels_video_count() -> Dict[int, int]:
return video_counts
def get_channel(source_id: str = None, link: str = None, url: str = None, return_dict: bool = True
) -> Union[dict, Channel]:
COD = Union[dict, Channel]
def get_channel(source_id: str = None, link: str = None, url: str = None, return_dict: bool = True) -> COD:
"""
Attempt to find a Channel using the provided params. The params are in order of reliability.
Raises UnknownChannel if no channel is found.
"""
with get_db_session() as session:
channel: COD = None # noqa
# Try by source_id first.
channel = None
if source_id:
channel = session.query(Channel).filter_by(source_id=source_id).one_or_none()
if not channel and link: