finished database integration and simmilar
This commit is contained in:
@@ -32,6 +32,7 @@ def div(msg: str = ""):
|
||||
cache = music_kraken.database.new_database.Database("test.db")
|
||||
cache.reset()
|
||||
|
||||
|
||||
def print_song(song_: Song):
|
||||
print(str(song_.metadata))
|
||||
print("----album--")
|
||||
@@ -65,14 +66,16 @@ song = Song(
|
||||
language=pycountry.languages.get(alpha_2="en"),
|
||||
label="cum productions",
|
||||
source_list=[
|
||||
Source(SourcePages.ENCYCLOPAEDIA_METALLUM, "https://www.metal-archives.com/albums/I%27m_in_a_Coffin/One_Final_Action/207614")
|
||||
Source(SourcePages.ENCYCLOPAEDIA_METALLUM,
|
||||
"https://www.metal-archives.com/albums/I%27m_in_a_Coffin/One_Final_Action/207614")
|
||||
]
|
||||
),
|
||||
main_artist_list=[
|
||||
Artist(
|
||||
name="I'm in a coffin",
|
||||
source_list=[
|
||||
Source(SourcePages.ENCYCLOPAEDIA_METALLUM, "https://www.metal-archives.com/bands/I%27m_in_a_Coffin/127727")
|
||||
Source(SourcePages.ENCYCLOPAEDIA_METALLUM,
|
||||
"https://www.metal-archives.com/bands/I%27m_in_a_Coffin/127727")
|
||||
]
|
||||
),
|
||||
Artist(name="some_split_artist")
|
||||
@@ -82,8 +85,6 @@ song = Song(
|
||||
|
||||
print_song(song)
|
||||
|
||||
|
||||
|
||||
div()
|
||||
song_ref = song.reference
|
||||
cache.push([song])
|
||||
@@ -97,44 +98,5 @@ print_song(song_from_db)
|
||||
# try writing metadata
|
||||
write_metadata(song)
|
||||
|
||||
exit()
|
||||
|
||||
# getting song by album ref
|
||||
div()
|
||||
song_output_list = cache.pull_songs(album_ref=album_input.reference)
|
||||
print(len(song_output_list), song_output_list)
|
||||
for song in song_output_list:
|
||||
print(song, song.album)
|
||||
|
||||
# getting album
|
||||
div("album")
|
||||
album_output_list = cache.pull_albums(album_ref=album_input.reference)
|
||||
album_output = album_output_list[0]
|
||||
print(album_output)
|
||||
print(f"--tracklist-{len(album_output)}--")
|
||||
for track in album_output.tracklist:
|
||||
print(track.tracksort, track)
|
||||
print("--artist--")
|
||||
for artist in album_output.artists:
|
||||
print(artist)
|
||||
|
||||
# getting album by song
|
||||
div()
|
||||
album_output_list = cache.pull_albums(song_ref=song_ref)
|
||||
print(album_output_list)
|
||||
print("len of album ->", len(album_output_list[0]), album_output_list[0], sep=" | ")
|
||||
|
||||
# get artist
|
||||
div("artist")
|
||||
artist_output = cache.pull_artists(artist_ref=artist_ref)[0]
|
||||
print(artist_output)
|
||||
|
||||
print("---static---")
|
||||
print("albums", artist_output.main_albums)
|
||||
print("main_s", artist_output.main_songs)
|
||||
print("feat_s", artist_output.feature_songs)
|
||||
|
||||
print("---dynamic---")
|
||||
print("discography", artist_output.discography)
|
||||
print("songs", artist_output.songs, artist_output.songs.tracklist)
|
||||
print("features", artist_output.features, artist_output.features.tracklist)
|
||||
div()
|
||||
Reference in New Issue
Block a user