Project

General

Profile

Feature #334 ยป AutoGenVideoThumbs.patch

brentdc42, 23/10/2014 01:17 PM

View differences:

xbmc/cores/dvdplayer/DVDFileInfo.cpp (working copy)
return false;
}
bool CDVDFileInfo::ExtractThumb(const CStdString &strPath, const CStdString &strTarget, CStreamDetails *pStreamDetails)
bool CDVDFileInfo::ExtractThumb(const CStdString &strPath, const CStdString &strTarget/*, CStreamDetails *pStreamDetails*/)
{
int nTime = timeGetTime();
CDVDInputStream *pInputStream = CDVDFactoryInputStream::CreateInputStream(NULL, strPath, "");
......
return false;
}
if (pStreamDetails)
DemuxerToStreamDetails(pDemuxer, *pStreamDetails, strPath);
// if (pStreamDetails)
// DemuxerToStreamDetails(pDemuxer, *pStreamDetails, strPath);
CDemuxStream* pStream = NULL;
int nVideoStream = -1;
xbmc/cores/dvdplayer/DVDFileInfo.h (working copy)
{
public:
// Extract a thumbnail immage from the media at strPath an image file in strTarget, optionally populating a streamdetails class with the data
static bool ExtractThumb(const CStdString &strPath, const CStdString &strTarget, CStreamDetails *pStreamDetails);
static bool ExtractThumb(const CStdString &strPath, const CStdString &strTarget /*, CStreamDetails *pStreamDetails*/);
// GetFileMetaData will fill pItem's properties according to what can be extracted from the file.
static void GetFileMetaData(const CStdString &strPath, CFileItem *pItem);
xbmc/settings/GUISettings.cpp (working copy)
AddBool(0, "myvideos.treatstackasfile", 20051, true);
AddBool(0, "myvideos.extractflags",20433, false);
AddBool(3, "myvideos.cleanstrings", 20418, false);
AddBool(0, "myvideos.extractthumb",20433, false);
AddBool(4, "myvideos.extractthumb",20433, false);
AddCategory(5, "subtitles", 287);
AddString(1, "subtitles.font", 288, "Arial.ttf", SPIN_CONTROL_TEXT);
xbmc/ThumbLoader.cpp (working copy)
* <http://www.gnu.org/licenses/>.
*
*/
#include "ThumbLoader.h"
#include "Util.h"
#include "URL.h"
......
void CVideoThumbLoader::OnLoaderStart()
{
}
void CVideoThumbLoader::OnLoaderFinish()
......
{
CStdString strPath, strFileName;
URIUtils::Split(cachedThumb, strPath, strFileName);
if(g_guiSettings.GetBool("myvideos.extractthumb"))
{
cachedThumb = strPath + "auto-" + strFileName;
if (pItem->IsVideo() && !pItem->IsInternetStream() && !pItem->IsPlayList() && !CFile::Exists(cachedThumb))
CDVDFileInfo::ExtractThumb(pItem->GetPath(), cachedThumb);
}
// create unique thumb for auto generated thumbs
cachedThumb = strPath + "auto-" + strFileName;
    (1-1/1)