Ticket #5251: watch-weight-expire_v2.diff
File watch-weight-expire_v2.diff, 4.0 KB (added by , 13 years ago) |
---|
-
mythtv/programs/mythfrontend/globalsettings.cpp
961 961 bc->setLabel(QObject::tr("Auto-Expire method")); 962 962 bc->addSelection(QObject::tr("Oldest show first"), "1"); 963 963 bc->addSelection(QObject::tr("Lowest priority first"), "2"); 964 bc->addSelection(QObject::tr("Weighted time/priority combination"), "3"); 964 bc->addSelection(QObject::tr("Weighted time/priority/watched combination"), 965 "3"); 965 966 bc->setHelpText(QObject::tr("Method used to determine which recorded " 966 967 "shows to delete first. Live TV recordings will always " 967 968 "expire before normal recordings.")); … … 976 977 bc->setValue(false); 977 978 bc->setHelpText(QObject::tr("If enabled, programs that have been marked as " 978 979 "watched will be expired before programs that have not " 979 "been watched.")); 980 "been watched. Does not apply to Weighted " 981 "time/priority/watched Auto-Expire method " 982 "(use watched weight instead).")); 983 980 984 return bc; 981 985 } 982 986 … … 986 990 bs->setLabel(QObject::tr("Priority weight")); 987 991 bs->setHelpText(QObject::tr("The number of days bonus a program gets for " 988 992 "each priority point. This is only used when the Weighted " 989 "time/priority Auto-Expire method is selected."));993 "time/priority/watched Auto-Expire method is selected.")); 990 994 bs->setValue(3); 991 995 return bs; 992 996 }; 993 997 998 static GlobalSpinBox *AutoExpireWatchedWeight() 999 { 1000 GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireWatchedWeight", 1, 400, 1); 1001 bs->setLabel(QObject::tr("Watched Weight")); 1002 bs->setHelpText(QObject::tr("The number of days fewer a program gets when " 1003 "it is marked as watched. This is only used when the " 1004 "Weighted time/priority/watched Auto-Expire method " 1005 "is selected.")); 1006 bs->setValue(14); 1007 return bs; 1008 }; 1009 994 1010 static GlobalCheckBox *AutoExpireDefault() 995 1011 { 996 1012 GlobalCheckBox *bc = new GlobalCheckBox("AutoExpireDefault"); … … 4299 4315 new VerticalConfigurationGroup(false, false, true, true); 4300 4316 expgrp1->addChild(AutoExpireLiveTVMaxAge()); 4301 4317 expgrp1->addChild(AutoExpireDayPriority()); 4318 expgrp1->addChild(AutoExpireWatchedWeight()); 4302 4319 expgrp1->addChild(AutoExpireExtraSpace()); 4303 4320 4304 4321 HorizontalConfigurationGroup *expgrp = -
mythtv/programs/mythbackend/autoexpire.cpp
902 902 case emWeightedTimePriority: 903 903 msg = "Adding programs expirable in Weighted Time Priority order"; 904 904 where = "autoexpire > 0"; 905 if (gCoreContext->GetNumSetting("AutoExpireWatchedPriority", 0)) 906 orderby = "recorded.watched DESC, "; 907 orderby += QString("DATE_ADD(starttime, INTERVAL '%1' * " 908 "recorded.recpriority DAY) ASC") 909 .arg(gCoreContext->GetNumSetting("AutoExpireDayPriority", 3)); 905 orderby = 906 QString("starttime" 907 " + INTERVAL '%1' * recorded.recpriority DAY" 908 " - INTERVAL '%2' * recorded.watched DAY" 909 " ASC") 910 .arg(gCoreContext->GetNumSetting("AutoExpireDayPriority", 3)) 911 .arg(gCoreContext->GetNumSetting("AutoExpireWatchedWeight", 912 14)); 910 913 break; 911 914 case emShortLiveTVPrograms: 912 915 msg = "Adding Short LiveTV programs in starttime order";