doesn't throw exceptions
This commit is contained in:
@@ -1,25 +1,6 @@
|
||||
from music_kraken import objects
|
||||
|
||||
import pycountry
|
||||
import logging
|
||||
|
||||
logging.disable()
|
||||
|
||||
|
||||
def div(msg: str = ""):
|
||||
print("-" * 50 + msg + "-" * 50)
|
||||
|
||||
|
||||
def print_song(song_: objects.Song):
|
||||
print(str(song_.metadata))
|
||||
print("----album--")
|
||||
print(song_.album)
|
||||
print("----src----")
|
||||
print("song:")
|
||||
print(song_.source_list)
|
||||
print("album:")
|
||||
print(song_.album.source_list)
|
||||
print("\n")
|
||||
|
||||
|
||||
song = objects.Song(
|
||||
@@ -41,13 +22,15 @@ song = objects.Song(
|
||||
],
|
||||
album_list=[
|
||||
objects.Album(
|
||||
title="One Final Action",
|
||||
date=objects.ID3Timestamp(year=1986, month=3, day=1),
|
||||
language=pycountry.languages.get(alpha_2="en"),
|
||||
label="cum productions",
|
||||
source_list=[
|
||||
objects.Source(objects.SourcePages.ENCYCLOPAEDIA_METALLUM, "https://www.metal-archives.com/albums/I%27m_in_a_Coffin/One_Final_Action/207614")
|
||||
]
|
||||
title="One Final Action",
|
||||
date=objects.ID3Timestamp(year=1986, month=3, day=1),
|
||||
language=pycountry.languages.get(alpha_2="en"),
|
||||
label_list=[
|
||||
objects.Label(name="an album label")
|
||||
],
|
||||
source_list=[
|
||||
objects.Source(objects.SourcePages.ENCYCLOPAEDIA_METALLUM, "https://www.metal-archives.com/albums/I%27m_in_a_Coffin/One_Final_Action/207614")
|
||||
]
|
||||
),
|
||||
],
|
||||
main_artist_list=[
|
||||
@@ -62,25 +45,18 @@ song = objects.Song(
|
||||
),
|
||||
objects.Artist(name="some_split_artist")
|
||||
],
|
||||
feature_artist_list=[objects.Artist(name="Ruffiction")],
|
||||
feature_artist_list=[
|
||||
objects.Artist(
|
||||
name="Ruffiction",
|
||||
label_list=[
|
||||
objects.Label(name="Ruffiction Productions")
|
||||
]
|
||||
)
|
||||
],
|
||||
)
|
||||
|
||||
print(song)
|
||||
|
||||
exit()
|
||||
|
||||
div()
|
||||
song_ref = song.reference
|
||||
|
||||
|
||||
# getting song by song ref
|
||||
song_list = cache.pull_songs(song_ref=song_ref)
|
||||
song_from_db = song_list[0]
|
||||
|
||||
print_song(song_from_db)
|
||||
|
||||
# try writing metadata
|
||||
write_metadata(song)
|
||||
|
||||
# getting song by album ref
|
||||
div()
|
||||
print(song.option_string)
|
||||
for album in song.album_collection:
|
||||
print(album.option_string)
|
||||
for artist in song.main_artist_collection:
|
||||
print(artist.option_string)
|
||||
|
||||
Reference in New Issue
Block a user