Skip to content

Commit 5cdf482

Browse files
committed
refactor(downloader): 🔧 reorganize TrackStreamInfo class and imports
* Moved `TrackStreamInfo` class definition from `download.py` to `downloader.py`. * Removed redundant `dataclass` import from `download.py`. * Updated import statements to maintain clarity and organization.
1 parent 0939bc0 commit 5cdf482

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

tidal_dl_ng/download.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import time
1717
from collections.abc import Callable
1818
from concurrent import futures
19-
from dataclasses import dataclass
2019
from threading import Event
2120
from uuid import uuid4
2221

@@ -72,20 +71,10 @@
7271
name_builder_title,
7372
)
7473
from tidal_dl_ng.metadata import Metadata
75-
from tidal_dl_ng.model.downloader import DownloadSegmentResult
74+
from tidal_dl_ng.model.downloader import DownloadSegmentResult, TrackStreamInfo
7675
from tidal_dl_ng.model.gui_data import ProgressBars
7776

7877

79-
@dataclass
80-
class TrackStreamInfo:
81-
"""Container for track stream information."""
82-
83-
stream_manifest: StreamManifest | None
84-
file_extension: str
85-
requires_flac_extraction: bool
86-
media_stream: Stream | None
87-
88-
8978
# TODO: Set appropriate client string and use it for video download.
9079
# https://github.com/globocom/m3u8#using-different-http-clients
9180
class RequestsClient:

tidal_dl_ng/model/downloader.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from dataclasses import dataclass
33

44
from requests import HTTPError
5+
from tidalapi.media import Stream, StreamManifest
56

67

78
@dataclass
@@ -11,3 +12,13 @@ class DownloadSegmentResult:
1112
path_segment: pathlib.Path
1213
id_segment: int
1314
error: HTTPError | None = None
15+
16+
17+
@dataclass
18+
class TrackStreamInfo:
19+
"""Container for track stream information."""
20+
21+
stream_manifest: StreamManifest | None
22+
file_extension: str
23+
requires_flac_extraction: bool
24+
media_stream: Stream | None

0 commit comments

Comments
 (0)