Auto switch backend if there's no server
This commit is contained in:
1 parent
6c9c87ce50
commit
2dbd5840c0
4 files changed
+38
No files matched your search
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Backend changes from Invidious to Playlet if no instance url is set. This is to avoid playback errors.
|
||||||
|
|
||||||
## [0.48.7] - 2026-10-05
|
## [0.48.7] - 2026-10-05
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import "pkg:/components/ContentNode/ProfileContentAuthTokenUtils.bs"
|
import "pkg:/components/ContentNode/ProfileContentAuthTokenUtils.bs"
|
||||||
|
import "pkg:/components/Dialog/DialogUtils.bs"
|
||||||
import "pkg:/components/Services/Innertube/InnertubeService.bs"
|
import "pkg:/components/Services/Innertube/InnertubeService.bs"
|
||||||
import "pkg:/components/Services/Invidious/InvidiousService.bs"
|
import "pkg:/components/Services/Invidious/InvidiousService.bs"
|
||||||
import "pkg:/source/utils/CancellationUtils.bs"
|
import "pkg:/source/utils/CancellationUtils.bs"
|
||||||
@@ -30,6 +31,10 @@ function ExecuteJob() as void
|
|||||||
return
|
return
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
if preferencesNode["backend.selected"] = "invidious" and StringUtils.IsNullOrEmpty(preferencesNode["invidious.instance"])
|
||||||
|
SwitchBackendToPlaylet(preferencesNode)
|
||||||
|
end if
|
||||||
|
|
||||||
DeleteFile("cachefs:/last_generated_dash.xml")
|
DeleteFile("cachefs:/last_generated_dash.xml")
|
||||||
DeleteFile("cachefs:/last_generated_hls.m3u8")
|
DeleteFile("cachefs:/last_generated_hls.m3u8")
|
||||||
|
|
||||||
@@ -234,6 +239,23 @@ function SessionDataComplete(sessionData as object) as boolean
|
|||||||
return IsAssociativeArray(sessionData) and not StringUtils.IsNullOrEmpty(sessionData.visitorData) and not StringUtils.IsNullOrEmpty(sessionData.livingRoomPoTokenId)
|
return IsAssociativeArray(sessionData) and not StringUtils.IsNullOrEmpty(sessionData.visitorData) and not StringUtils.IsNullOrEmpty(sessionData.livingRoomPoTokenId)
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function SwitchBackendToPlaylet(preferencesNode as object) as void
|
||||||
|
preferencesNode["backend.selected"] = "playlet"
|
||||||
|
|
||||||
|
dialog = DialogUtils.ShowDialogEx({
|
||||||
|
title: Tr(Locale.Dialogs.BackendSwitchedToPlayletTitle)
|
||||||
|
message: Tr(Locale.Dialogs.BackendSwitchedToPlayletMessage)
|
||||||
|
})
|
||||||
|
if dialog = invalid
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
|
port = CreateObject("roMessagePort")
|
||||||
|
MessagePortUtils.ObserveFieldScopedExSafe(dialog, "wasClosed", port)
|
||||||
|
wait(0, port)
|
||||||
|
dialog.unobserveFieldScoped("wasClosed")
|
||||||
|
end function
|
||||||
|
|
||||||
function ResolveBackendId(backend as string, service as Invidious.InvidiousService) as string
|
function ResolveBackendId(backend as string, service as Invidious.InvidiousService) as string
|
||||||
if backend = "playlet"
|
if backend = "playlet"
|
||||||
return "playlet"
|
return "playlet"
|
||||||
|
|||||||
@@ -240,6 +240,14 @@
|
|||||||
<source>Please sign in again with this profile, or switch to another profile.</source>
|
<source>Please sign in again with this profile, or switch to another profile.</source>
|
||||||
<translation>Please sign in again with this profile, or switch to another profile.</translation>
|
<translation>Please sign in again with this profile, or switch to another profile.</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Backend changed</source>
|
||||||
|
<translation>Backend changed</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Backend changed to Playlet, because no Invidious instance is set.</source>
|
||||||
|
<translation>Backend changed to Playlet, because no Invidious instance is set.</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Lounge service setup error</source>
|
<source>Lounge service setup error</source>
|
||||||
<translation>Lounge service setup error</translation>
|
<translation>Lounge service setup error</translation>
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ namespace Locale
|
|||||||
ProfileNeedsReauthMessage = "The session has expired. Please sign in again with this profile, or switch to another profile."
|
ProfileNeedsReauthMessage = "The session has expired. Please sign in again with this profile, or switch to another profile."
|
||||||
ProfileNeedsReauthMessageLine1 = "The session has expired."
|
ProfileNeedsReauthMessageLine1 = "The session has expired."
|
||||||
ProfileNeedsReauthMessageLine2 = "Please sign in again with this profile, or switch to another profile."
|
ProfileNeedsReauthMessageLine2 = "Please sign in again with this profile, or switch to another profile."
|
||||||
|
BackendSwitchedToPlayletTitle = "Backend changed"
|
||||||
|
BackendSwitchedToPlayletMessage = "Backend changed to Playlet, because no Invidious instance is set."
|
||||||
LoungeServiceSetupError = "Lounge service setup error"
|
LoungeServiceSetupError = "Lounge service setup error"
|
||||||
LoungeFailedToGetScreenId = "Failed to get screen ID. Please restart Playlet to use the cast function."
|
LoungeFailedToGetScreenId = "Failed to get screen ID. Please restart Playlet to use the cast function."
|
||||||
LoungeNotAValidScreenId = "Not a valid screen id: %1"
|
LoungeNotAValidScreenId = "Not a valid screen id: %1"
|
||||||
|
|||||||
Reference in new issue
Block a user