Compare commits

...
Author SHA1 Message Date
tarsin 63cd60b237 Release 1.8.6.0-alpha04
Releases / Build (push) Has been cancelled
2023-02-14 16:40:49 +08:00
tarsin 0df8e8522f Fix #791 2023-02-14 16:39:10 +08:00
tarsin 1ebbf6e349 Release 1.8.6.0-alpha03
Releases / Build (push) Has been cancelled
2023-02-14 16:22:12 +08:00
tarsin 1b71f6a60a Fix issue that download progress being reset when entering reader 2023-02-14 16:20:38 +08:00
3 changed files with 8 additions and 11 deletions

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@ android {
minSdk = 28
targetSdk = 33
versionCode = 180031
versionName = "1.8.6.0-alpha02"
versionName = "1.8.6.0-alpha04"
resourceConfigurations.addAll(
listOf(
"zh",
@@ -262,7 +262,7 @@ public final class SpiderQueen implements Runnable {
}
}
private boolean shouldIntoDownload = false;
private boolean mInDownloadMode = false;
private void updateMode() {
int mode;
@@ -277,7 +277,7 @@ public final class SpiderQueen implements Runnable {
// Update download page
boolean intoDownloadMode = mode == MODE_DOWNLOAD;
if (intoDownloadMode && mPageStateArray != null) {
if (intoDownloadMode && !mInDownloadMode && mPageStateArray != null) {
// Clear download state
synchronized (mPageStateLock) {
int[] temp = mPageStateArray;
@@ -292,9 +292,9 @@ public final class SpiderQueen implements Runnable {
mPageErrorMap.clear();
mPagePercentMap.clear();
}
} else if (intoDownloadMode && mPageStateArray == null) {
shouldIntoDownload = true;
}
mInDownloadMode = intoDownloadMode;
}
private void setMode(@Mode int mode) {
@@ -631,7 +631,7 @@ public final class SpiderQueen implements Runnable {
// Notify get pages
notifyGetPages(spiderInfo.getPages());
if (shouldIntoDownload) mWorkerScope.enterDownloadMode();
if (mInDownloadMode) mWorkerScope.enterDownloadMode();
// Wait finish
synchronized (mQueenLock) {
@@ -309,11 +309,8 @@ class SpiderQueenWorker(private val queen: SpiderQueen) : CoroutineScope {
}
private suspend fun doInJob(index: Int) {
val src = spiderDen.getImageSource(index) ?: run {
delay(1000)
mFetcherJobMap[index]?.takeIf { it.isActive }?.join()
spiderDen.getImageSource(index)
} ?: return
mFetcherJobMap[index]?.takeIf { it.isActive }?.join()
val src = spiderDen.getImageSource(index) ?: return
val image = mSemaphore.withPermit { decode(src) }
runCatching {
currentCoroutineContext().ensureActive()