mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-05-24 02:22:15 +02:00
Filter cache results by enabled clients
This commit is contained in:
parent
8a53297be2
commit
ed9a65b2f0
@ -49,13 +49,17 @@ class StateCache {
|
|||||||
Logger.i(TAG, "Subscriptions CachePager get subscriptions");
|
Logger.i(TAG, "Subscriptions CachePager get subscriptions");
|
||||||
val subs = StateSubscriptions.instance.getSubscriptions();
|
val subs = StateSubscriptions.instance.getSubscriptions();
|
||||||
Logger.i(TAG, "Subscriptions CachePager polycentric urls");
|
Logger.i(TAG, "Subscriptions CachePager polycentric urls");
|
||||||
val allUrls = subs.map {
|
val allUrls = subs
|
||||||
|
.map {
|
||||||
val otherUrls = PolycentricCache.instance.getCachedProfile(it.channel.url)?.profile?.ownedClaims?.mapNotNull { c -> c.claim.resolveChannelUrl() } ?: listOf();
|
val otherUrls = PolycentricCache.instance.getCachedProfile(it.channel.url)?.profile?.ownedClaims?.mapNotNull { c -> c.claim.resolveChannelUrl() } ?: listOf();
|
||||||
if(!otherUrls.contains(it.channel.url))
|
if(!otherUrls.contains(it.channel.url))
|
||||||
return@map listOf(listOf(it.channel.url), otherUrls).flatten();
|
return@map listOf(listOf(it.channel.url), otherUrls).flatten();
|
||||||
else
|
else
|
||||||
return@map otherUrls;
|
return@map otherUrls;
|
||||||
}.flatten().distinct();
|
}
|
||||||
|
.flatten()
|
||||||
|
.distinct()
|
||||||
|
.filter { StatePlatform.instance.hasEnabledChannelClient(it) };
|
||||||
|
|
||||||
Logger.i(TAG, "Subscriptions CachePager get pagers");
|
Logger.i(TAG, "Subscriptions CachePager get pagers");
|
||||||
val pagers: List<IPager<IPlatformContent>>;
|
val pagers: List<IPager<IPlatformContent>>;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user