diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2013-04-27 21:06:22 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-08-04 23:29:24 +0200 |
commit | 5bf2ec5a74bb1247a8cc84e90577eecbee116c62 (patch) | |
tree | 9ad9599ef905c7548800ebe4faa29c71bfec0341 /src/DatabasePrint.cxx | |
parent | 9e715089a4279d08b7cc8d7fbdb3eb8696230e65 (diff) |
DatabasePrint: print Last-Modified attribute for directories
Diffstat (limited to 'src/DatabasePrint.cxx')
-rw-r--r-- | src/DatabasePrint.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
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 <functional> 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); |