diff options
author | Max Kellermann <max@duempel.org> | 2012-08-15 20:57:45 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-08-15 23:10:59 +0200 |
commit | e391f4b17b2fdd092b729f0dfec0b84265894e41 (patch) | |
tree | aaf52d9a958c811737d4fca9b046a5f90b0cc831 /src/Song.cxx | |
parent | 2bd344549b5cfcb6d9a1e1e092c034e68d3071bc (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.cxx | 10 |
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); |