"Last played" value for new "unplayed" tracks

Hi, I’m trying to create a block that only plays tracks played more than 5 hours ago.

My doubt is how are new tracks taken into consideration by filters using the “last played” value. New tracks don’t show a value in that column.

Are new tracks without a “last played” value considered as valid for such a block? I believe they are since tracks do get loaded at some point and get a “last played” value.

However when I do some tests the new tracks don´t show as “matched” in the preview. And they don´t show in the results no matter what modifier I set for the Last Played.

I enclose some screenshots. Here I have 3 tracks matching a condition. 1 of them has just been uploaded and never played. When I add a “last played” time condition the new track doesnt show up! for either “before” or “after” modifier.



I had the same issue when I first set up Libretime. I made a change to the field in the database so that the default datetime is in the past. Like this:

psql -h localhost -U airtime -W
ALTER TABLE cc_files ALTER COLUMN lptime SET DEFAULT ‘1999-01-01 00:00:00’;

So newly uploaded tracks have a last-played time of ‘1999-01-01 00:00:00’.

The smartblocks then work properly.

Hope this helps

:sweat_smile: thanks for the hint! clever :smiley:
And shouldn´t this solution be added as default for new installs?

I still not get how do the new tracks start being played if the condition in the blocks doesn´t accept tracks whithout a time stamp…

maybe you could open a pull request? :slight_smile:

I’ve opened a “feature request”:

Did you upgrade Libretime since you made that change?
If so, what happened with the DB? did you have any problems when applying the db’s migrations?
Did you have to change again the “lptime” value?

I’ve made quite a lot of customisations so I have a big document with all the details of my tweaks in so when I upgrade I can recreate the changes :slight_smile:

So when you upgrade you have to set the default value again?

the feature request was completed!! thanks a lot guys! :smiley: