DetachedSong: move code from Update() to LoadFile()

Avoid duplicate AllocatedPath::FromUTF8() invocations in two callers.
This commit is contained in:
Max Kellermann
2015-10-20 12:10:42 +02:00
parent 76f85e6f7b
commit fc2154ee92
5 changed files with 36 additions and 26 deletions

View File

@@ -176,7 +176,7 @@ handle_lsinfo(Client &client, Request args, Response &r)
return print_error(r, error);
DetachedSong song(path_utf8);
if (!song.Update()) {
if (!song.LoadFile(path_fs)) {
r.Error(ACK_ERROR_NO_EXIST, "No such file");
return CommandResult::ERROR;
}