mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 08:08:55 +01:00 
			
		
		
		
	Always remove manga title from if it prefixes chapter names (related to #6913)
This commit is contained in:
		@@ -218,7 +218,6 @@ class LocalSource(private val context: Context) : CatalogueSource, UnmeteredSour
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    name = getCleanChapterTitle(name)
 | 
			
		||||
                    ChapterRecognition.parseChapterNumber(this, sManga)
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
@@ -234,13 +233,6 @@ class LocalSource(private val context: Context) : CatalogueSource, UnmeteredSour
 | 
			
		||||
 | 
			
		||||
    override suspend fun getPageList(chapter: ChapterInfo) = throw Exception("Unused")
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Trim whitespace/delimiter characters from chapter names.
 | 
			
		||||
     */
 | 
			
		||||
    private fun getCleanChapterTitle(chapterName: String): String {
 | 
			
		||||
        return chapterName.trim(*WHITESPACE_CHARS.toCharArray(), '-', '_', ',', ':')
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private fun isSupportedFile(extension: String): Boolean {
 | 
			
		||||
        return extension.lowercase() in SUPPORTED_ARCHIVE_TYPES
 | 
			
		||||
    }
 | 
			
		||||
@@ -326,32 +318,3 @@ class LocalSource(private val context: Context) : CatalogueSource, UnmeteredSour
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
private val SUPPORTED_ARCHIVE_TYPES = listOf("zip", "cbz", "rar", "cbr", "epub")
 | 
			
		||||
 | 
			
		||||
private val WHITESPACE_CHARS = arrayOf(
 | 
			
		||||
    ' ',
 | 
			
		||||
    '\u0009',
 | 
			
		||||
    '\u000A',
 | 
			
		||||
    '\u000B',
 | 
			
		||||
    '\u000C',
 | 
			
		||||
    '\u000D',
 | 
			
		||||
    '\u0020',
 | 
			
		||||
    '\u0085',
 | 
			
		||||
    '\u00A0',
 | 
			
		||||
    '\u1680',
 | 
			
		||||
    '\u2000',
 | 
			
		||||
    '\u2001',
 | 
			
		||||
    '\u2002',
 | 
			
		||||
    '\u2003',
 | 
			
		||||
    '\u2004',
 | 
			
		||||
    '\u2005',
 | 
			
		||||
    '\u2006',
 | 
			
		||||
    '\u2007',
 | 
			
		||||
    '\u2008',
 | 
			
		||||
    '\u2009',
 | 
			
		||||
    '\u200A',
 | 
			
		||||
    '\u2028',
 | 
			
		||||
    '\u2029',
 | 
			
		||||
    '\u202F',
 | 
			
		||||
    '\u205F',
 | 
			
		||||
    '\u3000',
 | 
			
		||||
)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user