Skip to content
Permalink
Browse files

Somehow the real content ot last commit got missed in that commit.

See last message.
  • Loading branch information
Robert McNamara
Robert McNamara committed Jul 12, 2011
1 parent a1be7d4 commit a683afce99b1448e6c6318ec559e30fe88fbb3e5
@@ -114,7 +114,7 @@ package MythTV;
# schema version supported in the main code. We need to check that the schema
# version in the database is as expected by the bindings, which are expected
# to be kept in sync with the main code.
our $SCHEMA_VERSION = "1278";
our $SCHEMA_VERSION = "1279";

# NUMPROGRAMLINES is defined in mythtv/libs/libmythtv/programinfo.h and is
# the number of items in a ProgramInfo QStringList group used by
@@ -5,7 +5,7 @@
"""

OWN_VERSION = (0,25,-1,2)
SCHEMA_VERSION = 1278
SCHEMA_VERSION = 1279
NVSCHEMA_VERSION = 1007
MUSICSCHEMA_VERSION = 1018
PROTO_VERSION = '69'
@@ -12,7 +12,7 @@
/// Update this whenever the plug-in API changes.
/// Including changes in the libmythbase, libmyth, libmythtv, libmythav* and
/// libmythui class methods used by plug-ins.
#define MYTH_BINARY_VERSION "0.25.20110707-1"
#define MYTH_BINARY_VERSION "0.25.20110711-1"

/** \brief Increment this whenever the MythTV network protocol changes.
*
@@ -16,14 +16,14 @@ HEADERS += cleanup.h dbaccess.h dirscan.h globals.h parentalcontrols.h
HEADERS += videoscan.h videoutils.h videometadata.h videometadatalistmanager.h
HEADERS += quicksp.h metadatacommon.h metadatadownload.h metadataimagedownload.h
HEADERS += bluraymetadata.h mythmetaexp.h metadatafactory.h mythuimetadataresults.h
HEADERS += mythuiimageresults.h
HEADERS += mythuiimageresults.h metadataimagehelper.h

SOURCES += cleanup.cpp dbaccess.cpp dirscan.cpp globals.cpp
SOURCES += parentalcontrols.cpp videoscan.cpp videoutils.cpp
SOURCES += videometadata.cpp videometadatalistmanager.cpp
SOURCES += metadatacommon.cpp metadatadownload.cpp metadataimagedownload.cpp
SOURCES += bluraymetadata.cpp metadatafactory.cpp mythuimetadataresults.cpp
SOURCES += mythuiimageresults.cpp
SOURCES += mythuiimageresults.cpp metadataimagehelper.cpp

INCLUDEPATH += ../libmythbase ../libmythtv
INCLUDEPATH += ../.. ../ ./ ../libmythupnp ../libmythui
@@ -63,7 +63,7 @@ inc.files = cleanup.h dbaccess.h dirscan.h globals.h parentalcontrols.h
inc.files += videoscan.h videoutils.h videometadata.h videometadatalistmanager.h
inc.files += quicksp.h metadatacommon.h metadatadownload.h metadataimagedownload.h
inc.files += bluraymetadata.h mythmetaexp.h metadatafactory.h mythuimetadataresults.h
inc.files += mythuiimageresults.h
inc.files += mythuiimageresults.h metadataimagehelper.h

INSTALLS += inc

@@ -22,7 +22,7 @@ using namespace std;
mythtv/bindings/perl/MythTV.pm
*/
/// This is the DB schema version expected by the running MythTV instance.
const QString currentDatabaseVersion = "1278";
const QString currentDatabaseVersion = "1279";

static bool UpdateDBVersionNumber(const QString &newnumber, QString &dbver);
static bool performActualUpdate(
@@ -5770,6 +5770,22 @@ NULL
return false;
}

if (dbver == "1278")
{
const char *updates[] = {
"CREATE TABLE recordedartwork ( "
" inetref VARCHAR(255) NOT NULL, "
" season SMALLINT(5) NOT NULL, "
" host TEXT NOT NULL, "
" coverart TEXT NOT NULL, "
" fanart TEXT NOT NULL, "
" banner TEXT NOT NULL);",
NULL
};
if (!performActualUpdate(updates, "1279", dbver))
return false;
}

return true;
}

@@ -33,6 +33,9 @@
#include "videoutils.h"
#include "mythuiutils.h"

// libmythmetadata
#include "metadataimagehelper.h"

// Mythfrontend
#include "proglist.h"
#include "viewschedulediff.h"
@@ -1328,6 +1331,9 @@ MetadataOptions::MetadataOptions(MythScreenStack *parent,
m_imageLookup = new MetadataDownload(this);
m_imageDownload = new MetadataImageDownload(this);

m_artworkMap = GetArtwork(m_recordingRule->m_inetref,
m_recordingRule->m_season);

if (recInfo)
m_recInfo = new RecordingInfo(*recInfo);
}
@@ -1362,15 +1368,15 @@ bool MetadataOptions::Create()
UIUtilE::Assign(this, m_seasonSpin, "season_spinbox", &err);
UIUtilE::Assign(this, m_episodeSpin, "episode_spinbox", &err);
UIUtilE::Assign(this, m_queryButton, "query_button", &err);
/* UIUtilE::Assign(this, m_localFanartButton, "local_fanart_button", &err);
UIUtilE::Assign(this, m_localFanartButton, "local_fanart_button", &err);
UIUtilE::Assign(this, m_localCoverartButton, "local_coverart_button", &err);
UIUtilE::Assign(this, m_localBannerButton, "local_banner_button", &err);
UIUtilE::Assign(this, m_onlineFanartButton, "online_fanart_button", &err);
UIUtilE::Assign(this, m_onlineCoverartButton, "online_coverart_button", &err);
UIUtilE::Assign(this, m_onlineBannerButton, "online_banner_button", &err);
UIUtilW::Assign(this, m_fanart, "fanart");
UIUtilW::Assign(this, m_coverart, "coverart");
UIUtilW::Assign(this, m_banner, "banner");*/
UIUtilW::Assign(this, m_banner, "banner");
UIUtilW::Assign(this, m_backButton, "back");

if (err)
@@ -1384,7 +1390,7 @@ bool MetadataOptions::Create()
SLOT(Close()));
connect(m_queryButton, SIGNAL(Clicked()),
SLOT(PerformQuery()));
/* connect(m_localFanartButton, SIGNAL(Clicked()),
connect(m_localFanartButton, SIGNAL(Clicked()),
SLOT(SelectLocalFanart()));
connect(m_localCoverartButton, SIGNAL(Clicked()),
SLOT(SelectLocalCoverart()));
@@ -1395,7 +1401,10 @@ bool MetadataOptions::Create()
connect(m_onlineCoverartButton, SIGNAL(Clicked()),
SLOT(SelectOnlineCoverart()));
connect(m_onlineBannerButton, SIGNAL(Clicked()),
SLOT(SelectOnlineBanner()));*/
SLOT(SelectOnlineBanner()));

connect(m_seasonSpin, SIGNAL(itemSelected(MythUIButtonListItem*)),
SLOT(ValuesChanged()));

// InetRef
m_inetrefEdit->SetText(m_recordingRule->m_inetref);
@@ -1408,6 +1417,24 @@ bool MetadataOptions::Create()
m_episodeSpin->SetRange(0,100,1,1);
m_episodeSpin->SetValue(m_recordingRule->m_episode);

if (m_coverart)
{
m_coverart->SetFilename(m_artworkMap.value(COVERART).url);
m_coverart->Load();
}

if (m_fanart)
{
m_fanart->SetFilename(m_artworkMap.value(FANART).url);
m_fanart->Load();
}

if (m_banner)
{
m_banner->SetFilename(m_artworkMap.value(BANNER).url);
m_banner->Load();
}

BuildFocusList();

return true;
@@ -1625,7 +1652,7 @@ void MetadataOptions::FindNetArt(VideoArtworkType type)
CreateBusyDialog(msg);

m_lookup->SetStep(SEARCH);
m_lookup->SetType(RECDNG);
m_lookup->SetType(VID);
m_lookup->SetAutomatic(true);
m_lookup->SetHandleImages(false);
m_lookup->SetData(qVariantFromValue<VideoArtworkType>(type));
@@ -1666,6 +1693,59 @@ void MetadataOptions::OnArtworkSearchDone(MetadataLookup *lookup)
m_popupStack->AddScreen(resultsdialog);
}

void MetadataOptions::HandleDownloadedImages(MetadataLookup *lookup)
{
if (!lookup)
return;

DownloadMap map = lookup->GetDownloads();

if (!map.size())
return;

for (DownloadMap::const_iterator i = map.begin(); i != map.end(); ++i)
{
VideoArtworkType type = i.key();
ArtworkInfo info = i.value();

if (type == COVERART)
m_artworkMap.replace(COVERART, info);
else if (type == FANART)
m_artworkMap.replace(FANART, info);
else if (type == BANNER)
m_artworkMap.replace(BANNER, info);
}

SetArtwork(m_inetrefEdit->GetText(), m_seasonSpin->GetIntValue(),
gCoreContext->GetMasterHostName(), m_artworkMap);

ValuesChanged();
}

void MetadataOptions::ValuesChanged()
{
m_artworkMap = GetArtwork(m_inetrefEdit->GetText(),
m_seasonSpin->GetIntValue());

if (m_coverart)
{
m_coverart->SetFilename(m_artworkMap.value(COVERART).url);
m_coverart->Load();
}

if (m_fanart)
{
m_fanart->SetFilename(m_artworkMap.value(FANART).url);
m_fanart->Load();
}

if (m_banner)
{
m_banner->SetFilename(m_artworkMap.value(BANNER).url);
m_banner->Load();
}
}

void MetadataOptions::customEvent(QEvent *levent)
{
if (levent->type() == MetadataFactoryMultiResult::kEventType)
@@ -1799,7 +1879,36 @@ void MetadataOptions::customEvent(QEvent *levent)
if (!lookup)
return;

// handleDownloadedImages(lookup);
HandleDownloadedImages(lookup);
}
else if (levent->type() == DialogCompletionEvent::kEventType)
{
DialogCompletionEvent *dce = (DialogCompletionEvent*)(levent);

LOG(VB_GENERAL, LOG_ERR, "DCE!");

const QString resultid = dce->GetId();
ArtworkInfo info;
info.url = dce->GetResultText();

if (resultid == "coverart")
{
m_artworkMap.replace(COVERART, info);
}
else if (resultid == "fanart")
{
m_artworkMap.replace(FANART, info);
}
else if (resultid == "banner")
{
m_artworkMap.replace(BANNER, info);
}

SetArtwork(m_inetrefEdit->GetText(), m_seasonSpin->GetIntValue(),
gCoreContext->GetMasterHostName(), m_artworkMap);

ValuesChanged();
}

}

@@ -244,6 +244,8 @@ class MetadataOptions : public MythScreenType
void OnArtworkSearchDone(MetadataLookup *lookup);
void FindNetArt(VideoArtworkType type);

void ValuesChanged();

private:
void Load(void);
void Save(void);
@@ -255,6 +257,8 @@ class MetadataOptions : public MythScreenType
const QString &returnEvent);
QStringList GetSupportedImageExtensionFilter();

void HandleDownloadedImages(MetadataLookup *lookup);

void customEvent(QEvent *event);

RecordingInfo *m_recInfo;
@@ -290,6 +294,8 @@ class MetadataOptions : public MythScreenType
MythUIButton *m_onlineBannerButton;

MythUIButton *m_backButton;

ArtworkMap m_artworkMap;
};

#endif
@@ -2201,8 +2201,38 @@
<value>Perform Query</value>
</button>

<button name="online_coverart_button" from="basewidebutton">
<position>545,275</position>
<value>Find Online Coverart</value>
</button>

<button name="online_fanart_button" from="basewidebutton">
<position>545,330</position>
<value>Find Online Fanart</value>
</button>

<button name="online_banner_button" from="basewidebutton">
<position>545,385</position>
<value>Find Online Banners</value>
</button>

<button name="local_coverart_button" from="basewidebutton">
<position>545,440</position>
<value>Find Local Coverart</value>
</button>

<button name="local_fanart_button" from="basewidebutton">
<position>545,495</position>
<value>Find Local Fanart</value>
</button>

<button name="local_banner_button" from="basewidebutton">
<position>545,550</position>
<value>Find Local Banners</value>
</button>

<button name="back" from="basebutton">
<position>590,525</position>
<position>600,640</position>
<value>Back</value>
</button>
</window>
@@ -2113,12 +2113,42 @@
</spinbox>

<button name="query_button" from="basewidebutton">
<position>215,220</position>
<position>265,220</position>
<value>Perform Query</value>
</button>

<button name="online_coverart_button" from="basewidebutton">
<position>115,275</position>
<value>Find Online Coverart</value>
</button>

<button name="online_fanart_button" from="basewidebutton">
<position>115,330</position>
<value>Find Online Fanart</value>
</button>

<button name="online_banner_button" from="basewidebutton">
<position>115,385</position>
<value>Find Online Banners</value>
</button>

<button name="local_coverart_button" from="basewidebutton">
<position>415,275</position>
<value>Find Local Coverart</value>
</button>

<button name="local_fanart_button" from="basewidebutton">
<position>415,330</position>
<value>Find Local Fanart</value>
</button>

<button name="local_banner_button" from="basewidebutton">
<position>415,385</position>
<value>Find Local Banners</value>
</button>

<button name="back" from="basebutton">
<position>40,525</position>
<position>335,500</position>
<value>Back</value>
</button>
</window>

0 comments on commit a683afc

Please sign in to comment.
You can’t perform that action at this time.