aboutsummaryrefslogtreecommitdiffstats
path: root/src/song.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-12-27 13:34:51 +0100
committerMax Kellermann <max@duempel.org>2008-12-27 13:34:51 +0100
commit9220e0edfff2428fbbcec60460c5841cbd40eadd (patch)
treecc997a53da08b83db7add4a0813d8b2ab80cf8ad /src/song.c
parent0e7c67067b11e2db06bfc6a05798559a7e44a25f (diff)
parent4674d0442a4edc8647c060fbff2dd5e7ae9e3f84 (diff)
downloadmpd-9220e0edfff2428fbbcec60460c5841cbd40eadd.tar.gz
mpd-9220e0edfff2428fbbcec60460c5841cbd40eadd.tar.xz
mpd-9220e0edfff2428fbbcec60460c5841cbd40eadd.zip
Merge branch 'experimental' of git://git.musicpd.org/metyl/mpd
Conflicts: configure.ac src/ls.h src/output/shout_plugin.c
Diffstat (limited to 'src/song.c')
-rw-r--r--src/song.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/song.c b/src/song.c
index eafd1fb4a..56ece8eaf 100644
--- a/src/song.c
+++ b/src/song.c
@@ -74,7 +74,12 @@ song_file_load(const char *path, struct directory *parent)
song = song_file_new(path, parent);
- ret = song_file_update(song);
+ //in archive ?
+ if (parent->device == DEVICE_INARCHIVE) {
+ ret = song_file_update_inarchive(song);
+ } else {
+ ret = song_file_update(song);
+ }
if (!ret) {
song_free(song);
return NULL;
@@ -123,6 +128,34 @@ song_file_update(struct song *song)
return song->tag != NULL;
}
+bool
+song_file_update_inarchive(struct song *song)
+{
+ char buffer[MPD_PATH_MAX];
+ const char *path_fs;
+ const struct decoder_plugin *plugin;
+
+ assert(song_is_file(song));
+
+ path_fs = map_song_fs(song, buffer);
+ if (path_fs == NULL)
+ return false;
+
+ if (song->tag != NULL) {
+ tag_free(song->tag);
+ song->tag = NULL;
+ }
+ //accept every file that has music suffix
+ //because we dont support tag reading throught
+ //input streams
+ plugin = hasMusicSuffix(path_fs, 0);
+ if (plugin) {
+ song->tag = tag_new();
+ //tag_add_item(tag, TAG_ITEM_TITLE, f->title);
+ }
+ return song->tag != NULL;
+}
+
char *
song_get_url(const struct song *song, char *path_max_tmp)
{