aboutsummaryrefslogtreecommitdiffstats
path: root/src/song.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/song.c')
-rw-r--r--src/song.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/song.c b/src/song.c
index 127d39eb4..a32d3920f 100644
--- a/src/song.c
+++ b/src/song.c
@@ -97,6 +97,7 @@ song_file_update(struct song *song)
unsigned int next = 0;
char path_max_tmp[MPD_PATH_MAX];
char abs_path[MPD_PATH_MAX];
+ struct stat st;
assert(song_is_file(song));
@@ -108,14 +109,16 @@ song_file_update(struct song *song)
song->tag = NULL;
}
+ if (stat(abs_path, &st) < 0)
+ return false;
+
+ song->mtime = st.st_mtime;
+
while (song->tag == NULL &&
- (plugin = isMusic(abs_path, &(song->mtime), next++)))
+ (plugin = hasMusicSuffix(abs_path, next++)))
song->tag = plugin->tag_dup(abs_path);
- if (song->tag == NULL || song->tag->time < 0)
- return false;
-
- return true;
+ return song->tag != NULL;
}
char *