pixelchai / NightBotNowPlaying

Program for overlaying NightBot's current song on your stream
2 stars 3 forks source link

add songs in queue as a bracket variable for text output AKA "Next Up" display #4

Open DinoSour69 opened 5 months ago

DinoSour69 commented 5 months ago

i can probably add this in there once i figure out how to work nightbot API but if it's possible to show titles of songs that aren't currently playing that would be so cool :3

pixelchai commented 3 months ago

Yes this is possible. For reference, the relevant part of the NightBot API is here: https://api-docs.nightbot.tv/#get-queue Any of the fields in the response of this endpoint is possible. This includes upcoming items.

When incorporating this, we need to think about how to let the users configure this, while still being backwards-compatible. Note that every item in the queue has its own title, artist, requester, etc.

One way that makes sense to me is:

It means by default, there will be no change to the program behaviour at all (completely backwards-compatible) but let's say if you had a config.json like this:

{
  "text": "{title} by {artist}",
  "path": "np.txt",
  "num_upcoming": 2,
  "current_prefix": "Now playing: ",
  "upcoming_prefix": "  --  Upcoming: ",
  "separator": " | "
}

Then the output might look something like this:

Now playing: Song1 by Alice  --  Upcoming: Song2 by Bob | Song3 by Charlie

And every track uses the same text formatting string.

Tbh this string could get really long, and it may not look great without formatting and stuff, like maybe "Now playing" should be bold. There isn't a straightforward way of doing this with only one Text source in OBS iirc. Maybe a system where NightBotNowPlaying outputs multiple files so you can have multiple text sources would be good.