music-kraken-core/development/objects_collection.py

31 lines
889 B
Python
Raw Normal View History

2024-04-12 12:14:10 +00:00
import music_kraken
from music_kraken.objects import Song, Album, Artist, Collection
if __name__ == "__main__":
2024-04-19 15:45:49 +00:00
album_1 = Album(
title="album",
song_list=[
Song(title="song", main_artist_list=[Artist(name="artist")]),
],
artist_list=[
Artist(name="artist 3"),
2024-04-12 12:14:10 +00:00
]
)
2024-04-19 15:45:49 +00:00
album_2 = Album(
title="album",
song_list=[
Song(title="song", main_artist_list=[Artist(name="artist 2")]),
],
artist_list=[
Artist(name="artist"),
]
)
2024-04-19 15:45:49 +00:00
album_1.merge(album_2)
2024-04-12 15:23:44 +00:00
print()
print(*(f"{a.title_string} ; {a.id}" for a in album_1.artist_collection.data), sep=" | ")
2024-04-12 15:23:44 +00:00
2024-04-19 15:45:49 +00:00
print(id(album_1.artist_collection), id(album_2.artist_collection))
print(id(album_1.song_collection[0].main_artist_collection), id(album_2.song_collection[0].main_artist_collection))