Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add $effectQueueLength variable #2533

Open
wants to merge 3 commits into
base: v5
Choose a base branch
from

Conversation

codehdn
Copy link

@codehdn codehdn commented Apr 28, 2024

Description of the Change

I've added a new text variable "effectQueueLength" as a utility variable. This variable takes in a queue name

Applicable Issues

#2513

Testing

  • Setup a new effect queue call it "testing" make it whatever queue mode you like
  • disable the effect queue
  • Setup a command and call it !addtoqueue with an effect of Chat that says "hi"
  • In the !addtoqueue command set the queue to be "testing"
  • Setup a command and call it !queuelength with an effect of Chat that says "$effectQueueLength[testing]"
  • Setup one more command and call it !badqueue with an effect of Chat that says "$effectQueueLength[not-a-real-queue]"
  • Now head to the dashboard
  • send a message of "!addtoqueue" which will bring the queue count to 1
  • send a message of "!queuelength" it should return a queue length of 1
  • send a message of "!addtoqueue" 3 times the new queue length should be 4
  • send a message of "!queuelength" it should return a queue length of 4
  • head over to the effect queues page and enable and re disable your queue
  • head back to the dashboard
  • send a message of "!queuelength" it should return a queue length less than 4 (exact number will depend on queue type and how long the queue was enabled, anything below 4 is a passing condition)
  • send a message of "!badqueue" this queue does not exists and as such should return the text "Unknown"

Screenshots

Selecting the variable:
Selecting the variable
Primary use case:
Primary use case
Bad queue case:
Bad queue case

@codehdn codehdn requested a review from ebiggz as a code owner April 28, 2024 23:59
@codehdn codehdn changed the title Feat: Add Effect Queue Length variable Feat: Add $effectQueueLength variable Apr 29, 2024
@@ -101,7 +101,7 @@ class EffectQueueManager extends JsonDbManager {
}

item.queue = effectQueueRunner.getQueue(itemId);

item.length = item.queue.length;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding this so the express api also has easy access to this value. Its present when calling for all queues but not individual queues so assume just a small oversight.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I implemented that originally, the paradigm was "fetch all queues, get length. Fetch specific queue, get the array of items instead for more advanced use"

the intention there was that if you needed the length, you'd get it from the array as the array is already present.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completely get it, I'm adding it for the less capable tools that can fetch against the api but only take the json key and don't permit any type of count/logic capabilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants