Check web client setting before autoplay

This commit is contained in:
cewert 2020-12-11 02:38:19 -05:00
parent f2a42c60e1
commit 47155a6b38
2 changed files with 27 additions and 22 deletions

View File

@ -404,7 +404,7 @@ sub Main()
RemoveCurrentGroup()
else
MarkItemWatched(video.id)
playNextEpisode(video.id, video.showID)
autoPlayNextEpisode(video.id, video.showID)
end if
end if
else if isNodeEvent(msg, "fire")
@ -416,7 +416,7 @@ sub Main()
if node.showID = invalid then
RemoveCurrentGroup()
else
playNextEpisode(node.id, node.showID)
autoPlayNextEpisode(node.id, node.showID)
end if
else if node.state = "playing" or node.state = "paused" then
ReportPlayback(group, "update")

View File

@ -337,7 +337,9 @@ function displaySubtitlesByUserConfig(subtitleTrack, audioTrack)
end if
end function
function playNextEpisode(videoID as string, showID as string)
function autoPlayNextEpisode(videoID as string, showID as string)
' use web client setting
if m.user.Configuration.EnableNextEpisodeAutoPlay then
' query API for next episode ID
url = Substitute("Shows/{0}/Episodes", showID)
urlParams = { "UserId": get_setting("active_user")}
@ -360,4 +362,7 @@ function playNextEpisode(videoID as string, showID as string)
' can't play next episode
RemoveCurrentGroup()
end if
else
RemoveCurrentGroup()
end if
end function