DatabasePrint: print Last-Modified attribute for directories

This commit is contained in:
Andrzej Rybczak 2013-04-27 21:06:22 +02:00 committed by Max Kellermann
parent 9e715089a4
commit 5bf2ec5a74
1 changed files with 15 additions and 2 deletions

View File

@ -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);