Permalink
Browse files

[pvr] Display thumbnails and fanarts of PVR recordings being availabl…

…e in the library.
  • Loading branch information...
1 parent 691e45b commit 49453ffca466b3bfd2ec3827d8d9d67ecfae7c52 @axmhari committed Nov 4, 2012
View
15 xbmc/pvr/windows/GUIWindowPVRRecordings.cpp
@@ -32,7 +32,7 @@
#include "utils/log.h"
#include "utils/StringUtils.h"
#include "threads/SingleLock.h"
-#include "video/VideoDatabase.h"
+#include "video/windows/GUIWindowVideoNav.h"
using namespace PVR;
@@ -412,5 +412,16 @@ void CGUIWindowPVRRecordings::AfterUpdate(CFileItemList& items)
files.Add(pItem);
files.SetPath(items.GetPath());
}
- m_thumbLoader.Load(files);
+
+ if (!files.IsEmpty())
+ {
+ if(!m_database.Open())
+ {
+ return;
+ }
+
+ CGUIWindowVideoNav::LoadVideoInfo(items, m_database);
+ m_thumbLoader.Load(files);
+ m_database.Close();
+ }
}
View
2 xbmc/pvr/windows/GUIWindowPVRRecordings.h
@@ -22,6 +22,7 @@
#include "GUIWindowPVRCommon.h"
#include "video/VideoThumbLoader.h"
+#include "video/VideoDatabase.h"
#include "utils/Observer.h"
namespace PVR
@@ -63,5 +64,6 @@ namespace PVR
CStdString m_strSelectedPath;
CVideoThumbLoader m_thumbLoader;
+ CVideoDatabase m_database;
};
}
View
2 xbmc/video/windows/GUIWindowVideoBase.cpp
@@ -1817,7 +1817,7 @@ bool CGUIWindowVideoBase::GetDirectory(const CStdString &strDirectory, CFileItem
return bResult;
}
-bool CGUIWindowVideoBase::StackingAvailable(const CFileItemList &items) const
+bool CGUIWindowVideoBase::StackingAvailable(const CFileItemList &items)
{
return !(items.IsTuxBox() || items.IsPlugin() ||
items.IsAddonsPath() || items.IsRSS() ||
View
2 xbmc/video/windows/GUIWindowVideoBase.h
@@ -133,7 +133,7 @@ class CGUIWindowVideoBase : public CGUIMediaWindow, public IBackgroundLoaderObse
static bool OnUnAssignContent(const CStdString &path, int label1, int label2, int label3);
- bool StackingAvailable(const CFileItemList &items) const;
+ static bool StackingAvailable(const CFileItemList &items);
bool OnPlayStackPart(int item);
View
11 xbmc/video/windows/GUIWindowVideoNav.cpp
@@ -394,6 +394,11 @@ bool CGUIWindowVideoNav::GetDirectory(const CStdString &strDirectory, CFileItemL
void CGUIWindowVideoNav::LoadVideoInfo(CFileItemList &items)
{
+ LoadVideoInfo(items, m_database);
+}
+
+void CGUIWindowVideoNav::LoadVideoInfo(CFileItemList &items, CVideoDatabase &database)
+{
// TODO: this could possibly be threaded as per the music info loading,
// we could also cache the info
if (!items.GetContent().IsEmpty() && !items.IsPlugin())
@@ -403,7 +408,7 @@ void CGUIWindowVideoNav::LoadVideoInfo(CFileItemList &items)
// determine content only if it isn't set
if (content.IsEmpty())
{
- content = m_database.GetContentForPath(items.GetPath());
+ content = database.GetContentForPath(items.GetPath());
items.SetContent(content.IsEmpty() ? "files" : content);
}
@@ -427,7 +432,7 @@ void CGUIWindowVideoNav::LoadVideoInfo(CFileItemList &items)
bool fetchedPlayCounts = false;
if (!content.IsEmpty())
{
- m_database.GetItemsForPath(content, items.GetPath(), dbItems);
+ database.GetItemsForPath(content, items.GetPath(), dbItems);
dbItems.SetFastLookup(true);
}
@@ -463,7 +468,7 @@ void CGUIWindowVideoNav::LoadVideoInfo(CFileItemList &items)
This code can be removed once the content tables are always filled */
if (!pItem->m_bIsFolder && !fetchedPlayCounts)
{
- m_database.GetPlayCounts(items.GetPath(), items);
+ database.GetPlayCounts(items.GetPath(), items);
fetchedPlayCounts = true;
}
View
7 xbmc/video/windows/GUIWindowVideoNav.h
@@ -40,6 +40,13 @@ class CGUIWindowVideoNav : public CGUIWindowVideoBase
static bool CanDelete(const CStdString& strPath);
static bool DeleteItem(CFileItem* pItem, bool bUnavailable=false);
+ /*! \brief Load video information from the database for these items (public static version)
+ Useful for grabbing information for file listings, from watched status to full metadata
+ \param items the items to load information for.
+ \param database open database object to retrieve the data from
+ */
+ static void LoadVideoInfo(CFileItemList &items, CVideoDatabase &database);
+
protected:
/*! \brief Load video information from the database for these items
Useful for grabbing information for file listings, from watched status to full metadata

0 comments on commit 49453ff

Please sign in to comment.