-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The current behaviour appears to be if the file of a recording doesn't
exist then the backend will refuse to remove the data from the database.
I can't see any sense in this, what else would you want to do with
useless metadata?
How else do I get rid of these darn empty programs?

Patch attched leaves the "file didn't exist" warning in, but now removes
the metadata too.

It's trivial, but hasn't been tested more than once
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFCE70MyPEuXJ2RxGYRAnp+AJwIDn/cCs8CLk/PSRKCv/GaDlDd+wCgkR5w
TzvORLsjTKKYUxg9bhAEo0M=
=Zgto
-----END PGP SIGNATURE-----
--- programs/mythbackend/mainserver.cpp.old     2005-02-16 21:09:47.867547495 +0000
+++ programs/mythbackend/mainserver.cpp 2005-02-16 21:22:29.132280108 +0000
@@ -1005,15 +1005,14 @@
     if (!checkFile.exists())
     {
         VERBOSE(VB_ALL, QString("ERROR when trying to delete file: %1. File "
-                                "doesn't exist.  Database metadata"
-                                "will not be removed.")
+                                "doesn't exist.  Only removing database"
+                                "metadata.")
                                 .arg(ds->filename));
         gContext->LogEntry("mythbackend", LP_WARNING, "Delete Recording",
                            QString("File %1 does not exist for %2 when trying "
                                    "to delete recording.")
                                    .arg(ds->filename).arg(logInfo));
         deletelock.unlock();
-        return;
     }

     MythSqlDatabase *delete_db = new MythSqlDatabase(name);
@@ -1469,12 +1468,18 @@
                               .arg(pginfo->recstartts.toString());
         VERBOSE(VB_ALL,
                 QString("ERROR when trying to delete file: %1. File doesn't "
-                        "exist.  Database metadata will not be removed.")
+                        "exist.  Only database metadata will be removed.")
                         .arg(filename));
         gContext->LogEntry("mythbackend", LP_WARNING, "Delete Recording",
                            QString("File %1 does not exist for %2 when trying "
                                    "to delete recording.")
                                    .arg(filename).arg(logInfo));
+
+        dblock.lock();
+        MythContext::KickDatabase(m_db);
+        pginfo->SetDeleteFlag(true, m_db);
+        dblock.unlock();
+
     }

     if (pbssock)

_______________________________________________
mythtv-dev mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

Reply via email to