INTERACT FORUM
More => Old Versions => JRiver Media Center 18 for Windows => Topic started by: DaveMan538 on December 07, 2012, 10:24:10 pm
-
I've been working on tagging music with the complete date (mm/dd/yyyy instead of just yyyy) and I'd like to create a View that consists of songs that have a date of <today> from any year. I found enough info in the wiki to create custom fields for <today's day> and <current month> but I have not been able to build an expression that will allow me to pull the items that match today's Day and Month.
Any help would be appreciated. Thanks! ;D
-
Here's one way:
ifelse(
!Regex([Date], /#^(\d+)/(\d+)/(\d+)#/),
Year-only date,
Compare([R2], =, formatdate(now(), d)),
Matched [R2],
1,
No match
)
This matches against a full date in the format of mm/dd/yyyy, and grabs the day portion. if there is not a full date, Year-only date is output. With the day portion inside [R2], it is compared against the day portion of Now(), and the match is output; otherwise, No match is output.
To use as a custom rule in a smartlist or file rules area:
[=Compare(Regex([Date], /#^(\d+)/(\d+)/(\d+)#/, 2), =, formatdate(now(), d))]=1
-
Thanks so much, MrC!!! ;D ;D ;D
It does work for the day only. That's cool because this returns more results. Is there a way to add the Month comparison to that? So that it would return all songs from "December 9th" as opposed to the 9th of any month?
-
Sure, here you go:
ifelse(
!Regex([Date], /#^(\d+)/(\d+)/(\d+)#/),
Year-only date,
isequal([R1]:[R2], formatdate(now(), M:d)),
Matched [R1]:[R2],
1,
No match
)
or as a query (for Set rules for file display):
[=isequal(Regex([Date], /#^(\d+)/(\d+)/(\d+)#/, 1):[R2], formatdate(now(), M:d))]=1
-
MrC, you sir, are a man among men. That's just cool as dirt! Thanks again!
The other cool thing, is being able to run the same expression against any media type. Great for home movies and photos as well!!
-
MrC, you sir, are a man among men.
My wife says "But that's ten itty-bitty men", so I'll take what I can get.