PlaylistFile: remove redundant existence check
This commit is contained in:
parent
6caf53d1c2
commit
65974ceabc
@ -366,10 +366,6 @@ spl_append_uri(const char *utf8file,
|
|||||||
static void
|
static void
|
||||||
spl_rename_internal(Path from_path_fs, Path to_path_fs)
|
spl_rename_internal(Path from_path_fs, Path to_path_fs)
|
||||||
{
|
{
|
||||||
if (!FileExists(from_path_fs))
|
|
||||||
throw PlaylistError(PlaylistResult::NO_SUCH_LIST,
|
|
||||||
"No such playlist");
|
|
||||||
|
|
||||||
if (FileExists(to_path_fs))
|
if (FileExists(to_path_fs))
|
||||||
throw PlaylistError(PlaylistResult::LIST_EXISTS,
|
throw PlaylistError(PlaylistResult::LIST_EXISTS,
|
||||||
"Playlist exists already");
|
"Playlist exists already");
|
||||||
@ -377,7 +373,7 @@ spl_rename_internal(Path from_path_fs, Path to_path_fs)
|
|||||||
try {
|
try {
|
||||||
RenameFile(from_path_fs, to_path_fs);
|
RenameFile(from_path_fs, to_path_fs);
|
||||||
} catch (const std::system_error &e) {
|
} catch (const std::system_error &e) {
|
||||||
if (IsPathNotFound(e))
|
if (IsFileNotFound(e))
|
||||||
throw PlaylistError(PlaylistResult::NO_SUCH_LIST,
|
throw PlaylistError(PlaylistResult::NO_SUCH_LIST,
|
||||||
"No such playlist");
|
"No such playlist");
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user