From 5bf2ec5a74bb1247a8cc84e90577eecbee116c62 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sat, 27 Apr 2013 21:06:22 +0200 Subject: DatabasePrint: print Last-Modified attribute for directories --- src/DatabasePrint.cxx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/DatabasePrint.cxx b/src/DatabasePrint.cxx index 093b0bd46..1f8999dc3 100644 --- a/src/DatabasePrint.cxx +++ b/src/DatabasePrint.cxx @@ -34,7 +34,7 @@ #include static bool -PrintDirectory(Client *client, const Directory &directory) +PrintDirectoryBrief(Client *client, const Directory &directory) { if (!directory.IsRoot()) client_printf(client, "directory: %s\n", directory.GetPath()); @@ -42,6 +42,18 @@ PrintDirectory(Client *client, const Directory &directory) return true; } +static bool +PrintDirectoryFull(Client *client, const Directory &directory) +{ + if (!directory.IsRoot()) { + client_printf(client, "directory: %s\n", directory.GetPath()); + time_print(client, "Last-Modified", directory.mtime); + } + + return true; +} + + static void print_playlist_in_directory(Client *client, const Directory &directory, @@ -114,7 +126,8 @@ db_selection_print(Client *client, const DatabaseSelection &selection, using namespace std::placeholders; const auto d = selection.filter == nullptr - ? std::bind(PrintDirectory, client, _1) + ? std::bind(full ? PrintDirectoryFull : PrintDirectoryBrief, + client, _1) : VisitDirectory(); const auto s = std::bind(full ? PrintSongFull : PrintSongBrief, client, _1); -- cgit v1.2.3