Ticket #10375: 0003-use-same-query-in-Program.php-and-recordinginfo.cpp.patch

File 0003-use-same-query-in-Program.php-and-recordinginfo.cpp.patch, 1.8 KB (added by dekarl@…, 12 years ago)

possible fix

  • modules/tv/classes/Program.php

    From 65c0bf7e20136895c603d2828f99341b5d44ea26 Mon Sep 17 00:00:00 2001
    From: Karl Dietz <dekarl@users.sourceforge.net>
    Date: Sat, 4 Aug 2012 20:52:17 +0200
    Subject: [PATCH 3/3] use same query in Program.php and recordinginfo.cpp
    
    the old code only matched via the triple title/subtitle/description
    while the matching in libmythtv also uses programid etc
    
    Refers #10375
    ---
     modules/tv/classes/Program.php |   12 +++++++++---
     1 files changed, 9 insertions(+), 3 deletions(-)
    
    diff --git a/modules/tv/classes/Program.php b/modules/tv/classes/Program.php
    index e79641e..7218b6b 100644
    a b class Program extends MythBase { 
    632632        global $db;
    633633    // The FORGET_RECORDING command requires the specific record to be
    634634    // forgotten, so we have to search for matching rows
    635         $sh = $db->query('SELECT *
     635        $sh = $db->query("SELECT *
    636636                            FROM oldrecorded
    637                            WHERE title=? AND subtitle=? AND description=? AND future = 0',
     637                           WHERE title = ? AND
     638                                 ((programid = '' AND subtitle = ?
     639                                   AND description = ?) OR
     640                                  (programid <> '' AND programid = ?) OR
     641                                  (findid <> 0 AND findid = ?))",
    638642                         $this->title,
    639643                         $this->subtitle,
    640                          $this->description);
     644                         $this->description,
     645                         $this->programid,
     646                         $this->findid);
    641647        while ($row = $sh->fetch_assoc()) {
    642648            $prog =& new Program($row);
    643649            MythBackend::find()->sendCommand(array('FORGET_RECORDING', $prog->backend_row(), '0'));