remove deleted gallery entries for recommendations

This commit is contained in:
Believethehype 2024-07-25 10:10:18 +02:00
parent 51edb3ba6b
commit 6924135fd3
4 changed files with 14 additions and 5 deletions

View File

@ -164,7 +164,7 @@ class DicoverContentCurrentlyPopularGallery(DVMTaskInterface):
await cli.connect()
filtreactions = Filter().kinds([definitions.EventDefinitions.KIND_ZAP, definitions.EventDefinitions.KIND_REPOST,
definitions.EventDefinitions.KIND_REACTION,
definitions.EventDefinitions.KIND_REACTION, definitions.EventDefinitions.KIND_DELETION,
definitions.EventDefinitions.KIND_NOTE]).events(ids).since(since)
dbopts = NegentropyOptions().direction(NegentropyDirection.DOWN)
@ -179,6 +179,14 @@ class DicoverContentCurrentlyPopularGallery(DVMTaskInterface):
for event in events:
if event.created_at().as_secs() > timestamp_since:
filt1 = Filter().kinds([definitions.EventDefinitions.KIND_DELETION]).event(event.id()).limit(1)
deletions = await databasegallery.query([filt1])
if len(deletions) > 0:
print("Deleted event, skipping")
continue
filt = Filter().kinds([definitions.EventDefinitions.KIND_ZAP, definitions.EventDefinitions.KIND_REPOST,
definitions.EventDefinitions.KIND_REACTION,
definitions.EventDefinitions.KIND_NOTE]).event(event.id()).since(since)

View File

@ -9,6 +9,7 @@ class EventDefinitions:
KIND_NOTE = Kind(1)
KIND_FOLLOW_LIST = Kind(3)
KIND_DM = Kind(4)
KIND_DELETION = Kind(5)
KIND_REPOST = Kind(6)
KIND_REACTION = Kind(7)
KIND_NIP94_METADATA = Kind(1063)

View File

@ -1,6 +1,6 @@
from setuptools import setup, find_packages
VERSION = '0.7.10'
VERSION = '0.7.11'
DESCRIPTION = 'A framework to build and run Nostr NIP90 Data Vending Machines'
LONG_DESCRIPTION = ('A framework to build and run Nostr NIP90 Data Vending Machines. See the github repository for more information')

View File

@ -12,9 +12,9 @@ from nostr_dvm.utils.admin_utils import AdminConfig
from nostr_dvm.utils.dvmconfig import build_default_config
from nostr_dvm.utils.nip89_utils import create_amount_tag, NIP89Config, check_and_set_d_tag
rebroadcast_NIP89 = True # Announce NIP89 on startup
rebroadcast_NIP65_Relay_List = True
update_profile = True
rebroadcast_NIP89 = False # Announce NIP89 on startup
rebroadcast_NIP65_Relay_List = False
update_profile = False
global_update_rate = 1200 # set this high on first sync so db can fully sync before another process trys to.
use_logger = True