feat(api): don't flag live session as viewed
feat(api): live session add projectId
This commit is contained in:
parent
257e19dd30
commit
be0efc443c
2 changed files with 3 additions and 3 deletions
|
|
@ -74,6 +74,7 @@ def get_live_sessions_ws(project_id):
|
|||
live_peers = connected_peers.json().get("data", [])
|
||||
for s in live_peers:
|
||||
s["live"] = True
|
||||
s["projectId"] = project_id
|
||||
return live_peers
|
||||
|
||||
|
||||
|
|
@ -81,7 +82,6 @@ def get_live_session_by_id(project_id, session_id):
|
|||
all_live = get_live_sessions_ws(project_id)
|
||||
for l in all_live:
|
||||
if l.get("sessionID") == session_id:
|
||||
l["live"] = True
|
||||
return l
|
||||
return None
|
||||
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ def get_session2(projectId: int, sessionId: int, context: schemas.CurrentContext
|
|||
include_fav_viewed=True, group_metadata=True)
|
||||
if data is None:
|
||||
return {"errors": ["session not found"]}
|
||||
|
||||
sessions_favorite_viewed.view_session(project_id=projectId, user_id=context.user_id, session_id=sessionId)
|
||||
if not data.get("live"):
|
||||
sessions_favorite_viewed.view_session(project_id=projectId, user_id=context.user_id, session_id=sessionId)
|
||||
return {
|
||||
'data': data
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue