2012-02-17, 17:25
`Black Wrote:Don't think that it's that easy... you can't (I think) make a smart playlist which acts exactly like the watch list does.
@Hitcher
Ok I get what you mean... the problem is that the script can't know if you really want to have that episode on top or not. This can't be decided simply by date added or so... it would need a more complicated calculation and I'm afraid there aren't enough values for this, especially a personal show rating or priority.
I can tell you that you can't make a smart playlist to replicated it. I tried. I also used an outside script to do the SQL queries and generate a playlist based off of the results. That, too, does not handle changes well.
Unless smart playlists get a "lowest unwatched" property for episodes. The complication here is that smart playlists work at a show level or an episode level. Here we need a good deal of both.
The other alternative is to make filtering out watched episodes something that could be put in a playlist for shows. If we could get lastPlayed for shows and have a filter for "hide watched" we could end up with a more DVR view of the watchlist.
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="shows">
<name>pseudowatchlist</name>
<match>all</match>
<rule field="lastplayed" operator="inthelast">6 weeks</rule>
<order direction="descending">lastplayed</order>
</smartplaylist>
This would use lastplayed at the show level as the max(lastPlayed) from the episodeview. In my mind, this would return a list of shows and tell a good skin to hide watched episodes when we got there.
Watchlist is very good at what it does: provide a list of episodes to watch. But with the two changes outlined here, a lot of the same functionality could be used in a smart playlist, resulting in a list of shows with new (unwatched) episodes listed in the order in which you most recently watched the show. Drilling into a show would show you all the episodes there for that show that remain unwatched. This is much more similar to how a DVR would list the shows:
With lastaired and lastplayed as the maximum values for all episodes under a show added to smart playlists at the show level, a lot of things open up. If you additionally add the ability to hide or show watched items at any level other than globally (either through the smart playlist or letting each view store that separately), you can do a lot more. Having this in the playlist support would allow more intelligent filtering though, because you could limit the number of shows pulled. Having it outside the playlist would, in essence, not honor the limit because the playlist could pull 25, 20 of which might have no unwatched shows. So we really need an additional show-level field for smart playlists to indicate if any episodes are unwatched (unwatched episodes, perhaps?).
PS I forgot to add an explanation on the semi-automatic way to generate a smart playlist for this. I run the queries through mysql, use sed to generate a playlist file from that and update the playlist file hourly. This obviously does not catch events and is rather clunky. But I built that all out before reading about the watchlist script.