Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

ADD: "last played" sort option to TV Show GUI #1660

Merged
merged 1 commit into from

5 participants

@koying
Collaborator

No description provided.

@Fneufneu
Collaborator

Cool feature, why it's only for tv show ? can be usefull for movies to.

@koying
Collaborator

@jmarshallnz Could you have a look, please.
I don't think adding this sort option to movies makes a lot of sense...

@jmarshallnz
Owner

Code looks good to me. Only question is if it should be applied to other cases. Does lastplayed get updated when something is only half watched?

@koying
Collaborator

Re cases, I don't see a use case for movies or episodes. Might be interesting for artists/albums, maybe?
Re updated, lastplayed is based on playcount, IIRC.
@Montellese could probably tell when a file is considered as "played".

@Montellese
Owner

IIRC lastplayed is not updated when a video is not finished i.e. if lastplayed is updated, playcount is updated as well.

@koying
Collaborator

It's the other way around, I think. lastplayed is based upon playcount. JM's question is when is the playcount updated...

@Montellese
Owner

Nope you can have a playcount of 0 (by marking a video as unwatched) but you can still have a lastplayed value so that statement is not correct.

@koying
Collaborator

My mistake. I mixed up things.
Am I right assuming the lastplayed field is updated at the same time as playcount is set to 1?

@MartijnKaijser

Even if you haven't finished it so playcount stays zero but last played time is still updated.

@koying
Collaborator

OK. So answer to @jmarshallnz is: It is updated as soon as playback starts ;)

@MartijnKaijser

Or on stops. Not sure (tm)

@jmarshallnz
Owner

Righto - merge at your leisure then.

@koying koying merged commit c9accb2 into xbmc:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 23, 2012
  1. @koying
This page is out of date. Refresh to see the latest.
View
7 xbmc/utils/LabelFormatter.cpp
@@ -95,9 +95,10 @@ using namespace MUSIC_INFO;
* %Y - Year
* %Z - tvshow title
* %a - Date Added
+ * %p - Last Played
*/
-#define MASK_CHARS "NSATBGYFLDIJRCKMEPHZOQUVXWa"
+#define MASK_CHARS "NSATBGYFLDIJRCKMEPHZOQUVXWap"
CLabelFormatter::CLabelFormatter(const CStdString &mask, const CStdString &mask2)
{
@@ -312,6 +313,10 @@ CStdString CLabelFormatter::GetMaskContent(const CMaskString &mask, const CFileI
if (movie && movie->m_dateAdded.IsValid())
value = movie->m_dateAdded.GetAsLocalizedDate();
break;
+ case 'p': // Last played
+ if (movie && movie->m_lastPlayed.IsValid())
+ value = movie->m_lastPlayed.GetAsLocalizedDate();
+ break;
}
if (!value.IsEmpty())
return mask.m_prefix + value + mask.m_postfix;
View
1  xbmc/video/GUIViewStateVideo.cpp
@@ -168,6 +168,7 @@ CGUIViewStateWindowVideoNav::CGUIViewStateWindowVideoNav(const CFileItemList& it
AddSortMethod(SORT_METHOD_VIDEO_SORT_TITLE, 551, LABEL_MASKS("%T", "%M", "%T", "%M")); // Title, #Episodes | Title, #Episodes
AddSortMethod(SORT_METHOD_EPISODE, 20360, LABEL_MASKS("%L", "%M", "%L", "%M")); // Label, #Episodes | Label, #Episodes
+ AddSortMethod(SORT_METHOD_LASTPLAYED, 568, LABEL_MASKS("%T", "%p", "%T", "%p")); // Title, #Last played | Title, #Last played
AddSortMethod(SORT_METHOD_YEAR, 562, LABEL_MASKS("%L","%Y","%L","%Y")); // Label, Year | Label, Year
SetSortMethod(SORT_METHOD_LABEL);
Something went wrong with that request. Please try again.