aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-08 11:06:27 +0200
committerEric Wong <normalperson@yhbt.net>2008-10-11 19:21:48 -0700
commit81bdc3f625ecce1eca87009caf89e98abd405f51 (patch)
tree5e17029dd643688dc26f9d2aed548b458628c6b6 /src
parentaae48c97fb3d2b0140daa8e49459a7afe3488683 (diff)
downloadmpd-81bdc3f625ecce1eca87009caf89e98abd405f51.tar.gz
mpd-81bdc3f625ecce1eca87009caf89e98abd405f51.tar.xz
mpd-81bdc3f625ecce1eca87009caf89e98abd405f51.zip
song: use song_file_update() in song_file_load()
Eliminate duplicated code.
Diffstat (limited to 'src')
-rw-r--r--src/song.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/song.c b/src/song.c
index 09a92223c..18f2bca21 100644
--- a/src/song.c
+++ b/src/song.c
@@ -61,10 +61,6 @@ struct mpd_song * song_file_new(const char *path, struct directory *parent)
struct mpd_song * song_file_load(const char *path, struct directory *parent)
{
struct mpd_song *song;
- unsigned int next = 0;
- InputPlugin *plugin;
- char path_max_tmp[MPD_PATH_MAX];
- char *abs_path;
if (strchr(path, '\n')) {
DEBUG("song_file_load: '%s' is not a valid uri\n", path);
@@ -72,13 +68,7 @@ struct mpd_song * song_file_load(const char *path, struct directory *parent)
}
song = song_file_new(path, parent);
- abs_path = rmp2amp_r(path_max_tmp, song_get_url(song, path_max_tmp));
-
- while (!song->tag &&
- (plugin = isMusic(abs_path, &song->mtime, next++))) {
- song->tag = plugin->tagDupFunc(abs_path);
- }
- if (!song->tag || song->tag->time < 0) {
+ if (!song_file_update(song)) {
song_free(song);
return NULL;
}