Shuffle database

As seen in other Radio Automation Software: would like to see the opportunity to shuffle the order of the songs in the database (Local mAirList DB).

What exactly should that function do?

The Mini Scheduler automatically shuffles the songs as it picks them (after sorting them by the time they were last used).

Torben, I notice that songs, added to database at same time/day, are picked by the Mini Scheduler. This way I often play same songs in same order.

When periodically shuffled, songs are played in more random order. That’s the desired function.

Well, the database does not maintain an “ordered list” of the items. Instead, that order is derived from the playback history statistics each time the scheduler runs, as it sorts them by the time they were last played, according to “live data”. (It also applies a little bit of randomization to the list every time, but the “last played” information is the most important thing.)

So there is no list that could be shuffled.

So your request is actually: How can the scheduler be changed so that the order of songs varies a bit more every time the songs “rotate” in their list?

You’re not the first one who asks this question. I’ll keep thinking about it.

So your request is actually: How can the scheduler be changed so that the order of songs varies a bit more every time the songs "rotate" in their list?

Torben, correct. Would be great if this is possible.

What I once did was deleting the play history from the database, after that the playout was “shuffled”.

Wiele, which playlist history did you actually delete, where to find?

I guess what I did was completely unsupported, so you are warned :wink: I executed this: DELETE FROM public.playlistlog; against the mAirlist DB in Postgres. You can use the pgAdmin III to execute the query. All playlist history will be GONE! So first make a back-up! ;D

In local mode, use sqlite3.exe or SQLite Database Browser or similar.

Thanks for the addition Torben! Maybe it’s an option to build in a “delete history” button within the scheduler window? Maybe with a warning before the real delete takes place. Or only deleting the last day or something?

Maybe it's an option to build in a "delete history" button within the scheduler window?

+1

1 Like

I think we need some sort of maintenance window where you can delete the history (all entries older than x days).

Deleting the playback history didn’t really solve the problem as mentioned by Adriaan and others. I have deleted all history older than 6 months and still the same songs appeared in more or less the same order as before. Although I can’t be sure, it appears that mAirlist uses the unique identifier (the number in the database) instead of the playback history to sort the songs. So songs added to the DB on the same day will still be played in more or less the same order after a while.
Actually, deleting a part of the history made things slightly worse.

Me and a friend of mine (who is also using mAirlist), are working on a way to shuffle the songs a little better. I will post a new topic in a few days about this new apoproach and we’ll be looking forward to any comments and suggestions of other members facing the same “problems”.

The scheduler is “stateless”, it does not maintain a particularly ordered list of songs in a folder, so you cannot “shuffle” it. Instead, it uses the existing playlists to find out which songs haven’t been played recently.

What the scheduler does when picking a song from a particular folder:

  • Load list of songs in that folder.
  • Apply title/track/artist separation, calculcating a score/penalty for each song.
  • Only consider the songs with the lowest penalty score.
  • Sort by time last played (extracted from the previous playlists)
  • With a chance of 50%, pick the first song from the list (the one that hasn’t been played for the longest time), with a chance of 25% the second song, with a chance of 12.5% the third song and so on.

So basically, it’s a “rotation”, but you get a little variation each round due to the 50%/25%/… thing.

Enable the debug log in the scheduler dialog, and you’ll see what I mean.

If I remember correctly Torben, you asked in one of the forums to come up with some easy to implement suggestions to tackle this rotation “problem”. We’ve been working on this the last week or so and will post it somewhere this weekend as a new topic. I just have to work on the text a little.

https://www.mairlist.com/forum/index.php?topic=8189.msg55328#msg55328

Torben wrote:

What the scheduler does when picking a song from a particular folder:

  • Load list of songs in that folder.
  • Apply title/track/artist separation, calculcating a score/penalty for each song.
  • Only consider the songs with the lowest penalty score.
  • Sort by time last played (extracted from the previous playlists)
  • With a chance of 50%, pick the first song from the list (the one that hasn’t been played for the longest time), with a chance of 25% the second song, with a chance of 12.5% the third song and so on.

Allright Torben, but if the sequence described above is active, what is the cause songs seems to be picked in the same order? Does the date of entry in the database affects this?