mirror of https://github.com/readrops/Readrops.git
Improve key for fever favicons
This commit is contained in:
parent
dd98c7b0a6
commit
4f9fbc3f7c
|
@ -155,7 +155,7 @@ class SyncWorker(
|
||||||
val syncResult = repository.synchronize()
|
val syncResult = repository.synchronize()
|
||||||
|
|
||||||
if (syncResult.favicons.isNotEmpty()) {
|
if (syncResult.favicons.isNotEmpty()) {
|
||||||
loadFeverFavicons(syncResult.favicons, notificationBuilder)
|
loadFeverFavicons(syncResult.favicons, account, notificationBuilder)
|
||||||
} else {
|
} else {
|
||||||
fetchFeedColors(syncResult, notificationBuilder)
|
fetchFeedColors(syncResult, notificationBuilder)
|
||||||
}
|
}
|
||||||
|
@ -248,6 +248,7 @@ class SyncWorker(
|
||||||
@OptIn(ExperimentalCoilApi::class)
|
@OptIn(ExperimentalCoilApi::class)
|
||||||
private suspend fun loadFeverFavicons(
|
private suspend fun loadFeverFavicons(
|
||||||
favicons: Map<Feed, Favicon>,
|
favicons: Map<Feed, Favicon>,
|
||||||
|
account: Account,
|
||||||
notificationBuilder: Builder
|
notificationBuilder: Builder
|
||||||
) {
|
) {
|
||||||
if (notificationManager.areNotificationsEnabled()) {
|
if (notificationManager.areNotificationsEnabled()) {
|
||||||
|
@ -260,7 +261,7 @@ class SyncWorker(
|
||||||
val diskCache = applicationContext.imageLoader.diskCache!!
|
val diskCache = applicationContext.imageLoader.diskCache!!
|
||||||
|
|
||||||
for ((feed, favicon) in favicons) {
|
for ((feed, favicon) in favicons) {
|
||||||
val key = "account_${feed.accountId}_feed_${feed.id}"
|
val key = "account_${account.id}_feed_${feed.name!!.replace(" ", "_")}"
|
||||||
val snapshot = diskCache.openSnapshot(key)
|
val snapshot = diskCache.openSnapshot(key)
|
||||||
|
|
||||||
if (snapshot == null) {
|
if (snapshot == null) {
|
||||||
|
|
Loading…
Reference in New Issue