From 1c772ef69947127e01e7171b007a2295d51e7ae7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 27 Feb 2014 17:27:23 +0100 Subject: Playlist: use the Error library to return errors --- src/db/DatabaseQueue.cxx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/db/DatabaseQueue.cxx') diff --git a/src/db/DatabaseQueue.cxx b/src/db/DatabaseQueue.cxx index be012647a..490678188 100644 --- a/src/db/DatabaseQueue.cxx +++ b/src/db/DatabaseQueue.cxx @@ -23,7 +23,6 @@ #include "Interface.hxx" #include "Partition.hxx" #include "Instance.hxx" -#include "util/Error.hxx" #include "DetachedSong.hxx" #include @@ -32,17 +31,12 @@ static bool AddToQueue(Partition &partition, const LightSong &song, Error &error) { const Storage &storage = *partition.instance.storage; - PlaylistResult result = + unsigned id = partition.playlist.AppendSong(partition.pc, DatabaseDetachSong(storage, song), - nullptr); - if (result != PlaylistResult::SUCCESS) { - error.Set(playlist_domain, int(result), "Playlist error"); - return false; - } - - return true; + error); + return id != 0; } bool -- cgit v1.2.3