mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-08-02 22:30:40 +00:00
Deduplicated map.
This commit is contained in:
parent
d059947925
commit
e13ab5cb40
1 changed files with 2 additions and 8 deletions
|
@ -130,10 +130,7 @@ class StatePolycentric {
|
||||||
//TODO: Currently abusing subscription concurrency for parallelism
|
//TODO: Currently abusing subscription concurrency for parallelism
|
||||||
val concurrency = if (channelConcurrency == -1) Settings.instance.subscriptions.getSubscriptionsConcurrency() else channelConcurrency;
|
val concurrency = if (channelConcurrency == -1) Settings.instance.subscriptions.getSubscriptionsConcurrency() else channelConcurrency;
|
||||||
val pagers = profile.ownedClaims.groupBy { it.claim.claimType }.mapNotNull {
|
val pagers = profile.ownedClaims.groupBy { it.claim.claimType }.mapNotNull {
|
||||||
//TODO: Deduplicate once multiple urls in single claim is supported
|
val url = it.value.firstOrNull()?.claim?.resolveChannelUrl() ?: return@mapNotNull null;
|
||||||
return@mapNotNull it.value.firstOrNull();
|
|
||||||
}.mapNotNull {
|
|
||||||
val url = it.claim.resolveChannelUrl() ?: return@mapNotNull null;
|
|
||||||
if (!StatePlatform.instance.hasEnabledChannelClient(url)) {
|
if (!StatePlatform.instance.hasEnabledChannelClient(url)) {
|
||||||
return@mapNotNull null;
|
return@mapNotNull null;
|
||||||
}
|
}
|
||||||
|
@ -151,10 +148,7 @@ class StatePolycentric {
|
||||||
val concurrency = if (channelConcurrency == -1) Settings.instance.subscriptions.getSubscriptionsConcurrency() else channelConcurrency;
|
val concurrency = if (channelConcurrency == -1) Settings.instance.subscriptions.getSubscriptionsConcurrency() else channelConcurrency;
|
||||||
val deferred = profile.ownedClaims.groupBy { it.claim.claimType }
|
val deferred = profile.ownedClaims.groupBy { it.claim.claimType }
|
||||||
.mapNotNull {
|
.mapNotNull {
|
||||||
//TODO: Deduplicate once multiple urls in single claim is supported
|
val url = it.value.firstOrNull()?.claim?.resolveChannelUrl() ?: return@mapNotNull null;
|
||||||
return@mapNotNull it.value.firstOrNull();
|
|
||||||
}.mapNotNull {
|
|
||||||
val url = it.claim.resolveChannelUrl() ?: return@mapNotNull null;
|
|
||||||
val client = StatePlatform.instance.getChannelClientOrNull(url) ?: return@mapNotNull null;
|
val client = StatePlatform.instance.getChannelClientOrNull(url) ?: return@mapNotNull null;
|
||||||
|
|
||||||
return@mapNotNull Pair(client, scope.async(Dispatchers.IO) {
|
return@mapNotNull Pair(client, scope.async(Dispatchers.IO) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue