Browse Source

Ignore casing when looking for some files/folders

arkon 1 year ago
parent
commit
e41668862f

+ 0 - 1
app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsDataScreen.kt

@@ -27,7 +27,6 @@ import androidx.compose.runtime.rememberCoroutineScope
 import androidx.compose.runtime.setValue
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.platform.LocalContext
-import androidx.compose.ui.res.stringResource
 import androidx.core.net.toUri
 import cafe.adriel.voyager.navigator.LocalNavigator
 import cafe.adriel.voyager.navigator.currentOrThrow

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadProvider.kt

@@ -91,7 +91,7 @@ class DownloadProvider(
         val mangaDir = findMangaDir(manga.title, source) ?: return null to emptyList()
         return mangaDir to chapters.mapNotNull { chapter ->
             getValidChapterDirNames(chapter.name, chapter.scanlator).asSequence()
-                .mapNotNull { mangaDir.findFile(it) }
+                .mapNotNull { mangaDir.findFile(it, true) }
                 .firstOrNull()
         }
     }

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt

@@ -642,7 +642,7 @@ class Downloader(
         val categories = getCategories.await(manga.id).map { it.name.trim() }.takeUnless { it.isEmpty() }
         val comicInfo = getComicInfo(manga, chapter, chapterUrl, categories)
         // Remove the old file
-        dir.findFile(COMIC_INFO_FILE)?.delete()
+        dir.findFile(COMIC_INFO_FILE, true)?.delete()
         dir.createFile(COMIC_INFO_FILE)!!.openOutputStream().use {
             val comicInfoString = xml.encodeToString(ComicInfo.serializer(), comicInfo)
             it.write(comicInfoString.toByteArray())

+ 2 - 2
source-local/src/androidMain/kotlin/tachiyomi/source/local/LocalSource.kt

@@ -303,8 +303,8 @@ actual class LocalSource(
         try {
             val (mangaDirName, chapterName) = chapter.url.split('/', limit = 2)
             return fileSystem.getBaseDirectory()
-                ?.findFile(mangaDirName)
-                ?.findFile(chapterName)
+                ?.findFile(mangaDirName, true)
+                ?.findFile(chapterName, true)
                 ?.let(Format.Companion::valueOf)
                 ?: throw Exception(context.stringResource(MR.strings.chapter_not_found))
         } catch (e: Format.UnknownFormatException) {