Skip to content

Commit

Permalink
use global session to avoid unneeded API call
Browse files Browse the repository at this point in the history
  • Loading branch information
cewert committed Jul 28, 2024
1 parent c030228 commit eda817d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions components/ItemGrid/LoadVideoContentTask.bs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ enum SubtitleSelection
end enum

sub init()
m.user = AboutMe()
m.top.functionName = "loadItems"
end sub

Expand Down Expand Up @@ -565,16 +564,16 @@ function sortSubtitles(id as string, MediaStreams)
end function

function FindPreferredAudioStream(streams as dynamic) as integer
preferredLanguage = m.user.Configuration.AudioLanguagePreference
playDefault = m.user.Configuration.PlayDefaultAudioTrack
preferredLanguage = m.global.session.user.Configuration.AudioLanguagePreference
playDefault = m.global.session.user.Configuration.PlayDefaultAudioTrack

if playDefault <> invalid and playDefault = true
return 1
end if

' Do we already have the MediaStreams or not?
if streams = invalid
url = Substitute("Users/{0}/Items/{1}", m.user.id, m.top.itemId)
url = Substitute("Users/{0}/Items/{1}", m.global.session.user.id, m.top.itemId)
resp = APIRequest(url)
jsonResponse = getJson(resp)

Expand Down

0 comments on commit eda817d

Please sign in to comment.