aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlaylistEdit.cxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/PlaylistEdit.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/PlaylistEdit.cxx b/src/PlaylistEdit.cxx
index 24184d0e4..3f9015765 100644
--- a/src/PlaylistEdit.cxx
+++ b/src/PlaylistEdit.cxx
@@ -61,13 +61,11 @@ PlaylistResult
playlist::AppendFile(PlayerControl &pc,
const char *path_utf8, unsigned *added_id)
{
- Song *song = Song::LoadFile(path_utf8, nullptr);
- if (song == nullptr)
+ DetachedSong song(path_utf8);
+ if (!song.Update())
return PlaylistResult::NO_SUCH_SONG;
- const auto result = AppendSong(pc, DetachedSong(*song), added_id);
- song->Free();
- return result;
+ return AppendSong(pc, std::move(song), added_id);
}
PlaylistResult