mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-16 05:55:09 +00:00
fix(tracks): rank video picks by quality across regional tags and in hybrid
One video language request that matches several regional tags now gives one video, the best of them; hybrid bases and the DV source use the same pick, and hybrid --worst no longer needs -q. Thanks to reel.deal for the report and the first patch.
This commit is contained in:
@@ -9,12 +9,14 @@ from __future__ import annotations
|
||||
|
||||
import inspect
|
||||
import logging
|
||||
from pathlib import Path
|
||||
from typing import Any, Optional, cast
|
||||
|
||||
import pytest
|
||||
import requests
|
||||
|
||||
from unshackle.commands.dl import dl
|
||||
from unshackle.core import binaries
|
||||
from unshackle.core.api.handlers import DEFAULT_DOWNLOAD_PARAMS
|
||||
from unshackle.core.constants import DOWNLOAD_LICENCE_ONLY
|
||||
from unshackle.core.service import Service
|
||||
@@ -81,6 +83,15 @@ class FakeService:
|
||||
raise AttributeError(name)
|
||||
|
||||
|
||||
def stub_hybrid(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""Let a hybrid run start without dovi_tool, and load the service's tracks with no probes."""
|
||||
monkeypatch.setattr(binaries, "DoviTool", Path("/unused/dovi_tool"), raising=False)
|
||||
monkeypatch.setattr(
|
||||
"unshackle.commands.dl.load_tracks",
|
||||
lambda service, title, **_: setattr(title, "tracks", service.get_tracks(title)),
|
||||
)
|
||||
|
||||
|
||||
def run(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
|
||||
Reference in New Issue
Block a user