ready for test build

This commit is contained in:
Hellow 2022-11-24 18:25:49 +01:00
parent e8bb139573
commit 5f433ae3e1
5 changed files with 37 additions and 13 deletions

View File

@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "music_kraken" name = "music_kraken"
version = "1.2.1" version = "1.2.2"
authors = [ authors = [
{ name="Hellow2", email="Hellow2@outlook.de" }, { name="Hellow2", email="Hellow2@outlook.de" },
] ]

View File

@ -21,31 +21,35 @@ logging.getLogger("musicbrainzngs").setLevel(logging.WARNING)
musicbrainzngs.set_useragent("metadata receiver", "0.1", "https://github.com/HeIIow2/music-downloader") musicbrainzngs.set_useragent("metadata receiver", "0.1", "https://github.com/HeIIow2/music-downloader")
# define the most important values and function for import in the __init__ file # define the most important values and function for import in the __init__ file
Song = database.song.Song Song = database.Song
MetadataSearch = metadata.metadata_search.Search MetadataSearch = metadata.MetadataSearch
MetadataDownload = metadata.metadata_fetch.MetadataDownloader() MetadataDownload = metadata.MetadataDownload
cache = database.cache cache = database.cache
def fetch_metadata(type: str, id_: str):
metadata_downloader = MetadataDownload()
metadata_downloader.download({'type': type, 'id': id_})
def fetch_metadata_from_search(search_instace: MetadataSearch): def fetch_metadata(type_: str, id_: str):
current_option = search_instace.current_option metadata_downloader = MetadataDownload()
fetch_metadata(type=current_option.type, id_= current_option.id) metadata_downloader.download({'type': type_, 'id': id_})
def fetch_metadata_from_search(search_instance: MetadataSearch):
current_option = search_instance.current_option
fetch_metadata(type_=current_option.type, id_=current_option.id)
def set_targets(genre: str): def set_targets(genre: str):
target.set_target.UrlPath(genre=genre) target.set_target.UrlPath(genre=genre)
def fetch_sources(songs: List[Song], skip_existing_files: bool = True): def fetch_sources(songs: List[Song], skip_existing_files: bool = True):
audio_source.fetch_sources(songs=songs, skip_existing_files=skip_existing_files) audio_source.fetch_sources(songs=songs, skip_existing_files=skip_existing_files)
def fetch_audios(songs: List[Song], override_existing: bool = False): def fetch_audios(songs: List[Song], override_existing: bool = False):
audio_source.fetch_audios(songs=songs, override_existing=override_existing) audio_source.fetch_audios(songs=songs, override_existing=override_existing)
def get_existing_genre(): def get_existing_genre():
valid_directories = [] valid_directories = []
for elem in os.listdir(MUSIC_DIR): for elem in os.listdir(MUSIC_DIR):
@ -144,7 +148,6 @@ def cli(start_at: int = 0, only_lyrics: bool = False):
logging.info("Starting Downloading of metadata") logging.info("Starting Downloading of metadata")
fetch_metadata_from_search(search) fetch_metadata_from_search(search)
if start_at <= 1 and not only_lyrics: if start_at <= 1 and not only_lyrics:
logging.info("creating Paths") logging.info("creating Paths")
set_targets(genre=genre) set_targets(genre=genre)

View File

@ -1,3 +1,12 @@
from . import temp_database from . import (
temp_database,
song
)
Song = song.Song
Artist = song.Artist
Source = song.Source
Target = song.Target
Metadata = song.Metadata
cache = temp_database.TempDatabase() cache = temp_database.TempDatabase()

View File

@ -0,0 +1,7 @@
from . import (
metadata_search,
metadata_fetch
)
MetadataSearch = metadata_search.Search
MetadataDownload = metadata_fetch.MetadataDownloader

View File

@ -0,0 +1,5 @@
from . import (
set_target
)
set_target = set_target