Fix crash downloading with old server, check server version to append token on image requests #1450

This commit is contained in:
advplyr
2025-01-26 14:22:35 -06:00
parent 08651d28ef
commit c79ecbb92e
4 changed files with 34 additions and 7 deletions
+14
View File
@@ -85,6 +85,20 @@ export const getters = {
getCanStreamingUsingCellular: (state) => {
if (!state.deviceData?.deviceSettings?.streamingUsingCellular) return 'ALWAYS'
return state.deviceData.deviceSettings.streamingUsingCellular || 'ALWAYS'
},
/**
* Old server versions require a token for images
*
* @param {*} state
* @returns {boolean} True if server version is less than 2.17
*/
getDoesServerImagesRequireToken: (state) => {
const serverVersion = state.serverSettings?.version
if (!serverVersion) return false
const versionParts = serverVersion.split('.')
const majorVersion = parseInt(versionParts[0])
const minorVersion = parseInt(versionParts[1])
return majorVersion < 2 || (majorVersion == 2 && minorVersion < 17)
}
}