mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
fix: /playlists returning wrong playlists
+ homepage recently played showing wrong user id items on first run
This commit is contained in:
+6
-2
@@ -345,8 +345,12 @@ class PlaylistTable(Base):
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def get_all(cls):
|
||||
result = cls.all()
|
||||
def get_all(cls, current_user: bool = True):
|
||||
if current_user:
|
||||
result = cls.execute(select(cls).where(cls.userid == get_current_userid()))
|
||||
else:
|
||||
result = cls.execute(select(cls))
|
||||
|
||||
return playlists_to_dataclasses(result)
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user