Skip to content

Commit

Permalink
Merge pull request xbmc#1751 from Montellese/ra_fixes
Browse files Browse the repository at this point in the history
recentlyadded: make sure to show the same list independent of the entry point
  • Loading branch information
jmarshallnz committed Nov 8, 2012
2 parents 6d1cc62 + 763c11e commit 17ebfab
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 27 deletions.
6 changes: 2 additions & 4 deletions system/library/video/recentlyaddedepisodes.xml
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="11" type="filter" visible="Library.HasContent(TVShows)">
<node order="11" type="folder" visible="Library.HasContent(TVShows)">
<label>20387</label>
<icon>DefaultRecentlyAddedEpisodes.png</icon>
<content>episodes</content>
<order direction="descending">dateadded</order>
<limit>25</limit>
<path>videodb://5</path>
</node>
6 changes: 2 additions & 4 deletions system/library/video/recentlyaddedmovies.xml
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="10" type="filter" visible="Library.HasContent(Movies)">
<node order="10" type="folder" visible="Library.HasContent(Movies)">
<label>20386</label>
<icon>DefaultRecentlyAddedMovies.png</icon>
<content>movies</content>
<order direction="descending">dateadded</order>
<limit>25</limit>
<path>videodb://4</path>
</node>
6 changes: 2 additions & 4 deletions system/library/video/recentlyaddedmusicvideos.xml
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="12" type="filter" visible="Library.HasContent(MusicVideos)">
<node order="12" type="folder" visible="Library.HasContent(MusicVideos)">
<label>20390</label>
<icon>DefaultRecentlyAddedMusicVideos.png</icon>
<content>musicvideos</content>
<order direction="descending">dateadded</order>
<limit>25</limit>
<path>videodb://6</path>
</node>
6 changes: 2 additions & 4 deletions system/library/video_flat/recentlyaddedepisodes.xml
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="11" type="filter" visible="Library.HasContent(TVShows)">
<node order="11" type="folder" visible="Library.HasContent(TVShows)">
<label>20387</label>
<icon>DefaultRecentlyAddedEpisodes.png</icon>
<content>episodes</content>
<order direction="descending">dateadded</order>
<limit>25</limit>
<path>videodb://5</path>
</node>
6 changes: 2 additions & 4 deletions system/library/video_flat/recentlyaddedmovies.xml
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="10" type="filter" visible="Library.HasContent(Movies)">
<node order="10" type="folder" visible="Library.HasContent(Movies)">
<label>20386</label>
<icon>DefaultRecentlyAddedMovies.png</icon>
<content>movies</content>
<order direction="descending">dateadded</order>
<limit>25</limit>
<path>videodb://4</path>
</node>
6 changes: 2 additions & 4 deletions system/library/video_flat/recentlyaddedmusicvideos.xml
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="12" type="filter" visible="Library.HasContent(MusicVideos)">
<node order="12" type="folder" visible="Library.HasContent(MusicVideos)">
<label>20390</label>
<icon>DefaultRecentlyAddedMusicVideos.png</icon>
<content>musicvideos</content>
<order direction="descending">dateadded</order>
<limit>25</limit>
<path>videodb://6</path>
</node>
2 changes: 2 additions & 0 deletions xbmc/settings/AdvancedSettings.cpp
Expand Up @@ -209,6 +209,7 @@ void CAdvancedSettings::Initialize()

m_bVideoLibraryHideAllItems = false;
m_bVideoLibraryAllItemsOnBottom = false;
m_iVideoLibraryRecentlyAddedItems = 25;
m_bVideoLibraryHideEmptySeries = false;
m_bVideoLibraryCleanOnUpdate = false;
m_bVideoLibraryExportAutoThumbs = false;
Expand Down Expand Up @@ -641,6 +642,7 @@ 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, "hideemptyseries", m_bVideoLibraryHideEmptySeries);
XMLUtils::GetBoolean(pElement, "cleanonupdate", m_bVideoLibraryCleanOnUpdate);
XMLUtils::GetString(pElement, "itemseparator", m_videoItemSeparator);
Expand Down
1 change: 1 addition & 0 deletions xbmc/settings/AdvancedSettings.h
Expand Up @@ -245,6 +245,7 @@ class CAdvancedSettings

bool m_bVideoLibraryHideAllItems;
bool m_bVideoLibraryAllItemsOnBottom;
int m_iVideoLibraryRecentlyAddedItems;
bool m_bVideoLibraryHideEmptySeries;
bool m_bVideoLibraryCleanOnUpdate;
bool m_bVideoLibraryExportAutoThumbs;
Expand Down
6 changes: 3 additions & 3 deletions xbmc/video/VideoDatabase.cpp
Expand Up @@ -6362,23 +6362,23 @@ bool CVideoDatabase::GetRecentlyAddedMoviesNav(const CStdString& strBaseDir, CFi
{
Filter filter;
filter.order = "dateAdded desc, idMovie desc";
filter.limit = PrepareSQL("%u", limit ? limit : 25);
filter.limit = PrepareSQL("%u", limit ? limit : g_advancedSettings.m_iVideoLibraryRecentlyAddedItems);
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 : 25);
filter.limit = PrepareSQL("%u", limit ? limit : g_advancedSettings.m_iVideoLibraryRecentlyAddedItems);
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 : 25);
filter.limit = PrepareSQL("%u", limit ? limit : g_advancedSettings.m_iVideoLibraryRecentlyAddedItems);
return GetMusicVideosByWhere(strBaseDir, filter, items);
}

Expand Down

0 comments on commit 17ebfab

Please sign in to comment.