mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-14 19:34:57 +02:00
Update:Show version number in bottom of siderail #660 and save previous version data to continue showing if update is available
This commit is contained in:
parent
c88bbf1ce4
commit
4621c78573
4 changed files with 83 additions and 30 deletions
|
@ -23,14 +23,17 @@ function parseSemver(ver) {
|
|||
}
|
||||
return null
|
||||
}
|
||||
|
||||
export const currentVersion = packagejson.version
|
||||
|
||||
export async function checkForUpdate() {
|
||||
if (!packagejson.version) {
|
||||
return
|
||||
return null
|
||||
}
|
||||
var currVerObj = parseSemver('v' + packagejson.version)
|
||||
if (!currVerObj) {
|
||||
console.error('Invalid version', packagejson.version)
|
||||
return
|
||||
return null
|
||||
}
|
||||
var largestVer = null
|
||||
await axios.get(`https://api.github.com/repos/advplyr/audiobookshelf/releases`).then((res) => {
|
||||
|
@ -49,7 +52,7 @@ export async function checkForUpdate() {
|
|||
})
|
||||
if (!largestVer) {
|
||||
console.error('No valid version tags to compare with')
|
||||
return
|
||||
return null
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue