mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-10-10 18:02:34 +02:00
async function
This commit is contained in:
@@ -130,7 +130,7 @@ class DVM:
|
|||||||
if self.dvm_config.LOGLEVEL.value >= LogLevel.INFO.value:
|
if self.dvm_config.LOGLEVEL.value >= LogLevel.INFO.value:
|
||||||
print(
|
print(
|
||||||
bcolors.MAGENTA + "[" + self.dvm_config.NIP89.NAME + "] Received new Request: " + task + " from " + user.name + bcolors.ENDC)
|
bcolors.MAGENTA + "[" + self.dvm_config.NIP89.NAME + "] Received new Request: " + task + " from " + user.name + bcolors.ENDC)
|
||||||
duration = input_data_file_duration(nip90_event, dvm_config=self.dvm_config, client=self.client)
|
duration = await input_data_file_duration(nip90_event, dvm_config=self.dvm_config, client=self.client)
|
||||||
amount = get_amount_per_task(task, self.dvm_config, duration)
|
amount = get_amount_per_task(task, self.dvm_config, duration)
|
||||||
if amount is None:
|
if amount is None:
|
||||||
return
|
return
|
||||||
|
@@ -11,7 +11,7 @@ from nostr_dvm.utils.scrapper.media_scrapper import OvercastDownload, XitterDown
|
|||||||
InstagramDownload, YouTubeDownload, XDownload
|
InstagramDownload, YouTubeDownload, XDownload
|
||||||
|
|
||||||
|
|
||||||
def input_data_file_duration(event, dvm_config, client, start=0, end=0):
|
async def input_data_file_duration(event, dvm_config, client, start=0, end=0):
|
||||||
# print("[" + dvm_config.NIP89.NAME + "] Getting Duration of the Media file..")
|
# print("[" + dvm_config.NIP89.NAME + "] Getting Duration of the Media file..")
|
||||||
input_value = ""
|
input_value = ""
|
||||||
input_type = ""
|
input_type = ""
|
||||||
@@ -28,7 +28,7 @@ def input_data_file_duration(event, dvm_config, client, start=0, end=0):
|
|||||||
if input_type == "event": # NIP94 event
|
if input_type == "event": # NIP94 event
|
||||||
if count > 1:
|
if count > 1:
|
||||||
return 1 # we ignore length for multiple event inputs for now
|
return 1 # we ignore length for multiple event inputs for now
|
||||||
evt = get_event_by_id(input_value, client=client, config=dvm_config)
|
evt = await get_event_by_id(input_value, client=client, config=dvm_config)
|
||||||
if evt is not None:
|
if evt is not None:
|
||||||
input_value, input_type = check_nip94_event_for_media(evt, input_value, input_type)
|
input_value, input_type = check_nip94_event_for_media(evt, input_value, input_type)
|
||||||
if input_type == "text":
|
if input_type == "text":
|
||||||
|
Reference in New Issue
Block a user