move recently added to routines

This commit is contained in:
cwilvx
2024-11-17 20:08:04 +03:00
parent 498d0688b0
commit 333fd6603f
14 changed files with 554 additions and 213 deletions
+2 -2
View File
@@ -293,10 +293,10 @@ class ScrobbleTable(Base):
return cls.insert_one(item)
@classmethod
def get_all(cls, start: int, limit: int | None = None):
def get_all(cls, start: int, limit: int | None = None, userid: int | None = None):
result = cls.execute(
select(cls)
.where(cls.userid == get_current_userid())
.where(cls.userid == (userid if userid else get_current_userid()))
.order_by(cls.timestamp.desc())
.offset(start)
.limit(limit)