From 4e32b36f59caf076421645f7982f987ab43203f5 Mon Sep 17 00:00:00 2001 From: Krzysztof Sobiecki Date: Sun, 30 Nov 2014 15:42:08 +0100 Subject: [PATCH] Set ctime and mtime in Song returned by PodcastEpisode::ToSong Fixes #4627,#4368 --- src/podcasts/podcastepisode.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/podcasts/podcastepisode.cpp b/src/podcasts/podcastepisode.cpp index ef6e1167c..450095ad0 100644 --- a/src/podcasts/podcastepisode.cpp +++ b/src/podcasts/podcastepisode.cpp @@ -182,6 +182,13 @@ Song PodcastEpisode::ToSong(const Podcast& podcast) const { ret.set_year(publication_date().date().year()); ret.set_comment(description()); ret.set_id(database_id()); + ret.set_ctime(publication_date().toTime_t()); + + if (listened()) { + ret.set_mtime(listened_date().toTime_t()); + } else { + ret.set_mtime(publication_date().toTime_t()); + } if (ret.length_nanosec() < 0) { ret.set_length_nanosec(-1);