diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-03-25 00:30:19 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-03-25 00:30:19 +0000 |
| commit | 74873babf8ed3ffb3dd79858328d5b3f142479a3 (patch) | |
| tree | f245c33a609ac914f183e7031d20abf18f40d518 /src/lib/film.cc | |
| parent | 25c15064f4c816d310c34e2e27092b3c2d02afb3 (diff) | |
Sort KDM CPL list in reverse timestamp order (#1496).
Diffstat (limited to 'src/lib/film.cc')
| -rw-r--r-- | src/lib/film.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index 76cd8da96..f61d5106f 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -1038,7 +1038,16 @@ Film::j2c_path (int reel, Frame frame, Eyes eyes, bool tmp) const return file (p); } -/** Find all the DCPs in our directory that can be dcp::DCP::read() and return details of their CPLs */ +static +bool +cpl_summary_compare (CPLSummary const & a, CPLSummary const & b) +{ + return a.last_write_time > b.last_write_time; +} + +/** Find all the DCPs in our directory that can be dcp::DCP::read() and return details of their CPLs. + * The list will be returned in reverse order of timestamp (i.e. most recent first). + */ vector<CPLSummary> Film::cpls () const { @@ -1063,6 +1072,8 @@ Film::cpls () const } } + sort (out.begin(), out.end(), cpl_summary_compare); + return out; } |
