Rework the version endpoint
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
package ir.armor.tachidesk.impl
|
||||
import ir.armor.tachidesk.BuildConfig
|
||||
|
||||
fun getVersion(): String {
|
||||
return BuildConfig.VERSION
|
||||
}
|
||||
@@ -33,7 +33,7 @@ import ir.armor.tachidesk.impl.Source.getSourceList
|
||||
import ir.armor.tachidesk.impl.backup.BackupFlags
|
||||
import ir.armor.tachidesk.impl.backup.legacy.LegacyBackupExport.createLegacyBackup
|
||||
import ir.armor.tachidesk.impl.backup.legacy.LegacyBackupImport.restoreLegacyBackup
|
||||
import ir.armor.tachidesk.impl.getVersion
|
||||
import ir.armor.tachidesk.server.internal.About.getAbout
|
||||
import ir.armor.tachidesk.server.util.openInBrowser
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -298,9 +298,9 @@ object JavalinSetup {
|
||||
ctx.status(200)
|
||||
}
|
||||
|
||||
// returns version of the app
|
||||
app.get("/api/v1/version/") { ctx ->
|
||||
ctx.json(getVersion())
|
||||
// returns some static info of the current app build
|
||||
app.get("/api/v1/about/") { ctx ->
|
||||
ctx.json(getAbout())
|
||||
}
|
||||
|
||||
// category modification
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package ir.armor.tachidesk.server.internal
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import ir.armor.tachidesk.server.BuildConfig
|
||||
|
||||
data class AboutDataClass(
|
||||
val version: String,
|
||||
val revision: String,
|
||||
)
|
||||
|
||||
object About {
|
||||
fun getAbout(): AboutDataClass {
|
||||
return AboutDataClass(
|
||||
BuildConfig.version,
|
||||
BuildConfig.revision,
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user