Ticket #1203: channel-import.patch

File channel-import.patch, 2.1 KB (added by bolek-mythtv@…, 18 years ago)
  • libs/libmythtv/dvbconfparser.cpp

     
    156156    if (i == end || !c.modulation.parseConf(*i++)) return false;
    157157    // We need the program number in the transport stream,
    158158    // otherwise we cannot "tune" to the program.
     159    if (i == end ) return false; else i++;   // Ignore video pid
     160    if (i == end ) return false; else i++;   // Ignore audio pid
    159161    if (i != end) c.serviceid = (*i++).toInt(); else return false;
    160162
    161163    channels.append(c);
     
    458460                  ":NAME,:MPLEXID,:SERVICEID);");
    459461
    460462            query.bindValue(":CHANID",generateNewChanID(sourceid));
    461             query.bindValue(":CHANNUM",(*iter).lcn==-1 ? (*iter).serviceid:(*iter).lcn);
     463            // If the channel number is unknown, leave it at 0,
     464            // possibly to be filled later by mythfilldatabase.
     465            query.bindValue(":CHANNUM", (*iter).lcn==-1 ? 0 : (*iter).lcn);
    462466            query.bindValue(":SOURCEID",sourceid);
    463467            query.bindValue(":CALLSIGN",(*iter).name.utf8());
    464468            query.bindValue(":NAME",(*iter).name.utf8());
  • programs/mythfilldatabase/filldata.cpp

     
    842842            // First check if channel already in DB, but without xmltvid
    843843            query.prepare("SELECT chanid FROM channel "
    844844                          "WHERE sourceid = :SOURCEID AND "
    845                           "      (channum=:CHANNUM OR atscsrcid=:ATSCSRCID)");
     845                          "      (callsign = :CALLSIGN OR "
     846                          "       channum = :CHANNUM OR "
     847                          "       atscsrcid = :ATSCSRCID)");
    846848            query.bindValue(":SOURCEID",  source.id);
     849            query.bindValue(":CALLSIGN",  callsign);
    847850            query.bindValue(":CHANNUM",   channum);
    848851            query.bindValue(":ATSCSRCID", atscsrcid);
    849852