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

[Feature request] SmartBlocks - make random track with repeats allowed not play the same track twice in a row #326

Open
celianvdb opened this issue Oct 7, 2017 · 7 comments
Labels
is: feature-request smart blocks status: pinned This issue or pull request won't stale

Comments

@celianvdb
Copy link

Hey,
Since a week my webradio is powered by libretime with sound 24/24 7/7 but manage the calendar everyday is long and tedious, we use smart-block to have calm music for morning and more powerfull music afternoon but we often have 2 times ( or more ) the same music or 5-6 musics from the same author and that take lot of time to fix that manually.
Little example :)
capture du 2017-10-07 20-33-30

I think that can be nice to add somme features on smartblock like new conditional statements to be able to add condition like

previous_music.author != music.author
previous_music.title != music.title

Because actually it's tedious to manage a radio using libretime with a correct planning.

Thx in advance ;)

@Robbt
Copy link
Member

Robbt commented Oct 7, 2017

Indeed. The "randomness" of the Smartblock appears to be somewhat lacking in some regards. We have had other people complain that the same random show 1/500 is selected on a regular basis. I'm not sure how to best implement the specific functionality requested here but your feedback is duly noted and it might not be too much work to fix this. Do you already have unchecked allow duplicate tracks ?
Because perhaps that is the issue (or there is an issue with duplicate tracks even when this is not checked).

@celianvdb
Copy link
Author

Allow duplicate tracks is checked because i don't have a lot of sound ATM to do 24h of calendar and i want to allow my smart block to have the same music 2 time but not one after the other.

@Robbt
Copy link
Member

Robbt commented Oct 23, 2017

This is from the forum, but I performed a randomness test with the help of my astrophysicist wife and from everything we can tell the algorithm is pretty random. The issue is most likely with human perception of randomness. Here is a piece that squiggleUK linked too https://labs.spotify.com/2014/02/28/how-to-shuffle-songs/ that explains a good approach we could take in terms of avoiding repeats.

@celianvdb
Copy link
Author

I would be happy to code it but i don't understand the code of the smartblock part, it's extremely complicated for a simple feature. Actually, make the show of the day take more than 30min for my radio, so if someone is motivated to explain me how the actual code work for smart block or can code it, it would be a big help for us!

@Robbt
Copy link
Member

Robbt commented Nov 11, 2017

Yeah, the smartblock code is a little confusing. I planned on writing up a wiki page explaining how it works. Having a far grasp of this based upon trying to trace through it, the challenge in coding this is that the algorithm doesn't keep track of the previous state when its pulling in files. So it could be simple to just add this in and say check to make sure that it wasn't the same as the last file but what if we wanted to check to make sure it wasn't scheduled in the last 3 items. I'll try to look at the code and point out where this code is actually at when I get a chance.

@Robbt Robbt changed the title [Feature request] SmartBlocks, add more possibility [Feature request] SmartBlocks - make random track with repeats allowed not play the same track twice in a row Dec 4, 2018
@Robbt
Copy link
Member

Robbt commented Dec 4, 2018

So in summary the core idea here is that we want to improve the way the randomness is perceived as random by preventing it from repeating the same track in a row. This might be easy enough to accomplish by modifying this code that is ran a smartblock has ran out of tracks and still hasn't met its limit. If the checkbox that allows repeats is turned on then I think it just starts randomly inserting tracks throughout the list.

https://github.com/LibreTime/libretime/blob/29266b0c0d8ba2f31f6a0ba654719c757bd5735c/airtime_mvc/application/models/Block.php#L1357-L1370

This could be modified to prevent it from insert the same track to play twice in a row, as long as there are more than a few different tracks.

@stale
Copy link

stale bot commented Oct 20, 2019

This issue has been automatically marked as stale because it has not had activity in the last 5 months. It will be closed if no activity occurs in the next month.
Please chat to us on discourse or ask for help on our chat if you have any questions or need further support with getting this issue resolved.
You may also label an issue as pinned if you would like to make sure that it does not get closed by this bot.

@stale stale bot added the status: stalled This issue or pull request is stalled label Oct 20, 2019
@stale stale bot removed the status: stalled This issue or pull request is stalled label Oct 20, 2019
@jooola jooola added status: pinned This issue or pull request won't stale and removed pinned labels Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is: feature-request smart blocks status: pinned This issue or pull request won't stale
Projects
None yet
Development

No branches or pull requests

4 participants