-
-
Notifications
You must be signed in to change notification settings - Fork 680
Description
Checklist
- I checked that this feature has not been requested before
- I checked that this feature is not in the "Not planned" list
- This feature will benefit the majority of users
Problem Description / Use Case
I often want to set group rules based on which addons have queried, not necessarily how many streams they've returned (if any).
Lets say I want an exit expression to include: when at least one debrid, usenet, and http addon has queried...
Currently you would have to write out the names of the addons and do multiple "Addon" in queriedAddons expressions. Just using count(type(streams, string)) isn't sufficient as a value of 0 could mean either the relevant addons have finished and returned nothing, or they haven't returned anything yet.
Proposed Solution
Similar to the type(streams, string) filter function, provide an addonType(queriedAddons, string) or rewrite the existing type() function to support queriedAddons.
This would allow us to do:
queriedAddons = ["Torrentio", "Comet", "Newznab", "WebStreamr"]
count(addonType(queriedAddons, "debrid")) // <-- 2
count(addonType(queriedAddons, "http")) // <-- 1
count(addonType(queriedAddons, "usenet")) // <-- 1
count(addonType(queriedAddons, "live")) // <-- 0
count(addonType(queriedAddons, "debrid", "http", "usenet")) // <-- 4
Now, you can swap around your addons as much as you like, and the expression will still obey your rule of wanting specific stream types to have been found (or not found).