mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-27 13:54:01 +02:00
Fix crash downloading with old server, check server version to append token on image requests #1450
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user