INTERACT FORUM

More => Old Versions => JRiver Media Center 21 for Windows => Topic started by: Ferdi on April 10, 2016, 09:47:55 pm

Title: Expression to Calculate: Days since Imported (for playlist)
Post by: Ferdi on April 10, 2016, 09:47:55 pm
I'd like to have a playlist that shows me music that I have imported during the last x number of days.

An expression could be "today minus date imported greater than x",  and i found out that these components could be used:

I fail to turn that into a correct expression though, don't know how to subtract, which I thought would be the most simple part of this!

Appreciate any help. cheers.
Title: Re: Expression to Calculate: Days since Imported (for playlist)
Post by: ferday on April 10, 2016, 09:58:59 pm
if you use convertdate() it will turn a readable date into the computerized big number, but then you should be able to do a simple math

math(convertdate(now())-convertdate([date(imported)]))

or something close to that, no chance to test ATM
Title: Re: Expression to Calculate: Days since Imported (for playlist)
Post by: Ferdi on April 10, 2016, 10:25:06 pm
Thanks for the super quick reply!
I needed to slightly modify to: Math(now() - ConvertDate([Date Imported])). 
When using this as a new field and displaying this field, I noticed that the value is updated almost constantly. Reason is that 'now' goes by seconds...

So next I tried to format that output into 'days', and actually saw that for the for the formula formatdate, this example is given: FormatDate([Date Imported, 0], elapsed) .
Pretty nifty. I'll start playing around with this, as it's not perfect either when used in a playlist, since the values are now hard to compare.

Anyway, I now got two ideas that I can play with, will keep me busy for a while I think :)
Title: Re: Expression to Calculate: Days since Imported (for playlist)
Post by: ferday on April 10, 2016, 10:47:25 pm
in a smartlist you can also use

[date (imported)]=<Xd

as a search string (X is the number)
Title: Re: Expression to Calculate: Days since Imported (for playlist)
Post by: marko on April 11, 2016, 12:14:46 am
Might be something here you could find useful too..

http://yabb.jriver.com/interact/index.php?topic=102319.msg709847#msg709847
Title: Re: Expression to Calculate: Days since Imported (for playlist)
Post by: Ferdi on April 12, 2016, 12:33:14 am
Thanks - that's brilliant information on there. Looking forward to free time on the weekend :)