diff --git a/src/lastfm.cpp b/src/lastfm.cpp index 1b5a02f7..70f0034a 100644 --- a/src/lastfm.cpp +++ b/src/lastfm.cpp @@ -201,15 +201,13 @@ void Lastfm::Save(const std::string &data) void Lastfm::Refetch() { - if (!remove(itsFilename.c_str())) - { - Load(); - } - else + if (remove(itsFilename.c_str()) && errno != ENOENT) { static const char msg[] = "Couldn't remove \"%s\": %s"; ShowMessage(msg, Shorten(TO_WSTRING(itsFilename), COLS-static_strlen(msg)-25).c_str(), strerror(errno)); + return; } + Load(); } bool Lastfm::SetArtistInfoArgs(const std::string &artist, const std::string &lang) diff --git a/src/lyrics.cpp b/src/lyrics.cpp index c73176be..d3ad50a0 100644 --- a/src/lyrics.cpp +++ b/src/lyrics.cpp @@ -303,15 +303,13 @@ void Lyrics::Save(const std::string &lyrics) void Lyrics::Refetch() { - if (!remove(itsFilename.c_str())) - { - Load(); - } - else + if (remove(itsFilename.c_str()) && errno != ENOENT) { static const char msg[] = "Couldn't remove \"%s\": %s"; ShowMessage(msg, Shorten(TO_WSTRING(itsFilename), COLS-static_strlen(msg)-25).c_str(), strerror(errno)); + return; } + Load(); } #ifdef HAVE_CURL_CURL_H