mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-22 16:06:19 -05:00
Dropping channel.next_download. Removing noisy download logs.
This commit is contained in:
parent
22031c5860
commit
f830fe3dcc
4 changed files with 39 additions and 10 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue