Commit b74aa6b1 authored by Max Kellermann's avatar Max Kellermann

db/upnp: don't duplicate song data for VisitSong

Not necessary because we control the LightSong's life cycle.
parent 0c4a7911
...@@ -350,14 +350,21 @@ UpnpDatabase::SearchSongs(ContentDirectoryService &server, ...@@ -350,14 +350,21 @@ UpnpDatabase::SearchSongs(ContentDirectoryService &server,
} }
static bool static bool
visitSong(UPnPDirObject &&meta, std::string &&path, visitSong(const UPnPDirObject &meta, std::string &&path,
const DatabaseSelection &selection, const DatabaseSelection &selection,
VisitSong visit_song, Error& error) VisitSong visit_song, Error& error)
{ {
if (!visit_song) if (!visit_song)
return true; return true;
const UpnpSong song(std::move(meta), std::move(path)); LightSong song;
song.directory = nullptr;
song.uri = path.c_str();
song.real_uri = meta.url.c_str();
song.tag = &meta.tag;
song.mtime = 0;
song.start_ms = song.end_ms = 0;
return !selection.Match(song) || visit_song(song, error); return !selection.Match(song) || visit_song(song, error);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment