From f5ae1ce00b85699291a7cdf9782574e70a8c28f5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 19 Jan 2014 10:51:34 +0100 Subject: LightSong: new class to be used by DatabasePlugin callbacks Detach the Song class completely from the public API, only to be used by SimpleDatabase and the update thread. --- src/SongPrint.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/SongPrint.cxx') diff --git a/src/SongPrint.cxx b/src/SongPrint.cxx index 67b622356..810518c21 100644 --- a/src/SongPrint.cxx +++ b/src/SongPrint.cxx @@ -19,7 +19,7 @@ #include "config.h" #include "SongPrint.hxx" -#include "Song.hxx" +#include "LightSong.hxx" #include "DetachedSong.hxx" #include "Directory.hxx" #include "TimePrint.hxx" @@ -28,6 +28,8 @@ #include "Client.hxx" #include "util/UriUtil.hxx" +#define SONG_FILE "file: " + static void song_print_uri(Client &client, const char *uri) { @@ -40,11 +42,11 @@ song_print_uri(Client &client, const char *uri) } void -song_print_uri(Client &client, const Song &song) +song_print_uri(Client &client, const LightSong &song) { - if (song.parent != nullptr && !song.parent->IsRoot()) { + if (song.directory != nullptr) { client_printf(client, "%s%s/%s\n", SONG_FILE, - song.parent->GetPath(), song.uri); + song.directory, song.uri); } else song_print_uri(client, song.uri); } @@ -56,7 +58,7 @@ song_print_uri(Client &client, const DetachedSong &song) } void -song_print_info(Client &client, const Song &song) +song_print_info(Client &client, const LightSong &song) { song_print_uri(client, song); @@ -74,7 +76,7 @@ song_print_info(Client &client, const Song &song) if (song.mtime > 0) time_print(client, "Last-Modified", song.mtime); - tag_print(client, song.tag); + tag_print(client, *song.tag); } void -- cgit v1.2.3