[mythtv-users] Upgraded to 0.27, now metadata is being downloaded

Stephen Worthington stephen_agent at jsw.gen.nz
Wed Sep 25 08:11:26 UTC 2013


On Tue, 24 Sep 2013 14:04:24 +1000, you wrote:

>On 24 September 2013 13:47, Stephen Worthington
><stephen_agent at jsw.gen.nz> wrote:
>> No, this fix did not work at all for me.  I did chmod a-rwsx and chown
>> root:root on the /var/lib/mythtv/fanart directory, and then installed
>> today's 0.27-fixes updates.  But something seems to have changed the
>> ownership and permissions back again - may apt did it when it
>> installed the updates.  In any case, mythmetadatalookup was again
>> downloading and installing artwork.  So maybe your fix will only work
>> on systems where the packages do not set up the /var/lib/mythtv/fanart
>> directory.
>
>not much point discussing tricks around the problem.. better fix the root cause:
>http://code.mythtv.org/trac/ticket/11878#ticket

I think I have tracked down what is going wrong.  In 0.27, the
housekeeping tasks had considerable work done to make them all work in
a properly defined structure.  The ArtworkTask in
backendhouseheeping.cpp is now responsible for running
mythmetadatalookup.  But in the restructuring of the housekeeping
tasks, it seems that the DoCheckRun method was left out of the
ArtworkTask - it should be present and should check on the
settings.AutoMetadataLookup value to decide if the ArtworkTask should
be run or not.  The old version of the housekeeping tasks did have a
check for whether mythmetadatalookup should be run, but it seems to
have been checking for a different settings value,
DailyArtworkUpdates.

I have done very little C++, but I am intending to try the following
patch tomorrow when I have a big enough gap between recordings:

diff --git a/mythtv/programs/mythbackend/backendhousekeeper.cpp
b/mythtv/programs/mythbackend/backendhousekeeper.cpp
old mode 100644
new mode 100755
index e64477e..eb4ebbd
--- a/mythtv/programs/mythbackend/backendhousekeeper.cpp
+++ b/mythtv/programs/mythbackend/backendhousekeeper.cpp
@@ -437,6 +437,13 @@ ArtworkTask::ArtworkTask(void) :
DailyHouseKeeperTask("RecordedArtworkUpdate",
 {
 }

+bool ArtworkTask::DoCheckRun(QDateTime now)
+{
+    if (!gCoreContext->GetNumSetting("AutoMetadataLookup", 1))
+        return false;
+    return DailyHouseKeeperTask::DoCheckRun(now);
+}
+
 bool ArtworkTask::DoRun(void)
 {
     if (m_msMML)
diff --git a/mythtv/programs/mythbackend/backendhousekeeper.h
b/mythtv/programs/mythbackend/backendhousekeeper.h
old mode 100644
new mode 100755
index d24efae..12b2a46
--- a/mythtv/programs/mythbackend/backendhousekeeper.h
+++ b/mythtv/programs/mythbackend/backendhousekeeper.h
@@ -47,6 +47,7 @@ class ArtworkTask : public DailyHouseKeeperTask
     ArtworkTask(void);
     virtual ~ArtworkTask(void);
     bool DoRun(void);
+    virtual bool DoCheckRun(QDateTime now);
     virtual void Terminate(void);
   private:
     MythSystemLegacy *m_msMML;

Since this is my first foray into the MythTV code, there are any
number of things I could be doing wrong, so if anyone spots something,
please let me know.


More information about the mythtv-users mailing list