[mythtv] Service API for updating videosource is removing existing data?

Robert Kulagowski rkulagow at gmail.com
Wed Dec 9 04:23:08 UTC 2015


This is the state of the videosource table "before":

mysql> select sourceid,name,xmltvgrabber,userid,freqtable,lineupid,useeit,configpath,dvb_nit_id
from videosource\G
*************************** 1. row ***************************
    sourceid: 1
        name: DirecTV
xmltvgrabber: schedulesdirect-json
      userid: rkulagow at rocketmail.com
   freqtable: default
    lineupid: USA-DITV501-DEFAULT
      useeit: 0
  configpath: NULL
  dvb_nit_id: -1
*************************** 2. row ***************************
    sourceid: 6
        name: Test5
xmltvgrabber: schedulesdirect-json
      userid: rkulagow at rocketmail.com
   freqtable: default
    lineupid: NULL
      useeit: 0
  configpath: NULL
  dvb_nit_id: -1
2 rows in set (0.00 sec)

Then I make the following call:

if ($useServiceAPI===true)
{
$request = $client->post("http://$host:6544/Channel/UpdateVideoSource")
        ->setPostField("SourceID", $res["VideoSource"]["Id"])
        ->setPostField("LineupId", $lineup);

    $response = $request->send();
// TODO: Check for error
} else {
    $stmt = $dbh->prepare("UPDATE videosource SET lineupid=:lineup
WHERE sourceid=:sid");
    $stmt->execute(array("lineup" => $lineup, "sid" => $sid));
}

And the result is:
mysql> select sourceid,name,xmltvgrabber,userid,freqtable,lineupid,useeit,configpath,dvb_nit_id
from videosource\G
*************************** 1. row ***************************
    sourceid: 1
        name: DirecTV
xmltvgrabber: schedulesdirect-json
      userid: rkulagow at rocketmail.com
   freqtable: default
    lineupid: USA-DITV501-DEFAULT
      useeit: 0
  configpath: NULL
  dvb_nit_id: -1
*************************** 2. row ***************************
    sourceid: 6
        name:
xmltvgrabber: NULL
      userid:
   freqtable:
    lineupid: USA-OTA-10001
      useeit: 0
  configpath: NULL
  dvb_nit_id: 0
2 rows in set (0.00 sec)

The data for sourceID 6 has been reset to default values? Is that the
intended effect? That updating a single field (and not re-specifying
data for all the other fields, which were _just_ created using the
AddVideosource method) is means that the record is going to get wiped?
Because in that case it's probably easier to avoid updates and just do
a delete / add?


More information about the mythtv-dev mailing list