Skip to content

Commit

Permalink
3.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
LagradOst committed Feb 8, 2024
1 parent c02a888 commit 3593eb5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android {
minSdkVersion 21
targetSdkVersion 34
versionCode 54
versionName "3.1.5"
versionName "3.1.6"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down
24 changes: 20 additions & 4 deletions app/src/main/java/com/lagradost/quicknovel/BookDownloader2.kt
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,13 @@ object BookDownloader2Helper {
}

@WorkerThread
fun turnToEpub(activity: Activity?, author: String?, name: String, apiName: String, synopsis: String?): Boolean {
fun turnToEpub(
activity: Activity?,
author: String?,
name: String,
apiName: String,
synopsis: String?
): Boolean {
if (activity == null) return false
if (!activity.checkWrite()) {
activity.requestRW()
Expand Down Expand Up @@ -1069,7 +1075,12 @@ object BookDownloader2 {
}
}

private fun generateAndReadEpub(author: String?, name: String, apiName: String, synopsis: String?) {
private fun generateAndReadEpub(
author: String?,
name: String,
apiName: String,
synopsis: String?
) {
showToast(R.string.generating_epub)
if (!turnToEpub(author, name, apiName, synopsis)) {
showToast(R.string.error_loading_novel)
Expand Down Expand Up @@ -1144,7 +1155,12 @@ object BookDownloader2 {
deleteNovelAsync(author, name, apiName)
}

private fun turnToEpub(author: String?, name: String, apiName: String, synopsis: String?): Boolean {
private fun turnToEpub(
author: String?,
name: String,
apiName: String,
synopsis: String?
): Boolean {
return BookDownloader2Helper.turnToEpub(activity, author, name, apiName, synopsis)
}

Expand Down Expand Up @@ -1675,7 +1691,7 @@ object BookDownloader2 {
val filesDir = activity?.filesDir ?: return@ioSafe
val sApiName = BookDownloader2Helper.sanitizeFilename(api.name)
val sAuthor =
BookDownloader2Helper.sanitizeFilename(load.author ?: "")
BookDownloader2Helper.sanitizeFilename(load.author ?: "")
val sName = BookDownloader2Helper.sanitizeFilename(load.name)
val id = generateId(load, api.name)

Expand Down

0 comments on commit 3593eb5

Please sign in to comment.