Log in

View Full Version : Nested playlists and nonrandom shuffling


Katie Boundary
16th May 2021, 20:06
Scenario 1: I want to load several arbitrary episodes of He-Man, the first 5 episodes of GI Joe, the first 3 episodes of Transformers, the first 5 episodes of Jem and the Holograms, the first 3 episodes of Visionaries, the first 5 episodes of Ninja Turtles, several arbitrary episodes of The Real Ghostbusters, and (of course) My Little Pony: Rescue at Midnight Castle and My Little Pony: Escape from Catrina into a playlist. I want to play them in a semi-shuffled manner, EXCEPT that, while the episodes of He-Man and Ghostbusters may be played at random, the episodes within each of the other series cannot be played out of order. In other words, at the end of each episode, the player would randomly pick a series; if it lands on He-Man or Ghostbusters, it plays any random episode that it has not already played, but if it lands on any other series, it plays whichever episode comes after the most recently played episode of that series. Optional function: giving each playlist a certain "weight" in the shuffle according to how many episodes (or unplayed episodes) are in it, so that if I load up 2 episodes of My Little Pony and all 65 episodes of GI Joe, there will be a 2 in 67 chance of the next episode being a My Little Pony episode and a 65 in 67 chance of it being a GI Joe episode, rather than it being a coin toss. That way, I don't blow through both MLP episodes in the first hour and a half and then have to sit through 23 uninterrupted hours of GI Joe.


Scenario 2: I have 24 playlists: one representing a midnight time slot, one representing a 1 AM time slot, one representing a 2 AM time slot, and so on. I want the player to play one file at random from the midnight time slot, then play one file at random from the 1 AM time slot, then one at random from the 2 AM time slot, etc.


Does this kind of functionality exist in any known software players?

hubblec4
18th May 2021, 12:18
I guess there is no player that can do this.

therube
21st July 2021, 20:18
2. pseudo-code

cat - > todays.playlist.m3u

for i = 1 to 24
cat %i.m3u | rand | head -1 >> todays.playlist.m3u
next i

That would give you a playlist of 24 files.
If you start that at midnight... if they are 1 hour in length...

Or if longer, maybe you could use ffplay (not sure what options it accepts offhand) to only play for 1 hour max?
ffplay -t 1:00:00
& automate that using ffplay rather then a playlist...