Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63cd60b237 | ||
|
|
0df8e8522f | ||
|
|
1ebbf6e349 | ||
|
|
1b71f6a60a |
No files matched your search
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user