mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
remove prints
This commit is contained in:
@@ -135,12 +135,11 @@ class RestoreBackup:
|
|||||||
for playlist in new_playlists:
|
for playlist in new_playlists:
|
||||||
try:
|
try:
|
||||||
if playlist.get("_score") is not None:
|
if playlist.get("_score") is not None:
|
||||||
print("Removing _score from playlist")
|
|
||||||
del playlist["_score"]
|
del playlist["_score"]
|
||||||
|
|
||||||
PlaylistTable.add_one(playlist)
|
PlaylistTable.add_one(playlist)
|
||||||
except sqlalchemy.exc.IntegrityError:
|
except sqlalchemy.exc.IntegrityError:
|
||||||
print("Integrity error, skipping playlist")
|
print("Integrity error, skipping playlist:")
|
||||||
print(playlist)
|
print(playlist)
|
||||||
|
|
||||||
def restore_scrobbles(self, scrobbles: list[dict]):
|
def restore_scrobbles(self, scrobbles: list[dict]):
|
||||||
@@ -159,7 +158,7 @@ class RestoreBackup:
|
|||||||
try:
|
try:
|
||||||
ScrobbleTable.add(scrobble)
|
ScrobbleTable.add(scrobble)
|
||||||
except sqlalchemy.exc.IntegrityError:
|
except sqlalchemy.exc.IntegrityError:
|
||||||
print("Integrity error, skipping scrobble")
|
print("Integrity error, skipping scrobble:")
|
||||||
print(scrobble)
|
print(scrobble)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -220,11 +220,9 @@ class FavoritesTable(Base):
|
|||||||
item["hash"] = f"{item['type']}_{item['hash']}"
|
item["hash"] = f"{item['type']}_{item['hash']}"
|
||||||
|
|
||||||
if item.get("timestamp") is None:
|
if item.get("timestamp") is None:
|
||||||
print("No timestamp found, using current timestamp")
|
|
||||||
item["timestamp"] = int(datetime.datetime.now().timestamp())
|
item["timestamp"] = int(datetime.datetime.now().timestamp())
|
||||||
|
|
||||||
if item.get("userid") is None:
|
if item.get("userid") is None:
|
||||||
print("No userid found, using current userid")
|
|
||||||
item["userid"] = get_current_userid()
|
item["userid"] = get_current_userid()
|
||||||
|
|
||||||
return next(cls.execute(insert(cls).values(item), commit=True))
|
return next(cls.execute(insert(cls).values(item), commit=True))
|
||||||
@@ -343,7 +341,6 @@ class ScrobbleTable(Base):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def add(cls, item: dict[str, Any]):
|
def add(cls, item: dict[str, Any]):
|
||||||
if item.get("userid") is None:
|
if item.get("userid") is None:
|
||||||
print("No userid found, using current userid")
|
|
||||||
item["userid"] = get_current_userid()
|
item["userid"] = get_current_userid()
|
||||||
|
|
||||||
return cls.insert_one(item)
|
return cls.insert_one(item)
|
||||||
|
|||||||
Reference in New Issue
Block a user