Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

adds support for inprogress in shows #1349

Merged
merged 5 commits into from

3 participants

@jmarshallnz
Owner

kicks in if watchedcount > 0 and watchedcount < totalCounts.

For Keith.

xbmc/playlists/SmartPlayList.cpp
@@ -725,6 +726,11 @@ CStdString CSmartPlaylistRule::GetWhereClause(const CDatabase &db, const CStdStr
if (m_field == FieldInProgress)
return "episodeview.idFile " + negate + " IN (select idFile from bookmark where type = 1)";
}
+ else if (strType == "tvshows")
+ {
+ if (m_field == FieldInProgress)
+ return "tvshowview.idShow" + negate + " IN (select idShow from tvshowview where watchedcount > 0 AND watchedcount < totalCount)";
@Montellese Owner

I'd prefer using GetField(m_field, strType) instead of a fixed "tvshowview.idShow" in the SQL. That makes it more in line with all the other field accesses (except all the *.idFile ones).

@jmarshallnz Owner

Good idea. Not sure if it can be done without using the idShow at all, i.e. returning something like

negate + "(watchedcount > 0 AND watchedcount < totalCounts)";

@Montellese Owner

It's only about the "tvshowview.idShow" and not about the idShow in the sub-SELECT. If we wouldn't wanna have the "select idShow" in the sub-query we'd probably have to use EXISTS and NOT EXISTS and I never really liked those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@Montellese
Owner

Looks good except for the comment.

@jmarshallnz
Owner

Updated with a couple of changes:

  1. Recently added nodes have moved to filters (now that @Montellese has taken care of the sort stuff which was the only hold up from the original merge of the video lib customisation).

  2. Removed a couple of advanced settings related to recently added as it's now customisable anyway.

  3. Implemented in progress as a default filter. @JezzX a new image DefaultInProgressShows.png if you feel like doing so.

  4. Re-specified the order attribute so that adding new default nodes is a little less effort next time around.

I suspect over the next week and a half I'll be in and out of internet coverage, so if someone would hit the button on my behalf once signed off that'd be great. @Montellese, @cptspiff either of you are fine for review.

@Montellese
Owner

You beat me to changing recently added from a folder into a filter (I have the same patch lying around somewhere). Any reason why we still need to keep the DirectoryNodeRecentlyAddedFoo.* files in xbmc/filesystem/VideodatabaseDirectory?

The changes look fine to me. I can give them a test run later to see if there are any obvious bugs.

@jmarshallnz
Owner

No reason other than I couldn't be arsed - I can probably do that now (have another 15 mins till I need to head off)

@jmarshallnz
Owner

Hmm, after more thought, there may be a reason. videodb://4/ may be being referenced directly by a skin. Or, more likely, RecentlyAddedMovies may be referenced. Thus, some skin links would stop working if we removed these.

Might be better to hold off until the home menu customisation is in and skins support it.

@Montellese
Owner

Ah you're right, forgot about that. In that case we better leave it in for now.

I did some work on grouping support in playlists anyway which might render most of the DirectoryNodeFooBar files unneeded anyway. But that's most likely for Frodo+1.

@Montellese
Owner

Ok gave it a quick spin and didn't spot anything obvious. Only thing I was wondering about is that the "In progress TVShows" node shows up in the video library node and not under tvshows. IMO it looks a bit odd there.

@jmarshallnz
Owner
@Montellese
Owner

I don't really care as I'll probably never use it anyway. I also never go into Videos -> Library except during debugging/testing.

@Montellese Montellese merged commit d691aaa into from
@Montellese Montellese was assigned
@MartijnKaijser

imo this isn't entirely correct.
For me inprogress means that even if only start to watch the first episode and don't finish it completely it is still something in progress.
atm these tvshows are excluded from the list.

If you can come up with suitable SQL for grabbing it we could make the change. The tricky bit is you want both, and that the episode in progress query needs to be done on the bookmark/file/episode tables (to grab idShow where a resume bookmark is set).

Yeah that's gonna be one hell of an ugly SQL query. Either you have to do another sub-select query or you have to come up with an EXISTS() condition. Being able to cover both cases isn't that much of a problem, just do

... where (watchedcount > 0 AND watchedcount < totalCount) OR (watchedcount == 0 AND foobar)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 7, 2012
  1. adds support for inprogress in shows (kicks in if watchedcount > 0 an…

    Jonathan Marshall authored
    …d watchedcount < totalCounts)
  2. add in progress shows item under tvshows in the library

    Jonathan Marshall authored
  3. cleanup: remove old advanced settings for recently added nodes - no l…

    Jonathan Marshall authored
    …onger needed now that it's customisable
This page is out of date. Refresh to see the latest.
View
6 language/English/strings.po
@@ -2273,7 +2273,11 @@ msgctxt "#625"
msgid "All songs of"
msgstr ""
-#empty strings from id 626 to 628
+msgctxt "#626"
+msgid "In progress TV shows"
+msgstr ""
+
+#empty strings from id 627 to 628
msgctxt "#629"
msgid "View mode"
View
2  system/library/video/addons.xml
@@ -1,4 +1,4 @@
-<node order="9" type="folder">
+<node order="22" type="folder">
<label>1037</label>
<icon>DefaultAddonVideo.png</icon>
<path>addons://sources/video/</path>
View
2  system/library/video/files.xml
@@ -1,4 +1,4 @@
-<node order="7" type="folder">
+<node order="20" type="folder">
<label>744</label>
<icon>DefaultFolder.png</icon>
<path>sources://video</path>
View
7 system/library/video/inprogressshows.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<node order="4" type="filter" visible="Library.HasContent(TVShows)">
+ <label>626</label>
+ <icon>DefaultInProgressShows.png</icon>
+ <content>tvshows</content>
+ <rule field="inprogress" operator="true" />
+</node>
View
2  system/library/video/playlists.xml
@@ -1,4 +1,4 @@
-<node order="8" type="folder">
+<node order="21" type="folder">
<label>136</label>
<icon>DefaultVideoPlaylists.png</icon>
<path>special://videoplaylists/</path>
View
6 system/library/video/recentlyaddedepisodes.xml
@@ -1,5 +1,7 @@
-<node order="5" type="folder" visible="Library.HasContent(TVShows)">
+<node order="11" type="filter" visible="Library.HasContent(TVShows)">
<label>20387</label>
<icon>DefaultRecentlyAddedEpisodes.png</icon>
- <path>videodb://5</path>
+ <content>episodes</content>
+ <order direction="descending">dateadded</order>
+ <limit>25</limit>
</node>
View
6 system/library/video/recentlyaddedmovies.xml
@@ -1,5 +1,7 @@
-<node order="4" type="folder" visible="Library.HasContent(Movies)">
+<node order="10" type="filter" visible="Library.HasContent(Movies)">
<label>20386</label>
<icon>DefaultRecentlyAddedMovies.png</icon>
- <path>videodb://4</path>
+ <content>movies</content>
+ <order direction="descending">dateadded</order>
+ <limit>25</limit>
</node>
View
6 system/library/video/recentlyaddedmusicvideos.xml
@@ -1,5 +1,7 @@
-<node order="6" type="folder" visible="Library.HasContent(MusicVideos)">
+<node order="12" type="filter" visible="Library.HasContent(MusicVideos)">
<label>20390</label>
<icon>DefaultRecentlyAddedMusicVideos.png</icon>
- <path>videodb://6</path>
+ <content>musicvideos</content>
+ <order direction="descending">dateadded</order>
+ <limit>25</limit>
</node>
View
2  system/library/video_flat/addons.xml
@@ -1,4 +1,4 @@
-<node order="9" type="folder">
+<node order="22" type="folder">
<label>1037</label>
<icon>DefaultAddonVideo.png</icon>
<path>addons://sources/video/</path>
View
2  system/library/video_flat/files.xml
@@ -1,4 +1,4 @@
-<node order="7" type="folder">
+<node order="20" type="folder">
<label>744</label>
<icon>DefaultFolder.png</icon>
<path>sources://video</path>
View
7 system/library/video_flat/inprogressshows.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<node order="4" type="filter" visible="Library.HasContent(TVShows)">
+ <label>626</label>
+ <icon>DefaultInProgressShows.png</icon>
+ <content>tvshows</content>
+ <rule field="inprogress" operator="true" />
+</node>
View
2  system/library/video_flat/playlists.xml
@@ -1,4 +1,4 @@
-<node order="8" type="folder">
+<node order="21" type="folder">
<label>136</label>
<icon>DefaultVideoPlaylists.png</icon>
<path>special://videoplaylists/</path>
View
6 system/library/video_flat/recentlyaddedepisodes.xml
@@ -1,5 +1,7 @@
-<node order="5" type="folder" visible="Library.HasContent(TVShows)">
+<node order="11" type="filter" visible="Library.HasContent(TVShows)">
<label>20387</label>
<icon>DefaultRecentlyAddedEpisodes.png</icon>
- <path>videodb://5</path>
+ <content>episodes</content>
+ <order direction="descending">dateadded</order>
+ <limit>25</limit>
</node>
View
6 system/library/video_flat/recentlyaddedmovies.xml
@@ -1,5 +1,7 @@
-<node order="4" type="folder" visible="Library.HasContent(Movies)">
+<node order="10" type="filter" visible="Library.HasContent(Movies)">
<label>20386</label>
<icon>DefaultRecentlyAddedMovies.png</icon>
- <path>videodb://4</path>
+ <content>movies</content>
+ <order direction="descending">dateadded</order>
+ <limit>25</limit>
</node>
View
6 system/library/video_flat/recentlyaddedmusicvideos.xml
@@ -1,5 +1,7 @@
-<node order="6" type="folder" visible="Library.HasContent(MusicVideos)">
+<node order="12" type="filter" visible="Library.HasContent(MusicVideos)">
<label>20390</label>
<icon>DefaultRecentlyAddedMusicVideos.png</icon>
- <path>videodb://6</path>
+ <content>musicvideos</content>
+ <order direction="descending">dateadded</order>
+ <limit>25</limit>
</node>
View
2  xbmc/filesystem/VideoDatabaseDirectory/DirectoryNodeOverview.cpp
@@ -21,7 +21,6 @@
#include "video/VideoDatabase.h"
#include "DirectoryNodeOverview.h"
-#include "settings/AdvancedSettings.h"
#include "settings/Settings.h"
#include "FileItem.h"
#include "guilib/LocalizeStrings.h"
@@ -92,7 +91,6 @@ bool CDirectoryNodeOverview::GetContent(CFileItemList& items) const
else
vec.push_back(make_pair("3", 20389)); // Music Videos
}
- if (!g_advancedSettings.m_bVideoLibraryHideRecentlyAddedItems)
{
if (hasMovies)
vec.push_back(make_pair("4", 20386)); // Recently Added Movies
View
6 xbmc/playlists/SmartPlayList.cpp
@@ -408,6 +408,7 @@ vector<Field> CSmartPlaylistRule::GetFields(const CStdString &type)
fields.push_back(FieldStudio);
fields.push_back(FieldMPAA);
fields.push_back(FieldDateAdded);
+ fields.push_back(FieldInProgress);
}
else if (type == "episodes")
{
@@ -723,6 +724,11 @@ CStdString CSmartPlaylistRule::GetWhereClause(const CDatabase &db, const CStdStr
if (m_field == FieldInProgress)
return "episodeview.idFile " + negate + " IN (select idFile from bookmark where type = 1)";
}
+ else if (strType == "tvshows")
+ {
+ if (m_field == FieldInProgress)
+ return GetField(FieldId, strType) + negate + " IN (select idShow from tvshowview where watchedcount > 0 AND watchedcount < totalCount)";
+ }
}
// now the query parameter
View
4 xbmc/settings/AdvancedSettings.cpp
@@ -211,8 +211,6 @@ void CAdvancedSettings::Initialize()
m_bVideoLibraryHideAllItems = false;
m_bVideoLibraryAllItemsOnBottom = false;
- m_iVideoLibraryRecentlyAddedItems = 25;
- m_bVideoLibraryHideRecentlyAddedItems = false;
m_bVideoLibraryHideEmptySeries = false;
m_bVideoLibraryCleanOnUpdate = false;
m_bVideoLibraryExportAutoThumbs = false;
@@ -642,8 +640,6 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file)
{
XMLUtils::GetBoolean(pElement, "hideallitems", m_bVideoLibraryHideAllItems);
XMLUtils::GetBoolean(pElement, "allitemsonbottom", m_bVideoLibraryAllItemsOnBottom);
- XMLUtils::GetInt(pElement, "recentlyaddeditems", m_iVideoLibraryRecentlyAddedItems, 1, INT_MAX);
- XMLUtils::GetBoolean(pElement, "hiderecentlyaddeditems", m_bVideoLibraryHideRecentlyAddedItems);
XMLUtils::GetBoolean(pElement, "hideemptyseries", m_bVideoLibraryHideEmptySeries);
XMLUtils::GetBoolean(pElement, "cleanonupdate", m_bVideoLibraryCleanOnUpdate);
XMLUtils::GetString(pElement, "itemseparator", m_videoItemSeparator);
View
2  xbmc/settings/AdvancedSettings.h
@@ -247,8 +247,6 @@ class CAdvancedSettings
bool m_bVideoLibraryHideAllItems;
bool m_bVideoLibraryAllItemsOnBottom;
- int m_iVideoLibraryRecentlyAddedItems;
- bool m_bVideoLibraryHideRecentlyAddedItems;
bool m_bVideoLibraryHideEmptySeries;
bool m_bVideoLibraryCleanOnUpdate;
bool m_bVideoLibraryExportAutoThumbs;
View
6 xbmc/video/VideoDatabase.cpp
@@ -6106,7 +6106,7 @@ bool CVideoDatabase::GetRecentlyAddedMoviesNav(const CStdString& strBaseDir, CFi
{
Filter filter;
filter.order = "dateAdded desc, idMovie desc";
- filter.limit = PrepareSQL("%u", limit ? limit : g_advancedSettings.m_iVideoLibraryRecentlyAddedItems);
+ filter.limit = PrepareSQL("%u", limit ? limit : 25);
return GetMoviesByWhere(strBaseDir, filter, items);
}
@@ -6114,7 +6114,7 @@ bool CVideoDatabase::GetRecentlyAddedEpisodesNav(const CStdString& strBaseDir, C
{
Filter filter;
filter.order = "dateAdded desc, idEpisode desc";
- filter.limit = PrepareSQL("%u", limit ? limit : g_advancedSettings.m_iVideoLibraryRecentlyAddedItems);
+ filter.limit = PrepareSQL("%u", limit ? limit : 25);
return GetEpisodesByWhere(strBaseDir, filter, items, false);
}
@@ -6122,7 +6122,7 @@ bool CVideoDatabase::GetRecentlyAddedMusicVideosNav(const CStdString& strBaseDir
{
Filter filter;
filter.order = "dateAdded desc, idMVideo desc";
- filter.limit = PrepareSQL("%u", limit ? limit : g_advancedSettings.m_iVideoLibraryRecentlyAddedItems);
+ filter.limit = PrepareSQL("%u", limit ? limit : 25);
return GetMusicVideosByWhere(strBaseDir, filter, items);
}
Something went wrong with that request. Please try again.