Libretime: Tracks repeating in 24 hour smartblock w/ allow duplicates turned off - was (Auto DJ and Rotations)

Created on 7 Jun 2017  路  27Comments  路  Source: LibreTime/libretime

Please mark this as feature-request if you cosider it is.

My radio was designed in mind that there will be AutoDJ function and shows will be runing as exclusive content.
I have hand selected tracks for radio and wanted LT to play it in random mode without repetition of last 100 (for example) infinit. When show is scheduled, track of autodj is curently playing ends and show get started.

When show ends it get back to the random song of infinit autoDJ.
I think this can be done with hacks of ls_script.

But is this possible to merge to UI from https://blog.sourcefabric.org/en/news/blog/3438/Introducing-Rotations-and-Auto-DJ.htm
SaaS into LT ?

the only "hand made" solution i found is https://forum.sourcefabric.org/discussion/18336/autodj-script-using-php-2-1-5-6-solution-you-were-waiting-on-no-ls_script-modification-need

but its to hard for me to integrate

bug stale

All 27 comments

But is this possible to merge to UI from https://blog.sourcefabric.org/en/news/blog/3438/Introducing-Rotations-and-Auto-DJ.htm
SaaS into LT ?

The SaaS autodj is not opensource. Legacy upstream never put the code on GitHub so it isn't available to merge.

LibreTime has a "Auto Playlist" feature. In combination with some smart blocks you may be able to do something similar to what you described. See https://github.com/LibreTime/libretime/issues/195#issuecomment-298950460 for how the auto playlist is intended to work. It probably won't cover all your needs but it's certainly a step in the right direction.

Well we currently have the AutoPlaylist functionality which can be used to accomplish the same thing as the rotations task, but it's currently poorly documented so I have to manually explain how it works until I get back in the right mindset to actually finish the interface and add some proper documentation to our wiki.

Basically to accomplish this you can create a SmartBlock with the criteria of whatever type/genre/whatever of tracks you want to AutoDJ with. You can limit it to 1 item or time limited. If you are just using it to fill in empty space then 1 item will work fine (combined with the next steps)

Next create a playlist that contains this smartblock as the only item.

Finally for any show you want to use this AutoDJ functionality on go to the show click the check box next to automatic playlist and select this playlist.

Also check repeat until show is full. This will continue to add until the show is overbooked and thus eliminate dead-air.

Now I went this way as opposed to the Rotations because it was more flexible in terms of how it can be deployed because the AutoDJ functionality provided by Airtime.pro didn't allow one to structure the format of the random tracks and could only accomplish the above task. Whereas with the automatic playlist you can combine multiple smart blocks to build a rotation of music vs. station IDs or play the latest track from a certain podcast etc. But in making it more flexible I also made it a lot harder to grasp and w/o the documentation to explain how to do this it is less useful.

The one option that I don't have in here (with the individual track selection) that you referenced is avoid repeats. This could be accomplished though on a per smartblock basis but would require longer smartblocks that were time limited etc.

Guys! one more time I want to thank you for this project!)
I also have addition to this thoughts. It would be great to make a prioritise of tracks that been played less than others. example: I have a smart block with genre and subgenre, and some tracks plays more often than others. I understand that it generates randomly. But i think it would be great if they generated randomly and after make a sorting songs by tracks that not been played last time in this smart block (have less count of plays).
I don't know exactly how to realise it, but I think it have to work this way:
1) create in DB (or if it is already exist) a tab with counting playing tracks.
2) before creating smart block, make a sorting of tracks, with less playing counts on the first place etc.
So every time when smart block will generate unique playlist without repeatings.
And make a reset of playing counts in DB every week or month. It should be made for new tracks been uploaded.
I'm not sure if i described idea, if not sorry for my poor english.))

@Robbt 'Next create a playlist that contains this smartblock as the only item.' .. 'Also check repeat until show is full. This will continue to add until the show is overbooked and thus eliminate dead-air.'
Will this not mean you could get repeating tracks in the same show?

@korotkov13 Indeed, one feature I was working on was the ability to put in relative dates into a smartblock so you could include criteria like not played within x hours. But this isn't the same as a smart selection algorithm that is random but attempts to balance itself. That isn't as easy because it is essentially something different from the simple boolean criteria that selects this.

@Robby262 Yeah. I realized this and thats what I meant at the bottom of my list. In reality if you want to avoid repeating tracks you need to have a single smartblock per show (where you want to avoid repeating tracks) and it will avoid repeating tracks unless you override it. This is one of the limitations of the current framework.

I am cheating and using the old AT LS script hack for AutoDJ

I am cheating and using the old AT LS script hack for AutoDJ

This reminds me that we talked about making similar hacks trivial in #194. In fact I created #229 so I remember to look into this soonish.

This might help. JohnnyC's solution, that we are using on quite a few sites now, has a twist.
It gets the Show Genre (if any). In our situation (talk shows) we might have genres such as Myths, Science, Ecology. So we read the show genre (I don't understand the code. Personally, I think it's witchcraft) when it goes to silence it pick tracks/rounds of a matching genre. So for Myths it would fill with Celtic music & suitable jingles. Thus, we have context sensitive 'Emergency music with jingles' matched to current show genre. If it can't find one, we have a generic setup. I guess you could so similar with a 'Smart Fallback Block'.

Smart Blocks does't allow me to create full AutoDJ station. Couse of the limitations:

  1. I have to re-schedule it over and over, its not full auto station
  2. i have to remake smart blocks if i add new tracks to library

@aresstokrat
You need to use the AutoPlaylist function inside of the Show when you edit the Show on the calendar. This will build the smart block an hour before your show airs.

This will create new smart block instances each time if it is a dynamic smart block vs. a static smartblock.

