Permalink
Browse files

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.
  • Loading branch information...
1 parent 486d2c5 commit c2304c0379d82f15e6c9f027ba78a2a1541fae5f Robert McNamara committed Jan 28, 2011
View
7 mythplugins/mythvideo/mythvideo/videofilter.cpp
@@ -470,6 +470,11 @@ bool VideoFilterSettings::meta_less_than(const VideoMetadata &lhs,
ret = lhs.GetID() < rhs.GetID();
break;
}
+ case kOrderByDateAddedDescending:
+ {
+ ret = lhs.GetInsertdate() > rhs.GetInsertdate();
+ break;
+ }
default:
{
VERBOSE(VB_IMPORTANT, QString("Error: unknown sort type %1")
@@ -813,6 +818,8 @@ void VideoFilterDialog::fillWidgets()
VideoFilterSettings::kOrderByFilename);
new MythUIButtonListItem(m_orderbyList, QObject::tr("Video ID"),
VideoFilterSettings::kOrderByID);
+ new MythUIButtonListItem(m_orderbyList, QObject::tr("Date Added"),
+ VideoFilterSettings::kOrderByDateAddedDescending);
m_orderbyList->SetValueByData(m_settings.getOrderby());
// Text Filter
View
3 mythplugins/mythvideo/mythvideo/videofilter.h
@@ -56,7 +56,8 @@ class VideoFilterSettings
kOrderByLength = 3,
kOrderByFilename = 4,
kOrderByID = 5,
- kOrderBySeasonEp = 6
+ kOrderBySeasonEp = 6,
+ kOrderByDateAddedDescending = 7
};
int GetCategory() const { return category; }

0 comments on commit c2304c0

Please sign in to comment.