aboutsummaryrefslogtreecommitdiff
path: root/src/Song.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-08-15 20:57:45 +0200
committerMax Kellermann <max@duempel.org>2012-08-15 23:10:59 +0200
commite391f4b17b2fdd092b729f0dfec0b84265894e41 (patch)
treeaaf52d9a958c811737d4fca9b046a5f90b0cc831 /src/Song.cxx
parent2bd344549b5cfcb6d9a1e1e092c034e68d3071bc (diff)
ProxyDatabase: pass "detached" objects to visitors
Fixes wrong object URIs with duplicate base names.
Diffstat (limited to 'src/Song.cxx')
-rw-r--r--src/Song.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Song.cxx b/src/Song.cxx
index 2ef690fb..eb4c2e53 100644
--- a/src/Song.cxx
+++ b/src/Song.cxx
@@ -79,6 +79,14 @@ song_replace_uri(struct song *old_song, const char *uri)
}
struct song *
+song_detached_new(const char *uri)
+{
+ assert(uri != nullptr);
+
+ return song_alloc(uri, &detached_root);
+}
+
+struct song *
song_dup_detached(const struct song *src)
{
assert(src != nullptr);
@@ -86,7 +94,7 @@ song_dup_detached(const struct song *src)
struct song *song;
if (song_in_database(src)) {
char *uri = song_get_uri(src);
- song = song_alloc(uri, &detached_root);
+ song = song_detached_new(uri);
g_free(uri);
} else
song = song_alloc(src->uri, nullptr);