Skip to content

Commit

Permalink
Fix saved images
Browse files Browse the repository at this point in the history
release 1.6.2.1
  • Loading branch information
nonproto committed Feb 8, 2020
1 parent 30043d8 commit 2930fbd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ android {
standard {
buildConfigField "boolean", "INCLUDE_UPDATER", "true"
dimension "default"
versionCode 43
versionName "1.6.2"
versionCode 44
versionName "1.6.2.1"
}
dev {
resConfigs "en"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,24 +491,28 @@ class ReaderPresenter(
private fun parseChapterName(chapterName: String, pageNumber: String, scanlator: String?): String {
val builder = StringBuilder()
var title = ""
var vol = ""
val list = chapterName.split(Regex(" "), 3)

list.forEach {
if (it.startsWith("vol.", true)) {
builder.append("Vol.")
builder.append(it.substringAfter(".").padStart(4, '0'))
vol = " Vol." + it.substringAfter(".").padStart(4, '0')

} else if (it.startsWith("ch.", true)) {
builder.append(" Ch.")
builder.append(it.substringAfter(".").padStart(4, '0'))
} else {
title = it
title = " $it"
}
}

if (vol.isNotBlank()) {
builder.append(vol)
}
builder.append(" Pg.")
builder.append(pageNumber.padStart(4, '0'))

if (title.isNotEmpty()) {
builder.append(" ")
builder.append(title.take(200))
}

Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/raw/changelog_release.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<changelog bulletedList="true">
<changelogversion
changeDate=""
versionName="v1.6.2.1">
<changelogtext>Fix saved file name swapping chapter and volume so saved files are always in correct chapter order</changelogtext>
</changelogversion>
<changelogversion
changeDate=""
versionName="v1.6.2">
Expand Down

0 comments on commit 2930fbd

Please sign in to comment.