Ticket #5234: out_fix_xmltv_grabber.diff

File out_fix_xmltv_grabber.diff, 1.6 KB (added by laurent@…, 18 years ago)

The patch

  • programs/mythfilldatabase/channeldata.cpp

     
    376377                {
    377378                    QStringList words = QStringList::split(" ",
    378379                                        (*i).name.simplifyWhiteSpace().upper());
    379                     QString callsign = "";
    380                     if (words[0].isEmpty())
     380
     381                                        QString callsign = "";
     382
     383                    if (words.count()<=0 || words[0].isEmpty())
    381384                        callsign = QString::number(chanid);
    382                     else if (words[1].isEmpty())
     385                    else if (words.count()<=1 || words[1].isEmpty())
    383386                        callsign = words[0].left(5);
    384387                    else
    385                     {
     388                    {   
    386389                        callsign = words[0].left(words[1].length() == 1 ? 4:3);
    387390                        callsign += words[1].left(5 - callsign.length());
    388391                    }
    389392                    (*i).callsign = callsign;
     393
    390394                }
    391395
     396
    392397                if (chanid > 0)
    393398                {
    394399                    QString cstr = QString((*i).chanstr);
    395400                    if(channel_preset && cstr.isEmpty())
    396401                        cstr = QString::number(chanid % 1000);
    397402
     403   
    398404                    ChannelUtil::CreateChannel(
    399405                        mplexid,          id,        chanid,
    400406                        (*i).callsign,    (*i).name, cstr,