Skip to content

Commit 73518d5

Browse files
author
Bruce Markey
committed
Added a "Watch List" feature to the Watch Recordings page. This
creates a list of the recordings that would be most useful to watch in order to catch up on series and shows where I may have fallen behind. Choosing to watch and delete things from the top of this list would help me stay on top of things efficiently without having to examine the full recording list to try to identify these and without overlooking something. Settings options can be found on the 5th page of TV Settings->Playback. There is some verbose info about the filtering and scoring when using "mythfrontend -v file". This is turned on by default for now in order to encourage feedback. However, it may default to off for release if it is believed to be confusing to many users. git-svn-id: http://svn.mythtv.org/svn/trunk@11310 7dbf422c-18fa-0310-86e9-fd20926502f2
1 parent 3f30244 commit 73518d5

File tree

4 files changed

+358
-34
lines changed

4 files changed

+358
-34
lines changed

mythtv/libs/libmythtv/programinfo.cpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,6 +1874,18 @@ void ProgramInfo::SetWatchedFlag(bool watchedFlag) const
18741874

18751875
if (!query.exec() || !query.isActive())
18761876
MythContext::DBError("Set watched flag", query);
1877+
1878+
query.prepare("UPDATE record SET last_delete = :TIME "
1879+
"WHERE recordid = :RECORDID");
1880+
query.bindValue(":RECORDID", recordid);
1881+
1882+
if (watchedFlag)
1883+
query.bindValue(":TIME", QDateTime::currentDateTime());
1884+
else
1885+
query.bindValue(":TIME", "0000-00-00T00:00:00");
1886+
1887+
if (!query.exec() || !query.isActive())
1888+
MythContext::DBError("Update last_delete", query);
18771889
}
18781890

18791891
/** \fn ProgramInfo::IsEditing(void) const
@@ -3582,12 +3594,15 @@ void ProgramInfo::showDetails(void) const
35823594
}
35833595
if (recorded)
35843596
{
3585-
QString tmpSize;
3597+
if (recpriority2)
3598+
ADD_PAR(QObject::tr("Watch List Score"),
3599+
QString("%1").arg(recpriority2), msg)
3600+
3601+
ADD_PAR(QObject::tr("Recording Host"), hostname, msg)
35863602

3603+
QString tmpSize;
35873604
tmpSize.sprintf("%0.2f ", filesize / 1024.0 / 1024.0 / 1024.0);
35883605
tmpSize += QObject::tr("GB", "GigaBytes");
3589-
3590-
ADD_PAR(QObject::tr("Recording Host"), hostname, msg)
35913606
ADD_PAR(QObject::tr("Recorded File Size"), tmpSize, msg)
35923607

35933608
query.prepare("SELECT profile FROM recorded"

mythtv/programs/mythfrontend/globalsettings.cpp

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2643,6 +2643,79 @@ class DefaultViewSettings: public VerticalConfigurationGroup,
26432643
}
26442644
};
26452645

2646+
static HostCheckBox *PlaybackWatchList()
2647+
{
2648+
HostCheckBox *gc = new HostCheckBox("PlaybackWatchList");
2649+
gc->setLabel(QObject::tr("Include the 'Watch List' group"));
2650+
gc->setValue(true);
2651+
gc->setHelpText(QObject::tr("The 'Watch List' is an abbreviated list of "
2652+
"recordings sorted to highlight series and "
2653+
"shows that need attention in order to "
2654+
"keep up to date."));
2655+
return gc;
2656+
}
2657+
2658+
static HostCheckBox *PlaybackWLAutoExpire()
2659+
{
2660+
HostCheckBox *gc = new HostCheckBox("PlaybackWLAutoExpire");
2661+
gc->setLabel(QObject::tr("Exclude recordings not set for Auto-Expire"));
2662+
gc->setValue(false);
2663+
gc->setHelpText(QObject::tr("Set this if you turn off auto-expire only "
2664+
"for recordings that you've seen and intend "
2665+
"to keep. This option will exclude these "
2666+
"recordings from the 'Watch List'."));
2667+
return gc;
2668+
}
2669+
2670+
static HostSpinBox *PlaybackWLMaxAge()
2671+
{
2672+
HostSpinBox *gs = new HostSpinBox("PlaybackWLMaxAge", 30, 180, 10);
2673+
gs->setLabel(QObject::tr("Maximum days counted in the score"));
2674+
gs->setValue(60);
2675+
gs->setHelpText(QObject::tr("The 'Watch List' scores are based on 1 point "
2676+
"equals one day since recording. This option "
2677+
"limits the maximum score due to age and "
2678+
"affects other weighting factors."));
2679+
return gs;
2680+
}
2681+
2682+
static HostSpinBox *PlaybackWLBlackOut()
2683+
{
2684+
HostSpinBox *gs = new HostSpinBox("PlaybackWLBlackOut", 1, 3, 1);
2685+
gs->setLabel(QObject::tr("Days to exclude weekly episodes after delete"));
2686+
gs->setValue(2);
2687+
gs->setHelpText(QObject::tr("When an episode is deleted or marked as "
2688+
"watched, other episodes of the series are "
2689+
"excluded from the 'Watch List' for this "
2690+
"interval of time. Daily shows also have a "
2691+
"smaller interval based on this setting."));
2692+
return gs;
2693+
}
2694+
2695+
class WatchListSettings: public VerticalConfigurationGroup,
2696+
public TriggeredConfigurationGroup {
2697+
public:
2698+
WatchListSettings():
2699+
ConfigurationGroup(false, true, false, false),
2700+
VerticalConfigurationGroup(false, true, false, false),
2701+
TriggeredConfigurationGroup(false) {
2702+
setLabel(QObject::tr("View Recordings (Watch List)"));
2703+
setUseLabel(false);
2704+
2705+
Setting* watchList = PlaybackWatchList();
2706+
addChild(watchList);
2707+
setTrigger(watchList);
2708+
2709+
ConfigurationGroup* settings = new VerticalConfigurationGroup(false);
2710+
settings->addChild(PlaybackWLAutoExpire());
2711+
settings->addChild(PlaybackWLMaxAge());
2712+
settings->addChild(PlaybackWLBlackOut());
2713+
addTarget("1", settings);
2714+
2715+
addTarget("0", new VerticalConfigurationGroup(true));
2716+
};
2717+
};
2718+
26462719
static HostCheckBox *PVR350OutputEnable()
26472720
{
26482721
HostCheckBox *gc = new HostCheckBox("PVR350OutputEnable");
@@ -3484,6 +3557,8 @@ PlaybackSettings::PlaybackSettings()
34843557
pbox2->addChild(new DefaultViewSettings());
34853558
addChild(pbox2);
34863559

3560+
addChild(new WatchListSettings());
3561+
34873562
addChild(new HwDecSettings());
34883563

34893564
VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false);

0 commit comments

Comments
 (0)