mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-12 12:08:56 +01:00
Ignore casing when looking for some files/folders
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user