adds support for inprogress in shows #1349

Merged
merged 5 commits into from Sep 8, 2012
+58 −30
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,23 +6106,23 @@ 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);
}
bool CVideoDatabase::GetRecentlyAddedEpisodesNav(const CStdString& strBaseDir, CFileItemList& items, unsigned int limit)
{
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);
}
bool CVideoDatabase::GetRecentlyAddedMusicVideosNav(const CStdString& strBaseDir, CFileItemList& items, unsigned int limit)
{
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);
}