Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tom5079 committed Sep 14, 2020
1 parent fee2803 commit b907d36
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ android {
minSdkVersion 16
targetSdkVersion 30
versionCode 59
versionName "5.0.2-hotfix1"
versionName "5.0.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
Expand Down
2 changes: 1 addition & 1 deletion app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"filters": [],
"properties": [],
"versionCode": 59,
"versionName": "5.0.2-hotfix1",
"versionName": "5.0.3",
"enabled": true,
"outputFile": "app-release.apk"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class DownloadService : Service() {

if (isCompleted(galleryID)) {
if (DownloadManager.getInstance(this@DownloadService)
.getDownloadFolder(galleryID) != null)
.getDownloadFolder(galleryID) != null )
Cache.getInstance(this@DownloadService, galleryID).moveToDownload()

notificationManager.cancel(galleryID)
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/xyz/quaver/pupil/ui/ReaderActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ class ReaderActivity : BaseActivity() {
animateDownloadFAB(false)
} else {
downloadManager.addDownloadFolder(galleryID)
DownloadService.download(context, galleryID, true)
animateDownloadFAB(true)
}
}
Expand All @@ -419,8 +420,7 @@ class ReaderActivity : BaseActivity() {
with(reader_fab_retry) {
setImageResource(R.drawable.refresh)
setOnClickListener {
downloader?.cancel(galleryID)
downloader?.download(galleryID)
DownloadService.download(context, galleryID)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ class DownloadManager private constructor(context: Context) : ContextWrapper(con

val folder = downloadFolder.getChild(name)

if (!folder.exists())
folder.mkdir()
if (folder.exists())
return

folder.mkdir()

downloadFolderMap[galleryID] = folder.name

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/xyz/quaver/pupil/util/misc.kt
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ fun GalleryBlock.formatDownloadFolder(): String =
formatMap.entries.fold(it) { str, (k, v) ->
str.replace(k, v.invoke(this), true)
}
}.replace("/", "")
}.replace(Regex("""[*\\|"?><:/]"""), "")

fun GalleryBlock.formatDownloadFolderTest(format: String): String =
format.let {
formatMap.entries.fold(it) { str, (k, v) ->
str.replace(k, v.invoke(this), true)
}
}.replace("/", "")
}.replace(Regex("""[*\\|"?><:/]"""), "")

val Reader.requestBuilders: List<Request.Builder>
get() {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/menu.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--drawable/menu.xml-->
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:width="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="#fff" android:pathData="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/>
<path android:fillColor="?attr/colorControlNormal" android:pathData="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/>
</vector>

0 comments on commit b907d36

Please sign in to comment.