More unkown type fixing, #build
Changed: - Fixed issue with unknown type extraction - Fixed for bulk channel parsing - Bump dependencies
This commit is contained in:
commit
c7651335ee
|
|
@ -1,10 +1,10 @@
|
|||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v5.0.0
|
||||
rev: v6.0.0
|
||||
hooks:
|
||||
- id: end-of-file-fixer
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 25.1.0
|
||||
rev: 25.9.0
|
||||
hooks:
|
||||
- id: black
|
||||
alias: python
|
||||
|
|
@ -31,7 +31,7 @@ repos:
|
|||
- id: codespell
|
||||
exclude: ^frontend/package-lock.json
|
||||
- repo: https://github.com/pre-commit/mirrors-eslint
|
||||
rev: v9.30.1
|
||||
rev: v9.36.0
|
||||
hooks:
|
||||
- id: eslint
|
||||
name: eslint
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ def get_last_channel_videos(
|
|||
builder = VideoQueryBuilder(config, limit=limit)
|
||||
|
||||
queries = []
|
||||
if query_filter is None:
|
||||
if query_filter is None or query_filter == VideoTypeEnum.UNKNOWN:
|
||||
queries = builder.build_queries()
|
||||
elif isinstance(query_filter, list):
|
||||
queries = builder.build_queries(vid_types=query_filter)
|
||||
|
|
@ -113,7 +113,7 @@ def get_last_channel_videos(
|
|||
|
||||
last_videos: list[dict] = []
|
||||
|
||||
if not query:
|
||||
if not queries:
|
||||
return last_videos
|
||||
|
||||
for vid_type_enum, limit_amount in queries:
|
||||
|
|
|
|||
|
|
@ -68,6 +68,17 @@ def test_build_specific_query(default_config, empty_overwrites):
|
|||
assert result == (VideoTypeEnum.VIDEOS, 5)
|
||||
|
||||
|
||||
def test_build_unknown_type(default_config, empty_overwrites):
|
||||
"""unknown vid_type build list"""
|
||||
builder = VideoQueryBuilder(default_config, empty_overwrites, limit=None)
|
||||
result = builder.build_queries()
|
||||
assert result == [
|
||||
(VideoTypeEnum.VIDEOS, None),
|
||||
(VideoTypeEnum.STREAMS, None),
|
||||
(VideoTypeEnum.SHORTS, None),
|
||||
]
|
||||
|
||||
|
||||
def test_build_multiple_queries(default_config, empty_overwrites):
|
||||
"""vid_type list"""
|
||||
builder = VideoQueryBuilder(default_config, empty_overwrites)
|
||||
|
|
@ -104,6 +115,25 @@ def test_zero_query_not_included(default_config):
|
|||
assert not result # Should be skipped due to 0
|
||||
|
||||
|
||||
def test_zero_config_overwrite(default_config):
|
||||
"""zero default config but with overwrite"""
|
||||
new_default = default_config.copy()
|
||||
new_default["subscriptions"]["shorts_channel_size"] = 0
|
||||
new_overwrites = {
|
||||
"subscriptions_channel_size": 20,
|
||||
"subscriptions_live_channel_size": 20,
|
||||
"subscriptions_shorts_channel_size": 8,
|
||||
}
|
||||
|
||||
builder = VideoQueryBuilder(new_default, new_overwrites, limit=True)
|
||||
result = builder.build_queries()
|
||||
assert result == [
|
||||
(VideoTypeEnum.VIDEOS, 20),
|
||||
(VideoTypeEnum.STREAMS, 20),
|
||||
(VideoTypeEnum.SHORTS, 8),
|
||||
]
|
||||
|
||||
|
||||
def test_invalid_video_type_is_ignored(default_config):
|
||||
"""invalid enum"""
|
||||
builder = VideoQueryBuilder(default_config)
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@ apprise==1.9.4
|
|||
celery==5.5.3
|
||||
django-auth-ldap==5.2.0
|
||||
django-celery-beat==2.8.1
|
||||
django-cors-headers==4.7.0
|
||||
Django==5.2.5
|
||||
django-cors-headers==4.9.0
|
||||
Django==5.2.6
|
||||
djangorestframework==3.16.1
|
||||
drf-spectacular==0.28.0
|
||||
Pillow==11.3.0
|
||||
redis==6.4.0
|
||||
requests==2.32.5
|
||||
ryd-client==0.0.6
|
||||
uvicorn==0.35.0
|
||||
whitenoise==6.9.0
|
||||
yt-dlp[default]==2025.8.27
|
||||
uvicorn==0.37.0
|
||||
whitenoise==6.11.0
|
||||
yt-dlp[default]==2025.9.26
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ services:
|
|||
- ELASTIC_PASSWORD=verysecret # set password for Elasticsearch
|
||||
- TZ=America/New_York # set your time zone
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health/"]
|
||||
interval: 2m
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -4,7 +4,7 @@ pre-commit==4.3.0
|
|||
pylint-django==2.6.1
|
||||
pylint==3.3.8
|
||||
pytest-django==4.11.1
|
||||
pytest==8.4.1
|
||||
pytest==8.4.2
|
||||
python-dotenv==1.1.1
|
||||
requirementscheck==0.1.0
|
||||
types-requests==2.32.4.20250809
|
||||
types-requests==2.32.4.20250913
|
||||
|
|
|
|||
Loading…
Reference in New Issue