Actually use configured storage location for local source

Fixes #10178
This commit is contained in:
arkon
2023-11-25 22:31:26 -05:00
parent ca54984344
commit 27c4db752c
9 changed files with 76 additions and 46 deletions

View File

@ -310,8 +310,10 @@ actual class LocalSource(
fun getFormat(chapter: SChapter): Format {
try {
val (mangaDirName, chapterName) = chapter.url.split(File.separator, limit = 2)
return fileSystem.getBaseDirectory()
?.findFile(chapter.url)
?.findFile(mangaDirName)
?.findFile(chapterName)
?.let(Format.Companion::valueOf)
?: throw Exception(context.stringResource(MR.strings.chapter_not_found))
} catch (e: Format.UnknownFormatException) {