More > JRiver Media Center 21 for Mac

How to create a Pane Category to group by Date Imported

<< < (4/6) > >>

marko:
This month, last month, this year, last year are relatively easy...

This week and last week though, all depend upon how you're wired. I'm going to assume the week starts on a Monday.

This has been a little interesting. Up til now, I've settled for MC's fuzzy results once the time span went to weeks, as "=<7d" was just easier.
Months have to take into account that, "01-1=12" and so on.

I'm almost done for you, can anyone tell me...
Am I correct in thinking that MACs cannot handle MC .jvi saved view files? I sincerely hope I am wrong to think that....

marko:
.... though I'm reasonably sure I'm not, so...

Here's what I have after a little playing around...

Today

--- Code: ---[=isequal(formatdate([Date Imported,0],dd//MM//yyyy),formatdate(now(),dd//MM//yyyy),8)]=1
--- End code ---

Yesterday

--- Code: ---[=isequal(formatdate([Date Imported,0],dd//MM//yyyy),formatdate(math(now()-1),dd//MM//yyyy),8)]=1
--- End code ---

This Week

--- Code: ---[=isequal(if(isequal(formatdate([Date Imported,0],%W),00),formatdate(math([Date Imported,0]-formatdate([Date Imported,0],dd)),yyyy%W),formatdate([Date Imported,0],yyyy%W)),if(isequal(formatdate(now(),%W),00),formatdate(math(now()-formatdate(now(),dd)),yyyy%W),formatdate(now(),yyyy%W)))]=1
--- End code ---

Last Week

--- Code: ---[=isequal(if(isequal(formatdate([date imported,0],%W),00),formatdate(math([date imported,0]-formatdate([date imported,0],dd)),yyyy%W),formatdate([date imported,0],yyyy%W)),ifelse(isequal(formatdate(now(),%W),00),math(formatdate(math(now()-formatdate(now(),dd)),yyyy%W)-1),isequal(math(formatdate(now(),%W)-1),0),formatdate(math(now()-formatdate(now(),dd)),yyyy%W),1,math(formatdate(now(),yyyy%W)-1)))]=1
--- End code ---

This Month

--- Code: ---[=isequal(formatdate([Date Imported,0],MM//yyyy),formatdate(now(),MM//yyyy),8)]=1
--- End code ---

Last Month

--- Code: ---[=isequal(formatdate([Date Imported,0],MM//yyyy),if(isequal(formatdate(now(),MM),01),12,padnumber(math(formatdate(now(),MM)-1),2))//if(isequal(formatdate(now(),MM),01),math(formatdate(now(),yyyy)-1),formatdate(now(),yyyy)),8)]=1
--- End code ---

This Year

--- Code: ---[=isequal(formatdate([Date Imported,0],yyyy),formatdate(now(),yyyy),8)]=1
--- End code ---

Last Year

--- Code: ---[=isequal(formatdate([Date Imported,0],yyyy),math(formatdate(now(),yyyy)-1),8)]=1
--- End code ---

It dawned on me that we can completely side-step the whole locale issue by formatting the library field too, so these should all work 'as-is', regardless of where you are.
I think there may be an issue with week numbers. I'm waiting for some feedback on this elsewhere, but for now, where week 52 or 53 spans into the new year, the new year part of the week is given week number zero. I've skirted around this for the moment by forcing "Last Week" to use week 52 if it is zero or one. This does mean that a few "Week 53's" might get lost in the listings, I'll update if I hear back on this issue. Like wise, for "This Week", it will match on week zero, missing the beginning of the week that was actually in last year.

These are for the OCD MC users amongst us. By default, the quick and easy way to do these is not as precise. 'The last week' is actually the last seven days, 'today' is actually the past 24 hours, and so on, these however, do what they say on the tin, with the small exception outlined in the "Week" searches above.
You can edit them to work with other date fields. These all use [Date Imported,0]. Switch those to [Last Played,0] to get a neat play stats view, for example.

Enjoy, give them a bash, let me know if any mistakes slipped through, or if you know of a more streamlined way to reach these target lists, please share.

-marko

blgentry:

--- Quote from: marko on January 02, 2016, 04:15:13 am ---I'm almost done for you, can anyone tell me...
Am I correct in thinking that MACs cannot handle MC .jvi saved view files? I sincerely hope I am wrong to think that....

--- End quote ---

JVI saved views work just fine on Macs.  I've shared one or two with Windows users and they import/export correctly.

Brian.

marko:
Ahhh, nice one, thanks Brian.

I've updated the string for "Last Week" above. It now takes care of all instances of "Week Zero", returning the full week that spans the old and the new year, and should work as given, regardless of locale.

I'll get 'this week' sorted very soon. That shouldn't be as much of a headache as last week was.

-marko

marko:

--- Quote from: blgentry on January 02, 2016, 08:15:28 am ---JVI saved views work just fine on Macs.  I've shared one or two with Windows users and they import/export correctly.

Brian.

--- End quote ---
The attched zip file contains two saved views based on the strings posted above. One for import stats and one for last played stats. Hopefully they'll work for all, let me know if anything isn't working.

Instructions
Download the attached zip file.
On Windows, extract the contents to: "C:\Users\[user name]\AppData\Roaming\J River\Media Center 21\Library\Saved Views"
If the saved views folder is not there, create it.

Can someone advise where these go on a MAC?

Once in place, go to MC, from the top menu choose "View > Add View > Add Library View" and use the view picker to add the views.

Enjoy.

marko.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version