From e070b4ff174972646c3808e0a2f50ebf6de4b6ce Mon Sep 17 00:00:00 2001 From: Paul Harrison Date: Wed, 11 Nov 2015 21:38:21 +0000 Subject: [PATCH] MetadataLookupList: add lookup from mxml and nfo files for television files We already looked for them first when looking for metadata for movies so also look for them for television files as well first then fall back to the grabber scripts etc. --- .../libs/libmythmetadata/metadatadownload.cpp | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/mythtv/libs/libmythmetadata/metadatadownload.cpp b/mythtv/libs/libmythmetadata/metadatadownload.cpp index 14bf08a3ed4..c8866542122 100644 --- a/mythtv/libs/libmythmetadata/metadatadownload.cpp +++ b/mythtv/libs/libmythmetadata/metadatadownload.cpp @@ -540,15 +540,35 @@ MetadataLookupList MetadataDownload::handleMovie(MetadataLookup *lookup) /** * handleTelevision * attempt to find television data via the following (in order) - * 1- By inetref with subtitle - * 2- By inetref with season and episode - * 3- By inetref - * 4- By title and subtitle - * 5- By title + * 1- Local MXML + * 2- Local NFO + * 3- By inetref with subtitle + * 4- By inetref with season and episode + * 5- By inetref + * 6- By title and subtitle + * 7- By title */ MetadataLookupList MetadataDownload::handleTelevision(MetadataLookup *lookup) { MetadataLookupList list; + + QString mxml; + QString nfo; + + if (!lookup->GetFilename().isEmpty()) + { + mxml = getMXMLPath(lookup->GetFilename()); + nfo = getNFOPath(lookup->GetFilename()); + } + + if (!mxml.isEmpty()) + list = readMXML(mxml, lookup); + else if (!nfo.isEmpty()) + list = readNFO(nfo, lookup); + + if (!list.isEmpty()) + return list; + MetaGrabberScript grabber = MetaGrabberScript::GetGrabber(kGrabberTelevision, lookup); bool searchcollection = false;