Ticket #1008: time-pri-expire.diff
File time-pri-expire.diff, 3.7 KB (added by , 18 years ago) |
---|
-
programs/mythfrontend/globalsettings.cpp
522 522 bc->setLabel(QObject::tr("Auto Expire Method")); 523 523 bc->addSelection(QObject::tr("Oldest Show First"), "1"); 524 524 bc->addSelection(QObject::tr("Lowest Priority First"), "2"); 525 bc->addSelection(QObject::tr("Time/Priority Tradeoff"), "3"); 525 526 bc->setHelpText(QObject::tr("Method used to determine which recorded " 526 527 "shows to delete first. LiveTV recordings " 527 528 "will always expire before normal " … … 530 531 return bc; 531 532 } 532 533 534 static GlobalSpinBox *AutoExpireDayPriority() 535 { 536 GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireDayPriority", 1, 400, 1); 537 bs->setLabel(QObject::tr("Auto Expire Priority Weight")); 538 bs->setHelpText(QObject::tr( 539 "The number of days bonus a program " 540 "gets for each priority point. " 541 "This is only used when Time/Priority tradeoff " 542 "is selected for the auto expire method.")); 543 bs->setValue(3); 544 return bs; 545 }; 546 533 547 static GlobalCheckBox *AutoExpireDefault() 534 548 { 535 549 GlobalCheckBox *bc = new GlobalCheckBox("AutoExpireDefault"); … … 3148 3162 general->addChild(SmartChannelChange()); 3149 3163 general->addChild(LastFreeCard()); 3150 3164 general->addChild(AutoExpireMethod()); 3165 general->addChild(AutoExpireDayPriority()); 3151 3166 general->addChild(AutoExpireDefault()); 3152 3167 general->addChild(AutoExpireLiveTVMaxAge()); 3153 3168 addChild(general); -
programs/mythbackend/autoexpire.cpp
590 590 { 591 591 case emOldestFirst: 592 592 case emLowestPriorityFirst: 593 case emTimePriorityTradeoff: 593 594 FillDBOrdered(expMethod); 594 595 break; 595 596 // default falls through so list is empty so no AutoExpire … … 677 678 where = "autoexpire > 0"; 678 679 orderby = "recorded.recpriority ASC, starttime ASC"; 679 680 break; 681 case emTimePriorityTradeoff: 682 where = "autoexpire > 0"; 683 orderby = QString("DATE_ADD(starttime, INTERVAL '%1' * recorded.recpriority DAY) ASC") 684 .arg(gContext->GetNumSetting("AutoExpireDayPriority", 3)); 685 break; 680 686 case emShortLiveTVPrograms: 681 687 where = "recgroup = 'LiveTV' " 682 688 "AND endtime < DATE_ADD(starttime, INTERVAL '2' MINUTE) " … … 703 709 " title, subtitle, description, " 704 710 " hostname, channum, name, " 705 711 " callsign, seriesid, programid, " 706 " recorded. recpriority,progstart, "712 " recorded.recpriority, progstart, " 707 713 " progend, filesize " 708 714 "FROM recorded " 709 715 "LEFT JOIN channel ON recorded.chanid = channel.chanid " -
programs/mythbackend/autoexpire.h
21 21 enum ExpireMethodType { 22 22 emOldestFirst = 1, 23 23 emLowestPriorityFirst = 2, 24 emTimePriorityTradeoff = 3, 24 25 emShortLiveTVPrograms = 10000, 25 26 emNormalLiveTVPrograms = 10001 26 27 };