removed unused settings

This commit is contained in:
Hellow2 2023-06-15 11:53:55 +02:00
parent fb3a1e22b0
commit 1324802db7
5 changed files with 2 additions and 123 deletions

View File

@ -23,9 +23,8 @@ from ..utils.enums.source import SourcePages
from ..utils.enums.album import AlbumType from ..utils.enums.album import AlbumType
from ..audio import write_metadata_to_target, correct_codec from ..audio import write_metadata_to_target, correct_codec
from ..utils import shared from ..utils import shared
from ..utils.shared import DEFAULT_VALUES, DOWNLOAD_PATH, DOWNLOAD_FILE, THREADED, AUDIO_FORMAT from ..utils.shared import DOWNLOAD_PATH, DOWNLOAD_FILE, AUDIO_FORMAT
from ..utils.support_classes import Query, DownloadResult, DefaultTarget, EndThread, FinishedSearch from ..utils.support_classes import Query, DownloadResult
INDEPENDENT_DB_OBJECTS = Union[Label, Album, Artist, Song] INDEPENDENT_DB_OBJECTS = Union[Label, Album, Artist, Song]
INDEPENDENT_DB_TYPES = Union[Type[Song], Type[Album], Type[Artist], Type[Label]] INDEPENDENT_DB_TYPES = Union[Type[Song], Type[Album], Type[Artist], Type[Label]]

View File

@ -116,41 +116,6 @@ ID3.1: {', '.join(_sorted_id3_1_formats)}
description="The filename of the audio file." description="The filename of the audio file."
) )
self.DEFAULT_GENRE = StringAttribute(
name="default_genre",
value="Various Genre",
description="The default value for the genre field."
)
self.DEFAULT_LABEL = StringAttribute(
name="default_label",
value="Various Labels",
description="The Label refers to a lable that signs artists."
)
self.DEFAULT_ARTIST = StringAttribute(
name="default_artist",
value="Various Artists",
description="You know Various Artist."
)
self.DEFAULT_ALBUM = StringAttribute(
name="default_album",
value="Various Album",
description="This value will hopefully not be used."
)
self.DEFAULT_SONG = StringAttribute(
name="default_song",
value="Various Song",
description="If it has to fall back to this value, something did go really wrong."
)
self.DEFAULT_ALBUM_TYPE = StringAttribute(
name="default_album_type",
value="Other",
description="Weirdly enough I barely see this used in file systems."
)
self.ALBUM_TYPE_BLACKLIST = AlbumTypeListAttribute( self.ALBUM_TYPE_BLACKLIST = AlbumTypeListAttribute(
name="album_type_blacklist", name="album_type_blacklist",
@ -181,11 +146,6 @@ There are multiple fields, you can use for the path and file name:
""".strip()), """.strip()),
self.DOWNLOAD_PATH, self.DOWNLOAD_PATH,
self.DOWNLOAD_FILE, self.DOWNLOAD_FILE,
self.DEFAULT_ALBUM_TYPE,
self.DEFAULT_ARTIST,
self.DEFAULT_GENRE,
self.DEFAULT_LABEL,
self.DEFAULT_SONG,
self.ALBUM_TYPE_BLACKLIST, self.ALBUM_TYPE_BLACKLIST,
] ]
super().__init__() super().__init__()

View File

@ -67,15 +67,6 @@ AUDIO_FORMAT = AUDIO_SECTION.AUDIO_FORMAT.object_from_value
DOWNLOAD_PATH = AUDIO_SECTION.DOWNLOAD_PATH.object_from_value DOWNLOAD_PATH = AUDIO_SECTION.DOWNLOAD_PATH.object_from_value
DOWNLOAD_FILE = AUDIO_SECTION.DOWNLOAD_FILE.object_from_value DOWNLOAD_FILE = AUDIO_SECTION.DOWNLOAD_FILE.object_from_value
DEFAULT_VALUES = {
"genre": AUDIO_SECTION.DEFAULT_GENRE.object_from_value,
"label": AUDIO_SECTION.DEFAULT_LABEL.object_from_value,
"artist": AUDIO_SECTION.DEFAULT_ARTIST.object_from_value,
"album": AUDIO_SECTION.DEFAULT_ALBUM.object_from_value,
"song": AUDIO_SECTION.DEFAULT_SONG.object_from_value,
"album_type": AUDIO_SECTION.DEFAULT_ALBUM_TYPE.object_from_value,
"audio_format": AUDIO_FORMAT
}
TOR: bool = CONNECTION_SECTION.USE_TOR.object_from_value TOR: bool = CONNECTION_SECTION.USE_TOR.object_from_value
PROXIES_LIST: List[Dict[str, str]] = CONNECTION_SECTION.PROXIES.object_from_value PROXIES_LIST: List[Dict[str, str]] = CONNECTION_SECTION.PROXIES.object_from_value

View File

@ -1,4 +1,3 @@
from .default_target import DefaultTarget
from .download_result import DownloadResult from .download_result import DownloadResult
from .query import Query from .query import Query
from .thread_classes import EndThread, FinishedSearch from .thread_classes import EndThread, FinishedSearch

View File

@ -1,70 +0,0 @@
from dataclasses import dataclass
from ...utils.shared import DOWNLOAD_PATH, DOWNLOAD_FILE, DEFAULT_VALUES
from ...utils.string_processing import fit_to_file_system
from ...objects import (
Song,
Album,
Artist,
Target,
Label
)
@dataclass
class DefaultTarget:
genre: str = DEFAULT_VALUES["genre"]
label: str = DEFAULT_VALUES["label"]
artist: str = DEFAULT_VALUES["artist"]
album: str = DEFAULT_VALUES["album"]
album_type: str = DEFAULT_VALUES["album_type"]
song: str = DEFAULT_VALUES["song"]
audio_format: str = DEFAULT_VALUES["audio_format"]
def __setattr__(self, __name: str, __value: str) -> None:
if __name in DEFAULT_VALUES:
if type(__value) != str:
return
if self.__getattribute__(__name) == DEFAULT_VALUES[__name]:
super().__setattr__(__name, fit_to_file_system(__value))
return
super().__setattr__(__name, __value)
@property
def target(self) -> Target:
return Target(
relative_to_music_dir=True,
path=DOWNLOAD_PATH.format(genre=self.genre, label=self.label, artist=self.artist, album=self.album,
song=self.song, album_type=self.album_type, audio_format=self.audio_format),
file=DOWNLOAD_FILE.format(genre=self.genre, label=self.label, artist=self.artist, album=self.album,
song=self.song, album_type=self.album_type, audio_format=self.audio_format)
)
def song_object(self, song: Song):
self.song = song.title
self.genre = song.genre
if not song.album_collection.empty:
self.album_object(song.album_collection[0])
if not song.main_artist_collection.empty:
self.artist_object(song.main_artist_collection[0])
def album_object(self, album: Album):
self.album = album.title
self.album_type = album.album_type.value
if not album.artist_collection.empty:
self.artist_object(album.artist_collection[0])
if not album.label_collection.empty:
self.label_object(album.label_collection[0])
def artist_object(self, artist: Artist):
self.artist = artist.name
if not artist.label_collection.empty:
self.label_object(artist.label_collection[0])
def label_object(self, label: Label):
self.label = label.name