There are probably ways to work around this otherwise, but I think I came up with a clever way, and figured I'd pass it along.
[Played Ever] FieldFirst, you'll need a custom field that allows you to distinguish between tracks that have been Played before and those that have not, and which can be sorted "normally" instead of via MC's regular "empty strings last" behavior. I called mine [Played Ever] but you can call it what you'd like. To create a new field, open the
Manage Library Fields editor under
Tools > Options > Library & Folders > Manage Library Fields.
1. Click the Add New Field button to add a new custom field.
2. Type in the name you chose and click OK to create the field.
Next, modify the Data section.
Change the Field Data Type to
Calculated Data, and enter the following expression in the box:
If(IsEmpty([Number Plays]),0,If(IsEmpty([Last Played,0]),1,2))
Click to embiggenThis will output:
0 - If [Number Plays] is equal to zero.
1 - If [Number Plays] is greater than zero, but [Last Played] is empty.
2 - If [Number Plays] is greater than zero and [Last Played] is not empty
I did this because when testing the system on my own system, I had a number of tracks that fell into the "middle category". These were files that had a non-zero count of plays, but no record of when the last play had taken place (meaning, [Last Played] listed "never played" in the view). I think this is a side effect of syncing data between iTunes and MC, or perhaps from very old upgrades of MC that changed the database format. From my data set, it seems like most of them that fell in this category hadn't been played in a very long time, but certainly not "never". I wanted to be able to distinguish between these types.
Data Types and Calculated Fields in the Manage Library Fields DialogAlso, a note about the way the Data Type setup works in MC. The default settings are User Data with the following settings:
Data Type: String
Relational: Not relational
Edit Type: Standard
When you switch to
Calculated Data type instead of
User Data, the User Data section greys out. This probably shouldn't actually happen because the settings in User Data do still apply to the calculated field.
In this example, we
want the field to be a String Type field (so that zero isn't counted as blank). However, it is worth mentioning because you can use it to change the way Calculated fields behave and appear when displayed. If you wanted this field to show in a column with checkmarks, you can do this, but you have to "trick" the dialog a little.
When you set the settings under User Data, they aren't applied until you click OK to close the dialog. If when you close the dialog, you've selected Calculated Data as the field type, then any changes you've made to those settings are not saved and are discarded (they go back to the defaults listed above). However, it
will remember them if you do a little trick:
1. Open the field up and set it to User Data type. This grays out and disables,
but does not delete, any expression currently entered into the Calculated data expression box.
2. Set the settings in Data Type, Relational, Edit Type, and Acceptable Values as you see fit (the most useful of these to change is the Edit Type).
3. Close the dialog by hitting OK. This "saves" those settings.
4. Open the Manage Library Fields dialog back up, and pick your field again.
5. Switch it back to a Calculated Data type field, and your expression will be "re-activated".
That's how you can make an Expression-type field display in MC with a checkbox (or Rating Stars or any of the other Edit Types). You
must close the Manage Library Fields dialog between steps 2 and 4, however, or the changes you make to the Edit Type or other options will not be saved.
Making The SmartlistLastly, now that we have a sortable field that will tell us if a file has ever been played or not, we need to use it in a Smartlist. This is pretty straightforward now, and you can do it using the normal
Smartlist Editor. Here is mine:
If you want to just import mine, this is the code to use:
[Media Type]=[Audio] [Media Sub Type]=[],[Music] [Last Played]=>1d ~sort=[Played Ever],[Number Plays],[Last Played],[Date Imported],[Filename]
This Smartlist results in just what was described at the outset (with a little bonus if you have any of those "previously played but we don't know when" tracks):
* Shows all music tracks that weren't played within the last day.
* Tracks where [Number Plays] is zero sort to the top.
* Tracks where [Number Plays] is non-zero, but [Last Played] is empty sort next.
* Tracks where [Number Plays] is non-zero and [Last Played] is non-empty sort last, in order, with the least-most-recently-played tracks at the top of the "section" of the list.
And, within each of those "sections", if everything else is identical:
* The oldest tracks (those imported long ago) sort to the top.
* Where tracks were imported at the same exact time, the sort order is by Filename.
Those last two items are useful because otherwise MC's default behavior is to randomize the sort order. This prevents this for tracks that otherwise "match" in all other ways.