Selaa lähdekoodia

After performing the removal in CacheBookService, remove the corresponding item from cacheBookMap. #5090

Horis 1 vuosi sitten
vanhempi
commit
459aba41e2

+ 5 - 1
app/src/main/java/io/legado/app/service/CacheBookService.kt

@@ -85,7 +85,11 @@ class CacheBookService : BaseService() {
                     intent.getIntExtra("end", 0)
                     intent.getIntExtra("end", 0)
                 )
                 )
 
 
-                IntentAction.remove -> removeDownload(intent.getStringExtra("bookUrl"))
+                IntentAction.remove -> {
+                    val bookUrl = intent.getStringExtra("bookUrl")
+                    CacheBook.cacheBookMap[bookUrl]?.stop()
+                    CacheBook.cacheBookMap.remove(bookUrl)
+                }
                 IntentAction.stop -> stopSelf()
                 IntentAction.stop -> stopSelf()
             }
             }
         }
         }