소스 검색

Added regex to strip local manga chapter names (#983)

* added regex to strip non-alphanumeric characters in local filenames
Ayushya Anand 7 년 전
부모
커밋
ff4a015baa
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt

@@ -144,7 +144,7 @@ class LocalSource(private val context: Context) : CatalogueSource {
                         } else {
                             chapterFile.nameWithoutExtension
                         }
-                        val chapNameCut = chapName.replace(manga.title, "", true).trim()
+                        val chapNameCut = chapName.replace(manga.title, "", true).trim(' ', '-', '_')
                         name = if (chapNameCut.isEmpty()) chapName else chapNameCut
                         date_upload = chapterFile.lastModified()
                         ChapterRecognition.parseChapterNumber(this, manga)