Ticket #1657: ignoreincomplete.patch

File ignoreincomplete.patch, 7.0 KB (added by ajlill@…, 15 years ago)
  • libs/libmythtv/scheduledrecording.h

     
    2828class SRAutoUserJob3;
    2929class SRAutoUserJob4;
    3030class SRAutoExpire;
     31class SRIgnoreIncomplete;
    3132class SRStartOffset;
    3233class SREndOffset;
    3334class SRMaxEpisodes;
     
    7677    int GetAutoExpire(void) const;
    7778    void SetAutoExpire(int expire);
    7879
     80    int GetIgnoreIncomplete(void) const;
     81    void SetIgnoreIncomplete(int expire);
     82
    7983    int GetMaxEpisodes(void) const;
    8084    bool GetMaxNewest(void) const;
    8185
     
    143147    void setAutoUserJob3Obj(SRAutoUserJob3* val) {autouserjob3 = val;}
    144148    void setAutoUserJob4Obj(SRAutoUserJob4* val) {autouserjob4 = val;}
    145149    void setAutoExpireObj(SRAutoExpire* val) {autoexpire = val;}
     150    void setIgnoreIncompleteObj(SRIgnoreIncomplete* val) {ignoreincomplete = val;}
    146151    void setStartOffsetObj(SRStartOffset* val) {startoffset = val;}
    147152    void setEndOffsetObj(SREndOffset* val) {endoffset = val;}
    148153    void setMaxEpisodesObj(SRMaxEpisodes* val) {maxepisodes = val;}
     
    211216    class SRAutoUserJob3* autouserjob3;
    212217    class SRAutoUserJob4* autouserjob4;
    213218    class SRAutoExpire* autoexpire;
     219    class SRIgnoreIncomplete* ignoreincomplete;
    214220    class SRStartOffset* startoffset;
    215221    class SREndOffset* endoffset;
    216222    class SRMaxEpisodes* maxepisodes;
  • libs/libmythtv/sr_items.cpp

     
    2828    addItem(dupLocItem->getItem(), -1);
    2929    connect(dupMethItem->getItem(), SIGNAL(changed(ManagedListItem*)), this, SLOT(itemChanged(ManagedListItem*)));
    3030
     31    ignoreIncomplete = new SRIgnoreIncomplete(_rec, this, parentList);
     32    addItem(ignoreIncomplete->getItem(), -1);
     33
    3134    inactive = new SRInactive(_rec, this, _parentList);
    3235    addItem(inactive->getItem(), -1);
    3336}
  • libs/libmythtv/sr_items.h

     
    336336        class SREndOffset* endOffset;
    337337        class SRDupMethod* dupMethItem;
    338338        class SRDupIn* dupLocItem;
     339        class SRIgnoreIncomplete* ignoreIncomplete;
    339340
    340341        ScheduledRecording *schedRec;
    341342};
     
    687688        }
    688689};
    689690
     691class SRIgnoreIncomplete: public SRBoolSetting
     692{
     693    public:
     694        SRIgnoreIncomplete(ScheduledRecording *_parent, ManagedListGroup* _group, ManagedList* _list)
     695                    : SRBoolSetting(_parent, QObject::tr("Ignore generic episodes"),
     696                                     QObject::tr("Record generic episodes"),
     697                                    "ignoreIncompleteItem", "ignoreincomplete", _group, _list )
     698        {
     699            _parent->setIgnoreIncompleteObj(this);
     700        }
     701};
     702
    690703class SRInactive: public SRBoolSetting
    691704{
    692705    public:
  • libs/libmythtv/scheduledrecording.cpp

     
    2929    dupin = NULL;
    3030    dupmethod = NULL;
    3131    autoexpire = NULL;
     32    ignoreincomplete = NULL;
    3233    autotranscode = NULL;
    3334    transcoder = NULL;
    3435    autocommflag = NULL;
     
    398399    autoexpire->setValue(expire);
    399400}
    400401
     402int ScheduledRecording::GetIgnoreIncomplete(void) const {
     403    return(ignoreincomplete->getValue().toInt());
     404}
     405
     406void ScheduledRecording::SetIgnoreIncomplete(int expire) {
     407    ignoreincomplete->setValue(expire);
     408}
     409
    401410int ScheduledRecording::GetTranscoder(void) const {
    402411    return transcoder->getValue().toInt();
    403412}
     
    450459        MSqlQuery query(MSqlQuery::InitCon());
    451460        query.prepare(
    452461            "UPDATE recorded "
    453                 "SET recpriority = :RECPRIORITY, recgroup = :RECGROUP, "
     462                "SET recpriority = :RECPRIORITY, "
     463            // "recgroup = :RECGROUP, "
    454464                    "transcoder = :TRANSCODER, playgroup = :PLAYGROUP "
    455465                "WHERE recordid = :RECORDID ;");
    456466        query.bindValue(":RECPRIORITY", getRecPriority());
    457         query.bindValue(":RECGROUP", recgroup->getValue());
     467        //        query.bindValue(":RECGROUP", recgroup->getValue());
    458468        query.bindValue(":TRANSCODER", transcoder->getValue().toInt());
    459469        query.bindValue(":PLAYGROUP", playgroup->getValue());
    460470        query.bindValue(":RECORDID", getRecordID());
     
    788798    recpriority->setValue(0);
    789799   
    790800    autoexpire->setValue(gContext->GetNumSetting("AutoExpireDefault", 0));
     801    ignoreincomplete->setValue(gContext->GetNumSetting("IgnoreIncompleteDefault", 0));
    791802
    792803    autotranscode->setValue(gContext->GetNumSetting("AutoTranscode", 0));
    793804    transcoder->fillSelections();
     
    873884    dupin->setChanged();
    874885    dupmethod->setChanged();
    875886    autoexpire->setChanged();
     887    ignoreincomplete->setChanged();
    876888    autotranscode->setChanged();
    877889    autocommflag->setChanged();
    878890    autouserjob1->setChanged();
  • programs/mythbackend/scheduler.cpp

     
    20062005"program.airdate, program.stars, program.originalairdate, RECTABLE.inactive, "
    20072006"RECTABLE.parentid, ") + progfindid + ", RECTABLE.playgroup, "
    20082007"oldrecstatus.recstatus, oldrecstatus.reactivate, "
    2009 "channel.recpriority + cardinput.preference "
     2008"channel.recpriority + cardinput.preference, "
     2009"RECTABLE.ignoreincomplete, program.generic "
    20102010+ QString(
    20112011"FROM recordmatch "
    20122012
     
    21022102    }
    21032103
    21042104    VERBOSE(VB_SCHEDULE, QString(" |-- %1 results in %2 sec. Processing...")
    2105             .arg(result.size())
     2105            .arg((unsigned long)result.size())
    21062106            .arg(((dbend.tv_sec  - dbstart.tv_sec) * 1000000 +
    21072107                  (dbend.tv_usec - dbstart.tv_usec)) / 1000000.0));
    21082108
     
    22232223                 !p->reactivate &&
    22242224                 !(p->dupmethod & kDupCheckNone))
    22252225        {
    2226             if (p->dupin == kDupsNewEpi && p->repeat)
     2226          QRegExp exp(".*0000");
     2227          QString series("series");
     2228
     2229             if (p->dupin == kDupsNewEpi && p->repeat)
    22272230                p->recstatus = rsRepeat;
     2231             
     2232             // If we want to ignore episodes in series with bogus data.
     2233             // Unfortunately the 'generic' flag doesn't seem to work,
     2234             // perhaps because of generic descriptions
     2235            if (result.value(40).toInt() && p->category.compare(series) && p->programid.contains(exp)) {
     2236              if( (p->dupmethod & 0x2 && p->subtitle.isEmpty()) ||
     2237                  (p->dupmethod & 0x4 && p->description.isEmpty()) )
     2238                p->recstatus = rsRepeat;
     2239            }
    22282240
     2241            /* findduplicate */
    22292242            if (((p->dupin & kDupsInOldRecorded) || (p->dupin == kDupsNewEpi)) &&
    22302243                result.value(10).toInt())
    22312244                p->recstatus = rsPreviousRecording;