mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-14 16:24:34 -05:00
Fix usage of deprecated functions (#1192)
* Fix usage of deprecated functions * lint * Lint * Another
This commit is contained in:
@@ -66,7 +66,8 @@ object Page {
|
||||
.selectAll()
|
||||
.where { (PageTable.chapter eq chapterId) }
|
||||
.orderBy(PageTable.index to SortOrder.ASC)
|
||||
.limit(1, index.toLong())
|
||||
.limit(1)
|
||||
.offset(index.toLong())
|
||||
.first()
|
||||
}
|
||||
val tachiyomiPage =
|
||||
|
||||
@@ -146,7 +146,7 @@ class Downloader(
|
||||
}
|
||||
finishDownload(downloadLogger, download)
|
||||
} catch (e: CancellationException) {
|
||||
logger.debug("Downloader was stopped")
|
||||
logger.debug { "Downloader was stopped" }
|
||||
availableSourceDownloads.filter { it.state == Downloading }.forEach { it.state = Queued }
|
||||
notifier(false, DownloadUpdate(STOPPED, download))
|
||||
} catch (e: PauseDownloadException) {
|
||||
@@ -154,7 +154,7 @@ class Downloader(
|
||||
download.state = Queued
|
||||
notifier(false, DownloadUpdate(PAUSED, download))
|
||||
} catch (e: Exception) {
|
||||
downloadLogger.warn("failed due to", e)
|
||||
downloadLogger.warn(e) { "failed due to" }
|
||||
download.tries++
|
||||
download.state = Error
|
||||
notifier(false, DownloadUpdate(ERROR, download))
|
||||
|
||||
@@ -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" }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ object PackageTools {
|
||||
.to(jarFilePath)
|
||||
if (handler.hasException()) {
|
||||
val errorFile: Path = File(applicationDirs.extensionsRoot).toPath().resolve("$fileNameWithoutType-error.txt")
|
||||
logger.error(
|
||||
logger.error {
|
||||
"""
|
||||
Detail Error Information in File $errorFile
|
||||
Please report this file to one of following link if possible (any one).
|
||||
@@ -77,8 +77,8 @@ object PackageTools {
|
||||
https://bitbucket.org/pxb1988/dex2jar/issues
|
||||
https://github.com/pxb1988/dex2jar/issues
|
||||
dex2jar@googlegroups.com
|
||||
""".trimIndent(),
|
||||
)
|
||||
""".trimIndent()
|
||||
}
|
||||
handler.dump(errorFile, emptyArray<String>())
|
||||
} else {
|
||||
BytecodeEditor.fixAndroidClasses(jarFilePath)
|
||||
@@ -97,7 +97,7 @@ object PackageTools {
|
||||
dBuilder.parse(it)
|
||||
}
|
||||
|
||||
logger.trace(parsed.manifestXml)
|
||||
logger.trace { parsed.manifestXml }
|
||||
|
||||
applicationInfo.metaData =
|
||||
Bundle().apply {
|
||||
|
||||
Reference in New Issue
Block a user