~ubuntu-branches/ubuntu/saucy/mpd/saucy

« back to all changes in this revision

Viewing changes to src/tag.c

  • Committer: Bazaar Package Importer
  • Author(s): Angel Abad
  • Date: 2011-02-02 12:26:30 UTC
  • mfrom: (1.5.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20110202122630-bdyx8w4k94doz4fs
Tags: 0.16.1-1ubuntu1
* Merge from debian unstable. Remaining changes:
  - debian/control:
    + Don't build-depend on libmikmod2-dev (Debian bug #510675).
    + Move avahi-daemon from Suggests field to Recommends field.
  - debian/mpd.init.d:
    + Read mpd user from mpd.conf.
  - debian/control, debian/rules:
    + Add libmp3lame-dev to the build dependencies and enable lame.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2003-2009 The Music Player Daemon Project
 
2
 * Copyright (C) 2003-2010 The Music Player Daemon Project
3
3
 * http://www.musicpd.org
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or modify
17
17
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
18
 */
19
19
 
 
20
#include "config.h"
20
21
#include "tag.h"
21
22
#include "tag_internal.h"
22
23
#include "tag_pool.h"
23
24
#include "conf.h"
24
25
#include "song.h"
 
26
#include "mpd_error.h"
25
27
 
26
28
#include <glib.h>
27
29
#include <assert.h>
42
44
} bulk;
43
45
 
44
46
const char *tag_item_names[TAG_NUM_OF_ITEM_TYPES] = {
45
 
        "Artist",
46
 
        "Album",
47
 
        "AlbumArtist",
48
 
        "Title",
49
 
        "Track",
50
 
        "Name",
51
 
        "Genre",
52
 
        "Date",
53
 
        "Composer",
54
 
        "Performer",
55
 
        "Comment",
56
 
        "Disc",
 
47
        [TAG_ARTIST] = "Artist",
 
48
        [TAG_ARTIST_SORT] = "ArtistSort",
 
49
        [TAG_ALBUM] = "Album",
 
50
        [TAG_ALBUM_ARTIST] = "AlbumArtist",
 
51
        [TAG_ALBUM_ARTIST_SORT] = "AlbumArtistSort",
 
52
        [TAG_TITLE] = "Title",
 
53
        [TAG_TRACK] = "Track",
 
54
        [TAG_NAME] = "Name",
 
55
        [TAG_GENRE] = "Genre",
 
56
        [TAG_DATE] = "Date",
 
57
        [TAG_COMPOSER] = "Composer",
 
58
        [TAG_PERFORMER] = "Performer",
 
59
        [TAG_COMMENT] = "Comment",
 
60
        [TAG_DISC] = "Disc",
57
61
 
58
62
        /* MusicBrainz tags from http://musicbrainz.org/doc/MusicBrainzTag */
59
63
        [TAG_MUSICBRAINZ_ARTISTID] = "MUSICBRAINZ_ARTISTID",
111
115
        /* parse the "metadata_to_use" config parameter below */
112
116
 
113
117
        /* ignore comments by default */
114
 
        ignore_tag_items[TAG_ITEM_COMMENT] = true;
 
118
        ignore_tag_items[TAG_COMMENT] = true;
115
119
 
116
120
        value = config_get_string(CONF_METADATA_TO_USE, NULL);
117
121
        if (value == NULL)
135
139
 
136
140
                        type = tag_name_parse_i(c);
137
141
                        if (type == TAG_NUM_OF_ITEM_TYPES)
138
 
                                g_error("error parsing metadata item \"%s\"",
139
 
                                        c);
 
142
                                MPD_ERROR("error parsing metadata item \"%s\"",
 
143
                                          c);
140
144
 
141
145
                        ignore_tag_items[type] = false;
142
146
 
169
173
 
170
174
        if (tag->num_items - idx > 0) {
171
175
                memmove(tag->items + idx, tag->items + idx + 1,
172
 
                        tag->num_items - idx);
 
176
                        (tag->num_items - idx) * sizeof(tag->items[0]));
173
177
        }
174
178
 
175
179
        if (tag->num_items > 0) {