summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Honz <exislow+github@gmail.com>2024-04-20 17:29:42 +0200
committerRobert Honz <exislow+github@gmail.com>2024-04-20 17:29:42 +0200
commit94dac6c5b9d4ddc64a18fc426a12a1a3ca00bc17 (patch)
tree896e8931ae9ffb07328a172419fd4448dd352ac2
parent083d6604f77bfe0344a64a544ca97d213da159a3 (diff)
downloadtidal-dl-ng-94dac6c5b9d4ddc64a18fc426a12a1a3ca00bc17.tar.gz
👷 Legacy code cleanup due to `tidalapi` update.
-rw-r--r--poetry.lock12
-rw-r--r--pyproject.toml3
-rw-r--r--tidal_dl_ng/constants.py24
-rw-r--r--tidal_dl_ng/gui.py4
4 files changed, 26 insertions, 17 deletions
diff --git a/poetry.lock b/poetry.lock
index 205a66c..ca0f090 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -503,6 +503,16 @@ files = [
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"
description = "Python bindings for FFmpeg - with complex filtering support"
@@ -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)