From d98e0c5f6814c123b1d96dc4709f958d19f8bacc Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 26 Mar 2022 15:34:53 -0400 Subject: [PATCH] Stop removing local manga's title from chapter names (closes #6578) Users should better curate their chapter folder/file names if need be. There's legit reasons for a chapter to start with or contain the same word(s) that the manga title consists of. (cherry picked from commit b89acb5853ee8cf3e53a45bb28dfd0607f00d158) --- .../java/eu/kanade/tachiyomi/source/LocalSource.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt b/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt index 4ba2c41f9..1f58677d8 100755 --- a/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt @@ -250,7 +250,7 @@ class LocalSource(private val context: Context) : CatalogueSource, UnmeteredSour } } - name = getCleanChapterTitle(name, manga.title) + name = getCleanChapterTitle(name) ChapterRecognition.parseChapterNumber(this, sManga) } } @@ -267,12 +267,10 @@ class LocalSource(private val context: Context) : CatalogueSource, UnmeteredSour override suspend fun getPageList(chapter: ChapterInfo) = throw Exception("Unused") /** - * Strips the manga title from a chapter name and trim whitespace/delimiter characters. + * Trim whitespace/delimiter characters from chapter names. */ - private fun getCleanChapterTitle(chapterName: String, mangaTitle: String): String { - return chapterName - .replace(mangaTitle, "") - .trim(*WHITESPACE_CHARS.toCharArray(), '-', '_', ',', ':') + private fun getCleanChapterTitle(chapterName: String): String { + return chapterName.trim(*WHITESPACE_CHARS.toCharArray(), '-', '_', ',', ':') } private fun isSupportedFile(extension: String): Boolean {