Skip to content

Commit c2304c0

Browse files
author
Robert McNamara
committed
Permit filtering/sorting by Date Added in MythVideo.
There's a fine line between this and the metadata browse mode that does the same, but it's real enough and the patch unobtrusive enough that I'll add this. Fixes #9085.
1 parent 486d2c5 commit c2304c0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

mythplugins/mythvideo/mythvideo/videofilter.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,11 @@ bool VideoFilterSettings::meta_less_than(const VideoMetadata &lhs,
470470
ret = lhs.GetID() < rhs.GetID();
471471
break;
472472
}
473+
case kOrderByDateAddedDescending:
474+
{
475+
ret = lhs.GetInsertdate() > rhs.GetInsertdate();
476+
break;
477+
}
473478
default:
474479
{
475480
VERBOSE(VB_IMPORTANT, QString("Error: unknown sort type %1")
@@ -813,6 +818,8 @@ void VideoFilterDialog::fillWidgets()
813818
VideoFilterSettings::kOrderByFilename);
814819
new MythUIButtonListItem(m_orderbyList, QObject::tr("Video ID"),
815820
VideoFilterSettings::kOrderByID);
821+
new MythUIButtonListItem(m_orderbyList, QObject::tr("Date Added"),
822+
VideoFilterSettings::kOrderByDateAddedDescending);
816823
m_orderbyList->SetValueByData(m_settings.getOrderby());
817824

818825
// Text Filter

mythplugins/mythvideo/mythvideo/videofilter.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ class VideoFilterSettings
5656
kOrderByLength = 3,
5757
kOrderByFilename = 4,
5858
kOrderByID = 5,
59-
kOrderBySeasonEp = 6
59+
kOrderBySeasonEp = 6,
60+
kOrderByDateAddedDescending = 7
6061
};
6162

6263
int GetCategory() const { return category; }

0 commit comments

Comments
 (0)