draft stats

This commit is contained in:
cwilvx
2024-10-05 08:32:26 +03:00
parent cb2e98a832
commit 4be2b80bf9
7 changed files with 412 additions and 3 deletions
+9
View File
@@ -281,6 +281,15 @@ class ScrobbleTable(Base):
return tracklog_to_dataclasses(result.fetchall())
@classmethod
def get_all_in_period(cls, start_time: int, end_time: int):
result = cls.execute(
select(cls)
.where(and_(cls.timestamp >= start_time, cls.timestamp <= end_time))
.order_by(cls.timestamp.desc())
)
return tracklog_to_dataclasses(result.fetchall())
class PlaylistTable(Base):
__tablename__ = "playlist"