Skip to content
Browse files

libmythmetadata: Allow lookups using recordingrules.

First step towards doing metadata lookup/artwork picking in the schedule editor.

Bumps the library API.
  • Loading branch information...
1 parent c12e7d7 commit da8c889c8e9dfbe5c767f8965425a8269d90112b Robert McNamara committed
View
2 mythtv/libs/libmythbase/mythversion.h
@@ -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.20110701-3"
+#define MYTH_BINARY_VERSION "0.25.20110702-1"
/** \brief Increment this whenever the MythTV network protocol changes.
*
View
25 mythtv/libs/libmythmetadata/metadatafactory.cpp
@@ -12,6 +12,7 @@
// Input for a lookup
#include "videometadata.h"
#include "programinfo.h"
+#include "recordingrule.h"
#include "metadatafactory.h"
@@ -48,6 +49,28 @@ MetadataFactory::~MetadataFactory()
}
}
+void MetadataFactory::Lookup(RecordingRule *recrule, bool automatic,
+ bool getimages)
+{
+ if (!recrule)
+ return;
+
+ MetadataLookup *lookup = new MetadataLookup();
+ lookup->SetStep(SEARCH);
+ lookup->SetType(VID);
+ lookup->SetData(qVariantFromValue(recrule));
+ lookup->SetAutomatic(automatic);
+ lookup->SetHandleImages(getimages);
+ lookup->SetHost(gCoreContext->GetMasterHostName());
+ lookup->SetTitle(recrule->m_title);
+ lookup->SetSubtitle(recrule->m_subtitle);
+
+ if (m_lookupthread->isRunning())
+ m_lookupthread->prependLookup(lookup);
+ else
+ m_lookupthread->addLookup(lookup);
+}
+
void MetadataFactory::Lookup(ProgramInfo *pginfo, bool automatic,
bool getimages)
{
@@ -60,7 +83,7 @@ void MetadataFactory::Lookup(ProgramInfo *pginfo, bool automatic,
lookup->SetData(qVariantFromValue(pginfo));
lookup->SetAutomatic(automatic);
lookup->SetHandleImages(getimages);
- lookup->SetHost(pginfo->GetHostname());
+ lookup->SetHost(gCoreContext->GetMasterHostName());
lookup->SetTitle(pginfo->GetTitle());
lookup->SetSubtitle(pginfo->GetSubtitle());
View
3 mythtv/libs/libmythmetadata/metadatafactory.h
@@ -10,6 +10,7 @@
#include "mythmetaexp.h"
class VideoMetadata;
+class RecordingRule;
class META_PUBLIC MetadataFactoryMultiResult : public QEvent
{
@@ -59,6 +60,8 @@ class META_PUBLIC MetadataFactory : public QObject
bool getimages = true);
void Lookup(VideoMetadata *metadata, bool automatic = true,
bool getimages = true);
+ void Lookup(RecordingRule *recrule, bool automatic = true,
+ bool getimages = true);
void Lookup(MetadataLookup *lookup);
bool IsRunning() { return m_lookupthread->isRunning() ||

0 comments on commit da8c889

Please sign in to comment.
Something went wrong with that request. Please try again.