Fixes bug when showing multiple versions of replaceable videos in the gallery.
This commit is contained in:
+13
-2
@@ -21,9 +21,11 @@
|
||||
package com.vitorpamplona.amethyst.ui.screen.loggedIn.profile.gallery.dal
|
||||
|
||||
import com.vitorpamplona.amethyst.model.Account
|
||||
import com.vitorpamplona.amethyst.model.AddressableNote
|
||||
import com.vitorpamplona.amethyst.model.LocalCache
|
||||
import com.vitorpamplona.amethyst.model.Note
|
||||
import com.vitorpamplona.amethyst.model.User
|
||||
import com.vitorpamplona.amethyst.model.filter
|
||||
import com.vitorpamplona.amethyst.ui.dal.AdditiveFeedFilter
|
||||
import com.vitorpamplona.amethyst.ui.dal.DefaultFeedOrder
|
||||
import com.vitorpamplona.amethyst.ui.dal.FilterByListParams
|
||||
@@ -31,7 +33,9 @@ import com.vitorpamplona.quartz.experimental.profileGallery.ProfileGalleryEntryE
|
||||
import com.vitorpamplona.quartz.nip51Lists.muteList.MuteListEvent
|
||||
import com.vitorpamplona.quartz.nip51Lists.peopleList.PeopleListEvent
|
||||
import com.vitorpamplona.quartz.nip68Picture.PictureEvent
|
||||
import com.vitorpamplona.quartz.nip71Video.VideoEvent
|
||||
import com.vitorpamplona.quartz.nip71Video.RegularVideoEvent
|
||||
import com.vitorpamplona.quartz.nip71Video.ReplaceableVideoEvent
|
||||
import com.vitorpamplona.quartz.nip71Video.VideoVerticalEvent
|
||||
|
||||
class UserProfileGalleryFeedFilter(
|
||||
val user: User,
|
||||
@@ -51,6 +55,12 @@ class UserProfileGalleryFeedFilter(
|
||||
acceptableEvent(it, params, user)
|
||||
}
|
||||
|
||||
val addressableNotes =
|
||||
LocalCache.addressables.filter(
|
||||
listOf(VideoVerticalEvent.KIND, VideoVerticalEvent.KIND),
|
||||
user.pubkeyHex,
|
||||
)
|
||||
|
||||
return sort(notes).toList()
|
||||
}
|
||||
|
||||
@@ -72,7 +82,8 @@ class UserProfileGalleryFeedFilter(
|
||||
(
|
||||
it.event?.pubKey == user.pubkeyHex && (
|
||||
noteEvent is PictureEvent ||
|
||||
noteEvent is VideoEvent ||
|
||||
noteEvent is RegularVideoEvent ||
|
||||
(noteEvent is ReplaceableVideoEvent && it is AddressableNote) ||
|
||||
(noteEvent is ProfileGalleryEntryEvent && noteEvent.hasUrl() && noteEvent.hasFromEvent())
|
||||
)
|
||||
) // && noteEvent.isOneOf(SUPPORTED_VIDEO_FEED_MIME_TYPES_SET))
|
||||
|
||||
Reference in New Issue
Block a user