Index: myth.find_orphans.pl
===================================================================
--- myth.find_orphans.pl	(Revision 20211)
+++ myth.find_orphans.pl	(Arbeitskopie)
@@ -58,6 +58,7 @@
 my $opt_help =		0;
 my $opt_dryrun = 	0;
 my $opt_rerecord = 	0;
+my $opt_nopass = 	0;
 
 GetOptions(
         'host=s'	=> \$opt_host,
@@ -73,7 +74,8 @@
         'debug+'	=> \$debug,
         'help'		=> \$opt_help,
         'h'		=> \$opt_help,
-        'v'		=> \$opt_help);
+        'v'		=> \$opt_help,
+        'nopass'	=> \$opt_nopass);
 
 if ($opt_help) {
 	print<<EOF
@@ -86,6 +88,7 @@
 	--database=(dbname)	MythTV database ($opt_database)
 	--user=(user)		MySQL MythTV database user ($opt_user)
 	--pass=(pass)		MySQL MythTV database password ($opt_pass)
+	--nopass		MySQL MythTV database is using no password
 	--dir=directories	manually specify recording directories (otherwise setting is from database)
 	--debug			increase debug level
 	--dodbdelete		remove recorded db entries with no matching file (default: don't)
@@ -111,6 +114,10 @@
 my $known_size = 0;
 my $unknown_thumbnail = 0;
 
+if ($opt_nopass) {
+    $opt_pass = "";
+}
+
 if (!($dbh = DBI->connect("dbi:mysql:database=$opt_database:host=$opt_dbhost","$opt_user","$opt_pass"))) {
 	die "Cannot connect to database $opt_database on host $opt_dbhost: $!\n";
 }
@@ -151,7 +158,7 @@
 		$missing_recordings++;
 
 		if ($opt_dodbdelete) {
-			my $sql = sprintf "DELETE FROM oldrecorded WHERE title LIKE \"%s\" AND subtitle LIKE \"%s\" AND description LIKE \"%s\" LIMIT 1", $title, $subtitle, $description;
+			my $sql = sprintf "DELETE FROM oldrecorded WHERE starttime = \"%s\" AND endtime = \"%s\" AND chanid = \"%s\" LIMIT 1", $starttime, $endtime, $channel;
 			printf "unmarking program as recorded: %s\n",$sql;
 			$dbh->do($sql) || die "Could not execute $sql: $!\n";
 			my $sql = sprintf "DELETE FROM recorded WHERE basename LIKE \"%s\" LIMIT 1",$basename;
