mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-10-08 21:53:24 +02:00
bugfix related to generic dvms
This commit is contained in:
@@ -204,7 +204,7 @@ class DVM:
|
|||||||
self.dvm_config)
|
self.dvm_config)
|
||||||
|
|
||||||
for dvm in self.dvm_config.SUPPORTED_DVMS:
|
for dvm in self.dvm_config.SUPPORTED_DVMS:
|
||||||
if dvm.TASK == task or dvm.TASK == "generic" and dvm.FIX_COST == 0 and dvm.PER_UNIT_COST == 0 and dvm_config.NIP88 is None:
|
if (dvm.TASK == task or dvm.TASK == "generic") and dvm.FIX_COST == 0 and dvm.PER_UNIT_COST == 0 and dvm_config.NIP88 is None:
|
||||||
task_is_free = True
|
task_is_free = True
|
||||||
|
|
||||||
cashu_redeemed = False
|
cashu_redeemed = False
|
||||||
|
2
setup.py
2
setup.py
@@ -1,6 +1,6 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
VERSION = '0.8.14'
|
VERSION = '0.8.15'
|
||||||
DESCRIPTION = 'A framework to build and run Nostr NIP90 Data Vending Machines'
|
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')
|
LONG_DESCRIPTION = ('A framework to build and run Nostr NIP90 Data Vending Machines. See the github repository for more information')
|
||||||
|
|
||||||
|
@@ -45,7 +45,7 @@ def playground(announce=False):
|
|||||||
dvm_config = build_default_config(identifier)
|
dvm_config = build_default_config(identifier)
|
||||||
dvm_config.KIND = Kind(kind) # Manually set the Kind Number (see data-vending-machines.org)
|
dvm_config.KIND = Kind(kind) # Manually set the Kind Number (see data-vending-machines.org)
|
||||||
dvm_config.CUSTOM_PROCESSING_MESSAGE = "Creating a personalized feed based on the topics you write about. This might take a moment."
|
dvm_config.CUSTOM_PROCESSING_MESSAGE = "Creating a personalized feed based on the topics you write about. This might take a moment."
|
||||||
|
dvm_config.FIX_COST = 10
|
||||||
|
|
||||||
# Add NIP89
|
# Add NIP89
|
||||||
nip89info = {
|
nip89info = {
|
||||||
@@ -64,7 +64,7 @@ def playground(announce=False):
|
|||||||
nip89config.CONTENT = json.dumps(nip89info)
|
nip89config.CONTENT = json.dumps(nip89info)
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
"input": "How do you call a noisy ostrich?",
|
"input": "",
|
||||||
}
|
}
|
||||||
|
|
||||||
dvm = GenericDVM(name=name, dvm_config=dvm_config, nip89config=nip89config,
|
dvm = GenericDVM(name=name, dvm_config=dvm_config, nip89config=nip89config,
|
||||||
@@ -138,16 +138,16 @@ def playground(announce=False):
|
|||||||
ns.finallist = {}
|
ns.finallist = {}
|
||||||
|
|
||||||
for event in events:
|
for event in events:
|
||||||
if all(ele in event.content().lower() for ele in []):
|
#if all(ele in event.content().lower() for ele in []):
|
||||||
if any(ele in event.content().lower() for ele in result):
|
if any(ele in event.content().lower() for ele in result):
|
||||||
if not any(ele in event.content().lower() for ele in []):
|
#if not any(ele in event.content().lower() for ele in []):
|
||||||
filt = Filter().kinds(
|
filt = Filter().kinds(
|
||||||
[definitions.EventDefinitions.KIND_ZAP, definitions.EventDefinitions.KIND_REACTION,
|
[definitions.EventDefinitions.KIND_ZAP, definitions.EventDefinitions.KIND_REACTION,
|
||||||
definitions.EventDefinitions.KIND_REPOST,
|
definitions.EventDefinitions.KIND_REPOST,
|
||||||
definitions.EventDefinitions.KIND_NOTE]).event(event.id()).since(since)
|
definitions.EventDefinitions.KIND_NOTE]).event(event.id()).since(since)
|
||||||
reactions = await database.query([filt])
|
reactions = await database.query([filt])
|
||||||
if len(reactions) >= 1:
|
if len(reactions) >= 1:
|
||||||
ns.finallist[event.id().to_hex()] = len(reactions)
|
ns.finallist[event.id().to_hex()] = len(reactions)
|
||||||
|
|
||||||
result_list = []
|
result_list = []
|
||||||
finallist_sorted = sorted(ns.finallist.items(), key=lambda x: x[1], reverse=True)[:int(200)]
|
finallist_sorted = sorted(ns.finallist.items(), key=lambda x: x[1], reverse=True)[:int(200)]
|
||||||
|
Reference in New Issue
Block a user