This tutorial will show you how I build my custom [Watched Percent] field, which I use throughout Media Center for display of Watched/Not-Watched Status. It displays it using a combination of checkmarks (for fully watched files) and percentages watched, using custom percentage ranges. Now that we can easily change [Number Plays] (as of MC 19.0.90), it is easy to reset this special Watched status indicator, by simply clearing [Number Plays].
For a discussion of why this logic was used, and how it was built, see this thread:
http://yabb.jriver.com/interact/index.php?topic=85906.0It requires two custom fields: [Bookmark Percent] and [Watched Percent]. They're configured like so:
[Bookmark Percent]This outputs a numeric percentage for any file indicating the percentage "complete" it was last played. Interestingly, this works even for files that don't use automatic bookmarking (Music, for example). The bookmark is ignored, but MC tracks it.
Expression:
PadNumber(Math(round(([Bookmark] / ([Duration, 0] * 1000)) * 100)),2)
You can use whatever you'd like in the Display fields when setting it up. That's what it will be called if you add it as a column, or to Theater View directly. This is mostly for utility, so it doesn't much matter if you won't use it in a column.
[Watched Percent]Outputs either a checkmark, blank, or the percentage watched, depending on the status of [Number Plays] and [Bookmark Percent].
If [Bookmark Percent] is between 10 and 89%, then it outputs the percentage (formatted like "76%").
If [Bookmark Percent] is 90% or more, then it outputs a checkmark.
If [Bookmark Percent] is less than 10%, then
If [Number Plays] is zero, it outputs nothing at all (null text).
If [Number Plays] is greater than zero, it outputs a checkmark.
The last check is because when file has played all the way through, MC will reset the [Bookmark] to zero, and "automatically reset" the bookmark. We still want to mark these as Watched.
Expression:
If(IsRange([Bookmark Percent], 0-9),
If(Compare([Number Plays],<,1),,✔),
If(IsRange([Bookmark Percent], 10-89),[Bookmark Percent]%, ✔))
There is one other, optional, custom calculated field you can make that I also use and find handy. This isn't required or used by the [Watched Percent] expression, but I think it compliments it well.
[Plays]Outputs a nicely formatted version of [Number Plays], including text about the [Last Played] date.
If the file was never played, it outputs "never played'.
If [Last Played] was greater than 1 year ago, then it outputs in the form: [Number Plays] (last [Last Played - Year Only])
If [Last Played] was less than 1 year ago, then it outputs in the form: [Number Plays] (last [Last Played - Short Date])
Expression:
if(isEmpty([Number Plays]), never played, [Number Plays] plays (last if(compare(math(now() - [Last Played, 0]), <, 365), FormatDate([Last Played, 0], MMM dd, unknown)/), FormatDate([Last Played, 0], yyyy, unknown)/)))
Standard View Use:If you set these fields up, you can use them for Columns, which results in:
You can see the different results in that screenshot.
1. Many episodes are watched to 90% or greater, and they're all marked with a checkmark.
2. Episode 11, 12, 16 of Season 3, are each marked with a checkmark, even though their % Complete is low, because they have at least one "Play" (meaning, you've played it through to the 1/2 point at least once, causing MC to count it as a Play).
3. Episode 3 in Season 4 is listed as 40%, because it falls in the "middle percentages" (between 10 - 89).
4. Episodes 7 and 8 of Season 4 have no output at all because I haven't watched them. (Seriously, I
haven't. No spoilers.) Even though Episode 7 has a tiny percentage played (checking the file, introductory commercials, etc), it still outputs blank.
Theater View Use:You can also use it in Theater View's File Info panels. You set it up as such:
And use them in file captions:
Movie Template:Regular Caption:
[Name]Delimit([Watched Percent], , / )
Expanded Caption:
[Name]
ListBuild(1, / • , [Year], [Duration], [MPAA Rating], RatingStars(),[Plays], [Watched Percent])
Search:
[Media Type]=[Video] [Media Sub Type]=[Movie]
TV Shows Template:Regular Caption:
If([AllSameSeries], <font alpha="50">Delimit(TVInfo(SeasonEpisode))<//font>[Name]Delimit(<font alpha="50">[Watched Percent]<//font>, , / ), TVInfo(NameDisplay)Delimit(<font alpha="50">[Watched Percent]<//font>, , / )) <font alpha="50">If([AllSameSeries],,TVInfo(SeasonEpisode)/ )TVInfo(DateNoTime)<//font>
Expanded Caption:
If([AllSameSeries], <font alpha="50">Delimit(TVInfo(SeasonEpisode))<//font>[Name]Delimit(, , / ), TVInfo(NameDisplay))
<font alpha="50">ListBuild(1, / • , If([AllSameSeries],,TVInfo(SeasonEpisode))TVInfo(DateNoTime),[Plays],[Watched Percent])<//font>
Search:
[Media Type]=[Video] [Media Sub Type]=[TV Show]
And it results in: