diff --git a/poetry.lock b/poetry.lock index 205a66c..ca0f090 100644 --- a/poetry.lock +++ b/poetry.lock @@ -502,6 +502,16 @@ files = [ [package.extras] test = ["pytest (>=6)"] +[[package]] +name = "ffmpeg" +version = "1.4" +description = "ffmpeg python package url [https://github.com/jiashaokun/ffmpeg]" +optional = false +python-versions = "*" +files = [ + {file = "ffmpeg-1.4.tar.gz", hash = "sha256:6931692c890ff21d39938433c2189747815dca0c60ddc7f9bb97f199dba0b5b9"}, +] + [[package]] name = "ffmpeg-python" version = "0.2.0" @@ -2148,4 +2158,4 @@ gui = ["pyqtdarktheme", "pyside6"] [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.12" -content-hash = "da2f28a635a35b07a2fe5b3e559ab00376b6fa59c67711baf3551ed6f037af1f" +content-hash = "b04cffe26d9deb359b534d6e81207e14427fba01ce962ab823a1a581fe155317" diff --git a/pyproject.toml b/pyproject.toml index 849ef5f..96cab70 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,6 +41,7 @@ mpegdash = "^0.4.0" rich = "^13.7.1" toml = "^0.10.2" typer = "^0.12.3" +ffmpeg = "^1.4" [tool.poetry.extras] gui = ["pyside6", "pyqtdarktheme"] @@ -171,7 +172,7 @@ profile = "black" multi_line_output = 3 indent = 4 color_output = true -known_third_party = ["Crypto", "PySide6", "coloredlogs", "dataclasses_json", "ffmpeg", "m3u8", "mpegdash", "mutagen", "pathvalidate", "requests", "rich", "tidalapi", "toml", "typer"] +known_third_party = ["Crypto", "PySide6", "coloredlogs", "dataclasses_json", "mutagen", "pathvalidate", "requests", "rich", "tidalapi", "toml", "typer"] [tool.mypy] # https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file diff --git a/tidal_dl_ng/constants.py b/tidal_dl_ng/constants.py index 2c58e36..92664e4 100644 --- a/tidal_dl_ng/constants.py +++ b/tidal_dl_ng/constants.py @@ -1,4 +1,4 @@ -from enum import IntEnum, StrEnum +from enum import StrEnum CTX_TIDAL: str = "tidal" REQUESTS_TIMEOUT_SEC: int = 45 @@ -7,11 +7,11 @@ UNIQUIFY_THRESHOLD: int = 99 FILENAME_SANITIZE_PLACEHOLDER: str = "_" -class QualityVideo(IntEnum): - P360: int = 360 - P480: int = 480 - P720: int = 720 - P1080: int = 1080 +class QualityVideo(StrEnum): + P360: str = "360" + P480: str = "480" + P720: str = "720" + P1080: str = "1080" class MediaType(StrEnum): @@ -29,12 +29,12 @@ class SkipExisting(StrEnum): Append: str = "append" -class CoverDimensions(IntEnum): - Px80: int = 80 - Px160: int = 160 - Px320: int = 320 - Px640: int = 640 - Px1280: int = 1280 +class CoverDimensions(StrEnum): + Px80: str = "80" + Px160: str = "160" + Px320: str = "320" + Px640: str = "640" + Px1280: str = "1280" class TidalLists(StrEnum): diff --git a/tidal_dl_ng/gui.py b/tidal_dl_ng/gui.py index 542f19f..dd500fc 100644 --- a/tidal_dl_ng/gui.py +++ b/tidal_dl_ng/gui.py @@ -2,7 +2,6 @@ import math import sys import time from collections.abc import Callable -from enum import Enum from requests.exceptions import HTTPError @@ -304,8 +303,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): ] for item in l_cb: - needle: str | int = item["setting"].name if isinstance(item["setting"], Enum) else item["setting"] - idx = item["element"].findText(needle) + idx = item["element"].findData(item["setting"]) if idx > -1: item["element"].setCurrentIndex(idx)