refactored and cleaned up data objects

This commit is contained in:
Hellow
2023-02-23 23:52:41 +01:00
parent 04c5266f43
commit 819111c53a
5 changed files with 204 additions and 108 deletions

View File

@@ -196,7 +196,7 @@ class Database:
for song in album.tracklist:
self.push_song(song, pushed=pushed)
for artist in album.artists:
for artist in album.artist_collection:
self.push_artist_album(artist_ref=artist.reference, album_ref=album.reference)
self.push_artist(artist, pushed=pushed)
@@ -657,7 +657,7 @@ class Database:
artists = self.pull_artists(artist_ref, flat=flat_artist, exclude_relations=new_exclude_relations)
if len(artists) < 1:
continue
album_obj.artists.append(artists[0])
album_obj.artist_collection.append(artists[0])
return album_obj

View File

@@ -215,7 +215,7 @@ class WritingSession:
self.db_objects[data_models.AlbumSong].append(db_song_album)
for artist in album.artists:
for artist in album.artist_collection:
db_album_artist = data_models.AlbumArtist(
album = album,
artist = self.add_artist(artist)