mirror of
https://github.com/mihonapp/mihon.git
synced 2025-06-25 10:37:51 +02:00
Massively improve findFile performance (#728)
* Massively improve findFile performance * Update libs.versions.toml --------- Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
@ -300,8 +300,8 @@ actual class LocalSource(
|
||||
try {
|
||||
val (mangaDirName, chapterName) = chapter.url.split('/', limit = 2)
|
||||
return fileSystem.getBaseDirectory()
|
||||
?.findFile(mangaDirName, true)
|
||||
?.findFile(chapterName, true)
|
||||
?.findFile(mangaDirName)
|
||||
?.findFile(chapterName)
|
||||
?.let(Format.Companion::valueOf)
|
||||
?: throw Exception(context.stringResource(MR.strings.chapter_not_found))
|
||||
} catch (e: Format.UnknownFormatException) {
|
||||
|
@ -17,7 +17,7 @@ actual class LocalSourceFileSystem(
|
||||
|
||||
actual fun getMangaDirectory(name: String): UniFile? {
|
||||
return getBaseDirectory()
|
||||
?.findFile(name, true)
|
||||
?.findFile(name)
|
||||
?.takeIf { it.isDirectory }
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user