Update database.py

This commit is contained in:
Hellow 2023-02-19 23:36:04 +01:00
parent 87dcfdb54b
commit 33b1efc2ed

View File

@ -111,7 +111,7 @@ class Database:
Returns:
The newly added music object.
"""
with write.WritingSession(self.database) as writing_session:
if isinstance(database_object, objects.Song):
return writing_session.add_song(database_object)
@ -122,7 +122,6 @@ class Database:
if isinstance(database_object, objects.Artist):
return writing_session.add_artist(database_object)
def push_many(self, database_objects: List[objects.MusicObject]) -> None:
"""
Adds a list of MusicObject instances to the database.