diff options
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; } |
