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 7, 2023
1 parent 0670ae3 commit f0890c0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions docs/api/components_WhatsNewDialog.bs.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

m.top.id = "OKDialog"
m.top.height = 900
m.top.title = "What's New?"
m.top.title = m.global.app.version + " - " + tr("What's New?")
m.top.buttons = [tr("OK")]

dialogStyles = {
Expand All @@ -23,7 +23,7 @@
}
}

whatsNewList = ParseJSON(ReadAsciiFile("pkg:/source/static/whatsNew.json"))
whatsNewList = ParseJSON(ReadAsciiFile("pkg:/source/static/whatsNew/" + m.global.app.version.ToStr().trim() + ".json"))

for each item in whatsNewList
textLine = m.content.CreateChild("StdDlgMultiStyleTextItem")
Expand Down
19 changes: 11 additions & 8 deletions docs/api/source_Main.bs.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
m.wasMigrated = false
runGlobalMigrations()
runRegistryUserMigrations()
' update LastRunVersion now that migrations are finished
showWhatsNew = false
' update global LastRunVersion now that migrations are finished
if m.global.app.version <> m.global.app.lastRunVersion
showWhatsNew = true
set_setting("LastRunVersion", m.global.app.version)
end if
if m.wasMigrated then printRegistry()
Expand Down Expand Up @@ -76,11 +74,16 @@
end if
end if

' Show the Whats New popup
if showWhatsNew and m.global.session.user.settings["load.allowwhatsnew"]
dialog = createObject("roSGNode", "WhatsNewDialog")
m.scene.dialog = dialog
m.scene.dialog.observeField("buttonSelected", m.port)
' has the current user ran this version before?
usersLastRunVersion = m.global.session.user.settings.lastRunVersion
if not isValid(usersLastRunVersion) or not versionChecker(m.global.session.user.settings.lastRunVersion, m.global.app.version)
set_user_setting("LastRunVersion", m.global.app.version)
' show what's new popup
if m.global.session.user.settings["load.allowwhatsnew"]
dialog = createObject("roSGNode", "WhatsNewDialog")
m.scene.dialog = dialog
m.scene.dialog.observeField("buttonSelected", m.port)
end if
end if

' Handle input messages
Expand Down
2 changes: 1 addition & 1 deletion docs/api/source_migrations.bs.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
' app versions < 2.0.0 didn't save LastRunVersion at the user level
' fall back to using the apps lastRunVersion
lastRunVersion = m.global.app.lastRunVersion
registry_write("LastRunVersion", m.global.app.version, section)
registry_write("LastRunVersion", lastRunVersion, section)
end if

' BASE_MIGRATION
Expand Down

0 comments on commit f0890c0

Please sign in to comment.