mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-17 19:29:18 +01:00
Fix chapter download with empty scanlator (#7844)
This commit is contained in:
parent
a70b848646
commit
4b9a6541d1
@ -139,14 +139,15 @@ class DownloadProvider(private val context: Context) {
|
|||||||
fun getChapterDirName(chapterName: String, chapterScanlator: String?): String {
|
fun getChapterDirName(chapterName: String, chapterScanlator: String?): String {
|
||||||
return DiskUtil.buildValidFilename(
|
return DiskUtil.buildValidFilename(
|
||||||
when {
|
when {
|
||||||
chapterScanlator != null -> "${chapterScanlator}_$chapterName"
|
chapterScanlator.isNullOrBlank().not() -> "${chapterScanlator}_$chapterName"
|
||||||
else -> chapterName
|
else -> chapterName
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun isChapterDirNameChanged(oldChapter: DomainChapter, newChapter: DomainChapter): Boolean {
|
fun isChapterDirNameChanged(oldChapter: DomainChapter, newChapter: DomainChapter): Boolean {
|
||||||
return oldChapter.name != newChapter.name || oldChapter.scanlator != newChapter.scanlator
|
return oldChapter.name != newChapter.name ||
|
||||||
|
oldChapter.scanlator?.takeIf { it.isNotBlank() } != newChapter.scanlator?.takeIf { it.isNotBlank() }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -164,7 +165,7 @@ class DownloadProvider(private val context: Context) {
|
|||||||
// Archived chapters
|
// Archived chapters
|
||||||
add("$chapterDirName.cbz")
|
add("$chapterDirName.cbz")
|
||||||
|
|
||||||
if (chapterScanlator == null) {
|
if (chapterScanlator.isNullOrBlank()) {
|
||||||
// Previously null scanlator fields were converted to "" due to a bug
|
// Previously null scanlator fields were converted to "" due to a bug
|
||||||
add("_$chapterDirName")
|
add("_$chapterDirName")
|
||||||
add("_$chapterDirName.cbz")
|
add("_$chapterDirName.cbz")
|
||||||
|
Loading…
Reference in New Issue
Block a user