mirror of
https://github.com/rommapp/romm.git
synced 2026-12-06 15:54:45 +01:00
Read play sessions across devices without a token fallback
GET /api/play-sessions no longer narrows to the token's device when device_id is omitted, so the all_devices flag is dropped. Reading anything beyond the token's own device now requires devices.read, matching the saves and device endpoints. GET /api/sync/sessions takes the shared PageParams and gains offset paging. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
71a1962f69
commit
76012dafca
6 files changed
+79
-46
No files matched your search
@@ -221,6 +221,7 @@ class DBSyncSessionsHandler(DBBaseHandler):
|
||||
device_id: str | None = None,
|
||||
status: SyncSessionStatus | None = None,
|
||||
limit: int = 50,
|
||||
offset: int = 0,
|
||||
session: Session = INJECTED_SESSION,
|
||||
) -> Sequence[SyncSession]:
|
||||
query = select(SyncSession).filter_by(user_id=user_id)
|
||||
@@ -231,5 +232,9 @@ class DBSyncSessionsHandler(DBBaseHandler):
|
||||
if status:
|
||||
query = query.filter_by(status=status)
|
||||
|
||||
query = query.order_by(SyncSession.initiated_at.desc()).limit(limit)
|
||||
query = (
|
||||
query.order_by(SyncSession.initiated_at.desc(), SyncSession.id.desc())
|
||||
.limit(limit)
|
||||
.offset(offset)
|
||||
)
|
||||
return session.scalars(query).all()
|
||||
Reference in new issue
Block a user