mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-11 23:04:33 -05:00
Lint (#423)
This commit is contained in:
@@ -67,7 +67,9 @@ object BytecodeEditor {
|
||||
}
|
||||
|
||||
path to bytes
|
||||
} else null
|
||||
} else {
|
||||
null
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
logger.error(e) { "Error loading class from Path: $path" }
|
||||
null
|
||||
@@ -172,7 +174,11 @@ object BytecodeEditor {
|
||||
): MethodVisitor {
|
||||
logger.trace { "Processing method $name: ${desc.replaceIndirectly()}: $signature" }
|
||||
val mv: MethodVisitor? = super.visitMethod(
|
||||
access, name, desc.replaceIndirectly(), signature, exceptions
|
||||
access,
|
||||
name,
|
||||
desc.replaceIndirectly(),
|
||||
signature,
|
||||
exceptions
|
||||
)
|
||||
return object : MethodVisitor(Opcodes.ASM5, mv) {
|
||||
override fun visitLdcInsn(cst: Any?) {
|
||||
|
||||
@@ -60,7 +60,9 @@ fun updateMangaDownloadDir(mangaId: Int, newTitle: String): Boolean {
|
||||
val oldDirFile = File(oldDir)
|
||||
val newDirFile = File(newDir)
|
||||
|
||||
return if (oldDirFile.exists())
|
||||
return if (oldDirFile.exists()) {
|
||||
oldDirFile.renameTo(newDirFile)
|
||||
else true
|
||||
} else {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,11 +37,13 @@ private suspend fun <T> Observable<T>.awaitOne(): T = suspendCancellableCoroutin
|
||||
}
|
||||
|
||||
override fun onCompleted() {
|
||||
if (cont.isActive) cont.resumeWithException(
|
||||
IllegalStateException(
|
||||
"Should have invoked onNext"
|
||||
if (cont.isActive) {
|
||||
cont.resumeWithException(
|
||||
IllegalStateException(
|
||||
"Should have invoked onNext"
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
|
||||
@@ -21,8 +21,9 @@ object ImageResponse {
|
||||
fun findFileNameStartingWith(directoryPath: String, fileName: String): String? {
|
||||
val target = "$fileName."
|
||||
File(directoryPath).listFiles().orEmpty().forEach { file ->
|
||||
if (file.name.startsWith(target))
|
||||
if (file.name.startsWith(target)) {
|
||||
return "$directoryPath/${file.name}"
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user