Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ Removed unnecessary default values. #21

Merged
merged 1 commit into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions tidal_dl_ng/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@


class BaseConfig:
data: ModelSettings | ModelToken = None
file_path: str = None
cls_model: object = None
data: ModelSettings | ModelToken
file_path: str
cls_model: ModelSettings | ModelToken
path_base: str = path_base()

def save(self, config_to_compare: str = None) -> None:
Expand Down Expand Up @@ -69,22 +69,19 @@ def read(self, path: str) -> bool:


class Settings(BaseConfig, metaclass=SingletonMeta):
cls_model = ModelSettings
data = None

def __init__(self):
self.cls_model = ModelSettings
self.file_path = path_file_settings()
self.read(self.file_path)


class Tidal(BaseConfig, metaclass=SingletonMeta):
cls_model = ModelToken
session: tidalapi.Session = None
data: ModelToken = None
session: tidalapi.Session
token_from_storage: bool = False
settings: Settings = None
settings: Settings

def __init__(self, settings: Settings = None):
self.cls_model = ModelToken
tidal_config: tidalapi.Config = tidalapi.Config(item_limit=10000)
self.session = tidalapi.Session(tidal_config)
# self.session.config.client_id = "km8T1xS355y7dd3H"
Expand Down
10 changes: 5 additions & 5 deletions tidal_dl_ng/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ def download(


class Download:
settings: Settings = None
session: Session = None
settings: Settings
session: Session
skip_existing: SkipExisting = False
fn_logger: Callable = None
progress_gui: ProgressBars = None
progress: Progress = None
fn_logger: Callable
progress_gui: ProgressBars
progress: Progress

def __init__(
self,
Expand Down
16 changes: 8 additions & 8 deletions tidal_dl_ng/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@

# TODO: Make more use of Exceptions
class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
settings: Settings = None
tidal: Tidal = None
dl: Download = None
threadpool: QtCore.QThreadPool = None
tray: QtWidgets.QSystemTrayIcon = None
spinner: QtWaitingSpinner = None
settings: Settings
tidal: Tidal
dl: Download
threadpool: QtCore.QThreadPool
tray: QtWidgets.QSystemTrayIcon
spinner: QtWaitingSpinner
spinner_start: QtCore.Signal = QtCore.Signal(QtWidgets.QWidget)
spinner_stop: QtCore.Signal = QtCore.Signal()
pb_item: QtWidgets.QProgressBar = None
pb_item: QtWidgets.QProgressBar
s_item_advance: QtCore.Signal = QtCore.Signal(float)
s_item_name: QtCore.Signal = QtCore.Signal(str)
s_list_name: QtCore.Signal = QtCore.Signal(str)
pb_list: QtWidgets.QProgressBar = None
pb_list: QtWidgets.QProgressBar
s_list_advance: QtCore.Signal = QtCore.Signal(float)
s_pb_reset: QtCore.Signal = QtCore.Signal()
s_populate_tree_lists: QtCore.Signal = QtCore.Signal(list)
Expand Down
34 changes: 17 additions & 17 deletions tidal_dl_ng/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@


class Metadata:
path_file: str = None
title: str = None
album: str = None
albumartist: str = None
artists: [str] = None
copy_right: str = None
tracknumber: int = None
discnumber: int = None
totaldisc: int = None
totaltrack: int = None
date: str = None
composer: [str] = None
isrc: str = None
lyrics: str = None
path_cover: str = None
url_cover: str = None
m: mutagen.mp4.MP4 | mutagen.mp4.MP4 | mutagen.flac.FLAC = None
path_file: str
title: str
album: str
albumartist: str
artists: [str]
copy_right: str
tracknumber: int
discnumber: int
totaldisc: int
totaltrack: int
date: str
composer: [str]
isrc: str
lyrics: str
path_cover: str
url_cover: str
m: mutagen.mp4.MP4 | mutagen.mp4.MP4 | mutagen.flac.FLAC

def __init__(
self,
Expand Down
Loading