Skip to content

Commit

Permalink
Update API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jellyfin-bot committed Dec 26, 2024
1 parent dd8e918 commit 253aa79
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/api/source_ShowScenes.bs.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
user.name = savedUser.username
end if

if isValid(savedUser.primaryImageTag)
user.ImageURL = UserImageURL(user.id, { "tag": savedUser.primaryImageTag })
end if

publicUsersNodes.push(user)
end if
end if
Expand All @@ -105,6 +109,7 @@
end for
' try to login with token from registry
myToken = get_user_setting("token")
myPrimaryImageTag = get_user_setting("primaryimagetag")
if myToken <> invalid
' check if token is valid
print "Auth token found in registry for selected user"
Expand All @@ -115,6 +120,9 @@
print "Auth token is no longer valid - deleting token"
unset_user_setting("token")
unset_user_setting("username")
if isValid(myPrimaryImageTag)
unset_user_setting("primaryimagetag")
end if
else
print "Success! Auth token is still valid"
session.user.Login(currentUser, true)
Expand Down Expand Up @@ -157,10 +165,14 @@

myUsername = get_user_setting("username")
myAuthToken = get_user_setting("token")
myPrimaryImageTag = get_user_setting("primaryimagetag")
if isValid(myAuthToken) and isValid(myUsername)
print "Auth token found in registry"
session.user.Update("authToken", myAuthToken)
session.user.Update("name", myUsername)
if isValid(myPrimaryImageTag)
session.user.Update("primaryImageTag", myPrimaryImageTag)
end if

print "Attempting to use API with auth token"
currentUser = AboutMe()
Expand All @@ -179,6 +191,9 @@
print "delete token and restart login flow"
unset_user_setting("token")
unset_user_setting("username")
if isValid(myPrimaryImageTag)
unset_user_setting("primaryimagetag")
end if
goto start_login
end if
else
Expand Down Expand Up @@ -486,6 +501,9 @@
session.user.Login(activeUser, true)
set_user_setting("token", activeUser.token)
set_user_setting("username", username.value)
if isValid(activeUser.json.PrimaryImageTag)
set_user_setting("primaryimagetag", activeUser.json.PrimaryImageTag)
end if
else
session.user.Login(activeUser)
end if
Expand Down
6 changes: 6 additions & 0 deletions docs/api/source_utils_config.bs.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@
userArray["serverId"] = serverId
end if

primaryImageTag = registry_read("primaryimagetag", userId)
if primaryImageTag <> invalid
print "Found Saved Primary Image Tag: ", primaryImageTag, " for user: ", userId
userArray["primaryImageTag"] = primaryImageTag
end if

if username <> invalid and token <> invalid and serverId <> invalid and serverId = m.global.session.server.id
savedServerUsers.push(userArray)
end if
Expand Down

0 comments on commit 253aa79

Please sign in to comment.