Add disambiguator to chapter filenames to handle duplicate chapter names#2305
Conversation
Fixed: new downloads. Working: reading. Todo: migrate old chapters to new name + delete and force redownload of problem chapters (chapters within a manga where name and scanlator are the same value).
…able, and equally unique.
…d is more appropriate for new file naming format.
…ent_chapters_with_same_name Improvements to PR#2206
domain/src/main/java/tachiyomi/domain/download/model/ChapterDownload.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadProvider.kt
Outdated
Show resolved
Hide resolved
| @@ -165,24 +196,30 @@ class DownloadProvider( | |||
| } | |||
|
|
|||
| fun isChapterDirNameChanged(oldChapter: Chapter, newChapter: Chapter): Boolean { | |||
There was a problem hiding this comment.
Now that I think about it this function doesn't really account for name schema change
There was a problem hiding this comment.
Would you like me to make changes to it?
There was a problem hiding this comment.
If possible. Feel free to make this it's own PR so we can ship it separately than this feature.
There was a problem hiding this comment.
You said it could be a separate PR, so changes to it aren't included here.
| @@ -165,24 +196,30 @@ class DownloadProvider( | |||
| } | |||
|
|
|||
| fun isChapterDirNameChanged(oldChapter: Chapter, newChapter: Chapter): Boolean { | |||
There was a problem hiding this comment.
If possible. Feel free to make this it's own PR so we can ship it separately than this feature.
source-local/src/androidMain/kotlin/tachiyomi/source/local/LocalSource.kt
Show resolved
Hide resolved
This reverts commit e8214a4.
…_chapters_with_same_name
MajorTanya
left a comment
There was a problem hiding this comment.
As I mentioned in the non-English vs non-ASCII comment, I strongly prefer going with non-ASCII but I refrained from making change suggestions everywhere. Seemed excessive to me to post like, 20 suggestions when it's effectively what, like 3 standard refactor -> rename operations in an editor/IDE.
Otherwise just a few things that stood out to me from reading the code. Excellent work.
app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadProvider.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadProvider.kt
Outdated
Show resolved
Hide resolved
core/common/src/main/kotlin/eu/kanade/tachiyomi/util/storage/DiskUtil.kt
Outdated
Show resolved
Hide resolved
…ovider.kt Co-authored-by: MajorTanya <39014446+MajorTanya@users.noreply.github.com>
MajorTanya
left a comment
There was a problem hiding this comment.
My points are resolved, I have nothing else to say currently
Not sure what the others think though.
…_chapters_with_same_name
|
Added changelog entry |
| @@ -165,24 +196,30 @@ class DownloadProvider( | |||
| } | |||
|
|
|||
| fun isChapterDirNameChanged(oldChapter: Chapter, newChapter: Chapter): Boolean { | |||
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
…_chapters_with_same_name
…ionally for OSes that don't support Unicode in filename (mihonapp/mihon#2305) Co-authored-by: jkim <jhskim@hotmail.com> Co-authored-by: fatotak <111342761+fatotak@users.noreply.github.com> Co-authored-by: MajorTanya <39014446+MajorTanya@users.noreply.github.com> Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com> (cherry picked from commit 58b25d697f7987e9888344e815d5646ec010a663)
…ionally for OSes that don't support Unicode in filename (mihonapp/mihon#2305) Co-authored-by: jkim <jhskim@hotmail.com> Co-authored-by: fatotak <111342761+fatotak@users.noreply.github.com> Co-authored-by: MajorTanya <39014446+MajorTanya@users.noreply.github.com> Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com> (cherry picked from commit 58b25d697f7987e9888344e815d5646ec010a663)
…ionally for OSes that don't support Unicode in filename (mihonapp#2305) Co-authored-by: jkim <jhskim@hotmail.com> Co-authored-by: fatotak <111342761+fatotak@users.noreply.github.com> Co-authored-by: MajorTanya <39014446+MajorTanya@users.noreply.github.com> Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This is #2206 in combination with fatotak#4 and fatotak#5. Please see the original PR description as well as #2206 (comment) and #2206 (comment) for further context; a brief summary of the changes follows:
Resolves #1395.
Resolves #2280.
Resolves #1633.
Resolves #1517.
Downloaded chapter before this change:
Downloaded chapter after this change:
Downloaded chapter after this change, with the setting enabled to disallow non-English characters in filenames:
Please see also mihonapp/website#161, which adds documentation as was requested by
@Foffson Discord.See also #2332, which improves the behavior of LocalSource with less readable filenames.