Yes, I have it working great here :)

  1. Created a Smart Block dynamic, with condition
    Track number greater then 0 (so it could be generated from any tracks of the library without limitations)
    sort track: randomly
    limit to: 24 h (to fill all-day)

  2. Creating playlist which contains this dynamic Smart Block , duration of playlist 24h, naming it
    '24h test'

  3. Creating a show, with:
    Automatic Playlist - check
    Select Playlist - '24h test'
    Start time 00:00 end time 23:59
    Repeat : weekly
    and check mark every day

Creating show.

Now we have instance for every day. And all of them marked with "!" red, the show has no schedule content. I have to enter in every instance and put dynamic Smart Block again.
(so playlist with dynamic Smart Block does't work?)

What im doing wrong?

Ok, so your point, highlights things that need to be done.
The tracks in an autoplaylist aren't scheduled until an hour before they are supposed to air, until this happens the red ! remains until this happens.
I should code something that shows that a autoplaylist is pending ie a different color.
In theory your show should work, but it would only work if you created it before it is supposed to air.
If you just leave it running and unscheduled in theory it should schedule the hour before the new 24 hour period is set to start.

What you did is correct and it will work - ignore the exclamation marks and empty looking shows - they will fill up an hour before the show starts.
TOP TIP: Do NOT 'Link' these shows! Or you will get all the shows with the same content or frozen at schedule time.

Its alive!
i have some q:
one instance ends 23:59 and another starts at 00:00
23:59 includes last minute or there will be 1 min of silence?

it will cut last song before going to another instance or how it will transact from 1 instance to another?

Today i found very strange behavior of new auto-created instances.

To many repeated tracks! Sometimes 1 track goes twice.
Sometimes its like:
1-2-3-4-5 then again this 1-2-3-4-5 same tracks.

Something wrong. Why that might be? https://github.com/LibreTime/libretime/issues/224#issuecomment-308410202
configured "randomly"

Ok, well the randomness is determined by PostgreSQL I think via the SmartBlock.
Do you have many repeating smartblocks ? If you have a single SmartBlock there is an option to avoid duplicate tracks. There is currently no way to coordinate multiple smartblocks to avoid repeats between them.

I have only 1 Smart Block per 1 day, but it lasts 24h.

By avoid duplication tracks option you mean "Allow Repeated" ?

  • its unchecked by default.
    And i left it unchecked.

Still repeated tracks is a big problem.

Hmm, ok, this is unexpected behavior. How many tracks does your library contain overall ? And how many tracks in general are scheduled throughout the 24 hour day ? Does it repeat only several times throughout the day or is it quite frequently.

i have some q:
one instance ends 23:59 and another starts at 00:00
23:59 includes last minute or there will be 1 min of silence?

it will cut last song before going to another instance or how it will transact from 1 instance to another?

Was there a solution to this problem? I tried to set up multiple shows so that I don't exceed the 24 hours limit and at midnight I schedule 0:00 the following date.
I would not call it a bug, but I think this will cause misunderstanding.
How about setting up the button to "24H"?

The solution to this in general is to do 00:00 of the next day and not leave 23:59. Now as far as improvements to the UI what you are suggesting sounds like it might make sense but I'd need to see a mockup and/or description of the problem its trying to solve to visualize it better.

Summer to wintertime screwed up royally with a show crossing midnight. Yes it did. Bug Reported but ignored..

The solution to this, in general, is to do 00:00 of the next day and not leave 23:59. Now as far as improvements to the UI what you are suggesting sounds like it might make sense but I'd need to see a mockup and/or description of the problem its trying to solve to visualize it better.

I guess it would make no sense to change the date and time picker tool and add and end day button there. So maybe even simpler approach would be to let the UI accept seconds, so we could at least set it to something like 23:59:59 (maybe even .9999999 like the settings in the cue points).
So I would suggest setting a checkbox that when set opens up the entry field to be filled in by hand and accept it like that. Or set the value fixed as 23:59:59.99999 when checked. So that would not screw up all that was made so far, but in case it is needed could be used. I mean the only use case is exactly the end between days. And for that reason, it would be enough to document the feature with a mouse hover, so that the user exactly knows when to hit the checkmark and enter data by hand.

It would also make sense because I see the shows which are overlapping to 0:00 the next day marked with a red exclamation mark in the calendar. it's always the first show and the last show shown in the view. I guess it because it goes to the next page.

So as for mockup:
add one line under End time
add hover info icon "If you need to enter the exact end time, check the following checkbox to enter the time manually. This is used to set the exact end time, only at the end of the day."
Checkbox
Entryfield (maybe even prefilled with 23:59:59.99999 when checked)

Checkbox active should stop the time picker above from working.

So that would be my user-oriented approach.
What do you think?

i have some q:
one instance ends 23:59 and another starts at 00:00
23:59 includes last minute or there will be 1 min of silence?
it will cut last song before going to another instance or how it will transact from 1 instance to another?

Was there a solution to this problem? I tried to set up multiple shows so that I don't exceed the 24 hours limit and at midnight I schedule 0:00 the following date.
I would not call it a bug, but I think this will cause misunderstanding.
How about setting up the button to "24H"?

maybe there is a way to integrate an automated fading out when the time is from 23:59:40 till 00:00 at the end of the playlist/smart-block?

Cool, I think these ideas sounds reasonable, I'm not sure how easy it would be to make the modification to the existing framework/UI. Can you open up a separate feature request with this information as this is somewhat off topic to the original problem here (relating to smartblocks repeating) and that way we can spend more time thinking specifically about how this could work.

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.

This issue has been autmatically closed after is was marked as stale and did not receive any further inputs.
Feel free to let us know on discourse or ask for help on our chat if you feel this issue should not have been closed.
Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings