aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/song.c4
-rw-r--r--src/update.c4
2 files changed, 3 insertions, 5 deletions
diff --git a/src/song.c b/src/song.c
index f76c1e4d9..09a92223c 100644
--- a/src/song.c
+++ b/src/song.c
@@ -239,10 +239,8 @@ int song_file_update(struct mpd_song * song)
if (old_tag)
tag_free(old_tag);
}
- if (!song->tag || song->tag->time < 0)
- return -1;
- return 0;
+ return (song->tag && song->tag->time >= 0);
}
char *song_get_url(struct mpd_song *song, char *path_max_tmp)
diff --git a/src/update.c b/src/update.c
index e7a49e56e..594e7f48c 100644
--- a/src/update.c
+++ b/src/update.c
@@ -226,7 +226,7 @@ updateInDirectory(struct directory *directory, const char *name)
return UPDATE_RETURN_UPDATED;
} else if (st.st_mtime != song->mtime) {
LOG("updating %s\n", name);
- if (song_file_update(song) < 0)
+ if (!song_file_update(song))
delete_song(directory, song);
return UPDATE_RETURN_UPDATED;
}
@@ -405,7 +405,7 @@ static enum update_return updatePath(const char *utf8path)
isMusic(song_get_url(song, path_max_tmp), &mtime, 0)) {
if (song->mtime == mtime)
return UPDATE_RETURN_NOUPDATE;
- else if (song_file_update(song) == 0)
+ else if (song_file_update(song))
return UPDATE_RETURN_UPDATED;
else {
delete_song(parentDirectory, song);