aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-22 19:18:39 +0200
committerMax Kellermann <max@duempel.org>2008-10-22 19:18:39 +0200
commit7aca4cd194b8ec2546e598800b153a5009b1792d (patch)
tree2ca63c289bc733f2b37aceba7e56188a7a3fad07 /src/command.c
parent9c983c442c03a71bbf80ccbf1dad84894403a983 (diff)
downloadmpd-7aca4cd194b8ec2546e598800b153a5009b1792d.tar.gz
mpd-7aca4cd194b8ec2546e598800b153a5009b1792d.tar.xz
mpd-7aca4cd194b8ec2546e598800b153a5009b1792d.zip
stored_playlist: send timestamps
Send last modification timestamps to the client. This allows the client to see when another client modifies a stored playlist.
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/command.c b/src/command.c
index db793350d..4ded86089 100644
--- a/src/command.c
+++ b/src/command.c
@@ -208,8 +208,16 @@ print_spl_list(struct client *client, GPtrArray *list)
for (unsigned i = 0; i < list->len; ++i) {
struct stored_playlist_info *playlist =
g_ptr_array_index(list, i);
+ time_t t;
+ struct tm tm;
+ char timestamp[32];
client_printf(client, "playlist: %s\n", playlist->name);
+
+ t = playlist->mtime;
+ strftime(timestamp, sizeof(timestamp), "%FT%TZ",
+ gmtime_r(&t, &tm));
+ client_printf(client, "Last-Modified: %s\n", timestamp);
}
}