Skip to main content
Topic: Using today's date in auto-playlist (Read 175 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Using today's date in auto-playlist

I've been tagging my %date% fields with YYYY-MM-DD for a while now, and realized that it'd be fun to create an "On this Date" auto-playlist that shows albums released on today's date. I was thinking about using the BEFORE and AFTER expressions and specifying 364 DAYS and 365 DAYS, but then I'd need to do something for every year which is not ideal.

Is there a way to accomplish this without writing a custom component just to return %todays_date%? Does such a component already exist?

Re: Using today's date in auto-playlist

Reply #1
I've been searching for a $now() type function but apparently this doesn't exist for foobar2000 at least for the current version, in the past there was something to work with using foo_cwb_hooks if I'm not mistaken.

I use foo_exvar to set an external variable which I set to today's date each new day. Sure, it's not automatic and you can't use it everywhere but it's better than nothing.

Re: Using today's date in auto-playlist

Reply #2
Yirkha solved the $now() issue with regard to playback statistics. But the problem is the %date% format (YYYY-MM-DD) is not the same as UTC so calcs can't be done as they can with say %added% or %last_played%.

With foo_dynfil (dynamic fields) you can do: $date_diff(%added%) and that will give you the number of days between now and when the file was added to the library according to foo_playcount.

foo_dynfil allows for things like: $day_of_month(%now%) and $time(%now%) and other handy stuff too.
See: https://hydrogenaud.io/index.php/topic,86853.msg744320.html#msg744320

C.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

 
SimplePortal 1.0.0 RC1 © 2008-2018