mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-18 18:23:33 -05:00
Fix usage of deprecated functions (#1192)
* Fix usage of deprecated functions * lint * Lint * Another
This commit is contained in:
@@ -54,7 +54,7 @@ object Extension {
|
||||
private val applicationDirs: ApplicationDirs by injectLazy()
|
||||
|
||||
suspend fun installExtension(pkgName: String): Int {
|
||||
logger.debug("Installing $pkgName")
|
||||
logger.debug { "Installing $pkgName" }
|
||||
val extensionRecord = extensionTableAsDataClass().first { it.pkgName == pkgName }
|
||||
|
||||
return installAPK {
|
||||
@@ -144,7 +144,7 @@ object Extension {
|
||||
val className =
|
||||
packageInfo.packageName + packageInfo.applicationInfo.metaData.getString(METADATA_SOURCE_CLASS)
|
||||
|
||||
logger.debug("Main class for extension is $className")
|
||||
logger.debug { "Main class for extension is $className" }
|
||||
|
||||
dex2jar(apkFilePath, jarFilePath, fileNameWithoutType)
|
||||
extractAssetsFromApk(apkFilePath, jarFilePath)
|
||||
@@ -295,7 +295,7 @@ object Extension {
|
||||
}
|
||||
|
||||
fun uninstallExtension(pkgName: String) {
|
||||
logger.debug("Uninstalling $pkgName")
|
||||
logger.debug { "Uninstalling $pkgName" }
|
||||
|
||||
val extensionRecord = transaction { ExtensionTable.selectAll().where { ExtensionTable.pkgName eq pkgName }.first() }
|
||||
val fileNameWithoutType = extensionRecord[ExtensionTable.apkName].substringBefore(".apk")
|
||||
|
||||
@@ -55,12 +55,12 @@ object ExtensionsList {
|
||||
suspend fun fetchExtensionsCached() {
|
||||
// update if 60 seconds has passed or requested offline and database is empty
|
||||
if (lastUpdateCheck + 60.seconds.inWholeMilliseconds < System.currentTimeMillis()) {
|
||||
logger.debug("Getting extensions list from the internet")
|
||||
logger.debug { "Getting extensions list from the internet" }
|
||||
lastUpdateCheck = System.currentTimeMillis()
|
||||
|
||||
fetchExtensions()
|
||||
} else {
|
||||
logger.debug("used cached extension list")
|
||||
logger.debug { "used cached extension list" }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user