From 773392b25789ccb50da1e48a1351fa6077b83620 Mon Sep 17 00:00:00 2001
From: Roger Siddons <dizygotheca@ntlworld.com>
Date: Thu, 2 Oct 2014 23:23:17 +0100
Subject: [PATCH 1/6] Watchlist: Group by title rather than recording rule
diff --git a/mythtv/programs/mythfrontend/playbackbox.cpp b/mythtv/programs/mythfrontend/playbackbox.cpp
index b9b299d..8abc2ea 100644
a
|
b
|
static bool extract_one_del( |
367 | 367 | return chanid && recstartts.isValid(); |
368 | 368 | } |
369 | 369 | |
| 370 | static QString extract_watchlist_title(ProgramInfo &pginfo) |
| 371 | { |
| 372 | // ignore punctuation & whitespace |
| 373 | QRegExp watchtitleChaff("\\W"); |
| 374 | return pginfo.GetTitle().remove(watchtitleChaff); |
| 375 | } |
| 376 | |
370 | 377 | void * PlaybackBox::RunPlaybackBox(void * player, bool showTV) |
371 | 378 | { |
372 | 379 | MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); |
… |
… |
bool PlaybackBox::UpdateUILists(void) |
1632 | 1639 | |
1633 | 1640 | QMap<QString, QString> sortedList; |
1634 | 1641 | QMap<int, QString> searchRule; |
1635 | | QMap<int, int> recidEpisodes; |
| 1642 | QMap<QString, int> watchlistCount; |
1636 | 1643 | |
1637 | 1644 | m_programInfoCache.Refresh(); |
1638 | 1645 | |
… |
… |
bool PlaybackBox::UpdateUILists(void) |
1779 | 1786 | } |
1780 | 1787 | else |
1781 | 1788 | { |
1782 | | if (p->GetRecordingRuleID()) |
1783 | | recidEpisodes[p->GetRecordingRuleID()] += 1; |
1784 | | if (recidEpisodes[p->GetRecordingRuleID()] == 1 || |
1785 | | !p->GetRecordingRuleID()) |
| 1789 | QString title = extract_watchlist_title(*p); |
| 1790 | ++watchlistCount[title]; |
| 1791 | if (watchlistCount[title] == 1) |
1786 | 1792 | { |
1787 | 1793 | m_progLists[m_watchGroupLabel].push_front(p); |
1788 | 1794 | m_progLists[m_watchGroupLabel].setAutoDelete(false); |
… |
… |
bool PlaybackBox::UpdateUILists(void) |
1941 | 1947 | else |
1942 | 1948 | { |
1943 | 1949 | (*pit)->SetRecordingPriority2( |
1944 | | (recidEpisodes[(*pit)->GetRecordingRuleID()] - 1) * |
| 1950 | (watchlistCount[extract_watchlist_title(**pit)] - 1) * |
1945 | 1951 | baseValue); |
1946 | 1952 | } |
1947 | 1953 | |
diff --git a/mythtv/programs/mythfrontend/playbackbox.h b/mythtv/programs/mythfrontend/playbackbox.h
index a88439e..25964bb 100644
a
|
b
|
class PlaybackBox : public ScheduleCommon |
359 | 359 | bool m_watchListStart; |
360 | 360 | /// exclude recording not marked for auto-expire from the Watch List |
361 | 361 | bool m_watchListAutoExpire; |
362 | | /// add 1 to the Watch List scord up to this many days |
| 362 | /// add 1 to the Watch List score up to this many days |
363 | 363 | int m_watchListMaxAge; |
364 | 364 | /// adjust exclusion of a title from the Watch List after a delete |
365 | 365 | int m_watchListBlackOut; |
… |
… |
class PlaybackBox : public ScheduleCommon |
405 | 405 | /// Program[s] currently selected for deletion |
406 | 406 | QStringList m_delList; |
407 | 407 | /// Group currently selected |
408 | | QString m_currentGroup; |
| 408 | QString m_currentGroup; // in lower case |
409 | 409 | |
410 | 410 | // Play List support |
411 | 411 | QStringList m_playList; ///< list of selected items "play list" |