tag: removed the "_ITEM_" suffix from the enum names
This commit is contained in:
parent
a9dc0e816c
commit
ea616b3ed4
|
@ -1236,17 +1236,17 @@ handle_list(struct client *client, int argc, char *argv[])
|
|||
|
||||
/* for compatibility with < 0.12.0 */
|
||||
if (argc == 3) {
|
||||
if (tagType != TAG_ITEM_ALBUM) {
|
||||
if (tagType != TAG_ALBUM) {
|
||||
command_error(client, ACK_ERROR_ARG,
|
||||
"should be \"%s\" for 3 arguments",
|
||||
tag_item_names[TAG_ITEM_ALBUM]);
|
||||
tag_item_names[TAG_ALBUM]);
|
||||
return COMMAND_RETURN_ERROR;
|
||||
}
|
||||
|
||||
locate_item_list_parse(argv + 1, argc - 1);
|
||||
|
||||
conditionals = locate_item_list_new(1);
|
||||
conditionals->items[0].tag = TAG_ITEM_ARTIST;
|
||||
conditionals->items[0].tag = TAG_ARTIST;
|
||||
conditionals->items[0].needle = g_strdup(argv[2]);
|
||||
} else {
|
||||
conditionals =
|
||||
|
|
|
@ -13,64 +13,64 @@ cue_tag_cd(struct Cdtext* cdtext, struct Rem* rem)
|
|||
|
||||
tag_begin_add(tag);
|
||||
|
||||
{ /* TAG_ITEM_ALBUM_ARTIST */
|
||||
{ /* TAG_ALBUM_ARTIST */
|
||||
if ((tmp = cdtext_get(PTI_PERFORMER, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_ALBUM_ARTIST, tmp);
|
||||
tag_add_item(tag, TAG_ALBUM_ARTIST, tmp);
|
||||
|
||||
else if ((tmp = cdtext_get(PTI_SONGWRITER, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_ALBUM_ARTIST, tmp);
|
||||
tag_add_item(tag, TAG_ALBUM_ARTIST, tmp);
|
||||
|
||||
else if ((tmp = cdtext_get(PTI_COMPOSER, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_ALBUM_ARTIST, tmp);
|
||||
tag_add_item(tag, TAG_ALBUM_ARTIST, tmp);
|
||||
|
||||
else if ((tmp = cdtext_get(PTI_ARRANGER, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_ALBUM_ARTIST, tmp);
|
||||
/* TAG_ITEM_ALBUM_ARTIST */ }
|
||||
tag_add_item(tag, TAG_ALBUM_ARTIST, tmp);
|
||||
/* TAG_ALBUM_ARTIST */ }
|
||||
|
||||
{ /* TAG_ITEM_ARTIST */
|
||||
{ /* TAG_ARTIST */
|
||||
if ((tmp = cdtext_get(PTI_PERFORMER, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_ARTIST, tmp);
|
||||
tag_add_item(tag, TAG_ARTIST, tmp);
|
||||
|
||||
else if ((tmp = cdtext_get(PTI_SONGWRITER, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_ARTIST, tmp);
|
||||
tag_add_item(tag, TAG_ARTIST, tmp);
|
||||
|
||||
else if ((tmp = cdtext_get(PTI_COMPOSER, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_ARTIST, tmp);
|
||||
tag_add_item(tag, TAG_ARTIST, tmp);
|
||||
|
||||
else if ((tmp = cdtext_get(PTI_ARRANGER, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_ARTIST, tmp);
|
||||
/* TAG_ITEM_ARTIST */ }
|
||||
tag_add_item(tag, TAG_ARTIST, tmp);
|
||||
/* TAG_ARTIST */ }
|
||||
|
||||
/* TAG_ITEM_PERFORMER */
|
||||
/* TAG_PERFORMER */
|
||||
if ((tmp = cdtext_get(PTI_PERFORMER, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_PERFORMER, tmp);
|
||||
tag_add_item(tag, TAG_PERFORMER, tmp);
|
||||
|
||||
/* TAG_ITEM_COMPOSER */
|
||||
/* TAG_COMPOSER */
|
||||
if ((tmp = cdtext_get(PTI_COMPOSER, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_COMPOSER, tmp);
|
||||
tag_add_item(tag, TAG_COMPOSER, tmp);
|
||||
|
||||
/* TAG_ITEM_ALBUM */
|
||||
/* TAG_ALBUM */
|
||||
if ((tmp = cdtext_get(PTI_TITLE, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_ALBUM, tmp);
|
||||
tag_add_item(tag, TAG_ALBUM, tmp);
|
||||
|
||||
/* TAG_ITEM_GENRE */
|
||||
/* TAG_GENRE */
|
||||
if ((tmp = cdtext_get(PTI_GENRE, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_GENRE, tmp);
|
||||
tag_add_item(tag, TAG_GENRE, tmp);
|
||||
|
||||
/* TAG_ITEM_DATE */
|
||||
/* TAG_DATE */
|
||||
if ((tmp = rem_get(REM_DATE, rem)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_DATE, tmp);
|
||||
tag_add_item(tag, TAG_DATE, tmp);
|
||||
|
||||
/* TAG_ITEM_COMMENT */
|
||||
/* TAG_COMMENT */
|
||||
if ((tmp = cdtext_get(PTI_MESSAGE, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_COMMENT, tmp);
|
||||
tag_add_item(tag, TAG_COMMENT, tmp);
|
||||
|
||||
/* TAG_ITEM_DISC */
|
||||
/* TAG_DISC */
|
||||
if ((tmp = cdtext_get(PTI_DISC_ID, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_DISC, tmp);
|
||||
tag_add_item(tag, TAG_DISC, tmp);
|
||||
|
||||
/* stream name, usually empty
|
||||
* tag_add_item(tag, TAG_ITEM_NAME,);
|
||||
* tag_add_item(tag, TAG_NAME,);
|
||||
*/
|
||||
|
||||
/* REM MUSICBRAINZ entry?
|
||||
|
@ -109,47 +109,47 @@ cue_tag_track(struct Cdtext* cdtext, struct Rem* rem)
|
|||
|
||||
tag_begin_add(tag);
|
||||
|
||||
{ /* TAG_ITEM_ARTIST */
|
||||
{ /* TAG_ARTIST */
|
||||
if ((tmp = cdtext_get(PTI_PERFORMER, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_ARTIST, tmp);
|
||||
tag_add_item(tag, TAG_ARTIST, tmp);
|
||||
|
||||
else if ((tmp = cdtext_get(PTI_SONGWRITER, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_ARTIST, tmp);
|
||||
tag_add_item(tag, TAG_ARTIST, tmp);
|
||||
|
||||
else if ((tmp = cdtext_get(PTI_COMPOSER, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_ARTIST, tmp);
|
||||
tag_add_item(tag, TAG_ARTIST, tmp);
|
||||
|
||||
else if ((tmp = cdtext_get(PTI_ARRANGER, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_ARTIST, tmp);
|
||||
/* TAG_ITEM_ARTIST */ }
|
||||
tag_add_item(tag, TAG_ARTIST, tmp);
|
||||
/* TAG_ARTIST */ }
|
||||
|
||||
/* TAG_ITEM_TITLE */
|
||||
/* TAG_TITLE */
|
||||
if ((tmp = cdtext_get(PTI_TITLE, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_TITLE, tmp);
|
||||
tag_add_item(tag, TAG_TITLE, tmp);
|
||||
|
||||
/* TAG_ITEM_GENRE */
|
||||
/* TAG_GENRE */
|
||||
if ((tmp = cdtext_get(PTI_GENRE, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_GENRE, tmp);
|
||||
tag_add_item(tag, TAG_GENRE, tmp);
|
||||
|
||||
/* TAG_ITEM_DATE */
|
||||
/* TAG_DATE */
|
||||
if ((tmp = rem_get(REM_DATE, rem)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_DATE, tmp);
|
||||
tag_add_item(tag, TAG_DATE, tmp);
|
||||
|
||||
/* TAG_ITEM_COMPOSER */
|
||||
/* TAG_COMPOSER */
|
||||
if ((tmp = cdtext_get(PTI_COMPOSER, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_COMPOSER, tmp);
|
||||
tag_add_item(tag, TAG_COMPOSER, tmp);
|
||||
|
||||
/* TAG_ITEM_PERFORMER */
|
||||
/* TAG_PERFORMER */
|
||||
if ((tmp = cdtext_get(PTI_PERFORMER, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_PERFORMER, tmp);
|
||||
tag_add_item(tag, TAG_PERFORMER, tmp);
|
||||
|
||||
/* TAG_ITEM_COMMENT */
|
||||
/* TAG_COMMENT */
|
||||
if ((tmp = cdtext_get(PTI_MESSAGE, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_COMMENT, tmp);
|
||||
tag_add_item(tag, TAG_COMMENT, tmp);
|
||||
|
||||
/* TAG_ITEM_DISC */
|
||||
/* TAG_DISC */
|
||||
if ((tmp = cdtext_get(PTI_DISC_ID, cdtext)) != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_DISC, tmp);
|
||||
tag_add_item(tag, TAG_DISC, tmp);
|
||||
|
||||
tag_end_add(tag);
|
||||
|
||||
|
|
|
@ -170,11 +170,11 @@ flac_parse_comment(struct tag *tag, const char *char_tnum,
|
|||
assert(tag != NULL);
|
||||
|
||||
if (flac_copy_comment(tag, entry, VORBIS_COMMENT_TRACK_KEY,
|
||||
TAG_ITEM_TRACK, char_tnum) ||
|
||||
TAG_TRACK, char_tnum) ||
|
||||
flac_copy_comment(tag, entry, VORBIS_COMMENT_DISC_KEY,
|
||||
TAG_ITEM_DISC, char_tnum) ||
|
||||
TAG_DISC, char_tnum) ||
|
||||
flac_copy_comment(tag, entry, "album artist",
|
||||
TAG_ITEM_ALBUM_ARTIST, char_tnum))
|
||||
TAG_ALBUM_ARTIST, char_tnum))
|
||||
return;
|
||||
|
||||
for (unsigned i = 0; i < TAG_NUM_OF_ITEM_TYPES; ++i)
|
||||
|
|
|
@ -363,37 +363,36 @@ static bool ffmpeg_tag_internal(struct ffmpeg_context *ctx)
|
|||
#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0)
|
||||
av_metadata_conv(f, NULL, f->iformat->metadata_conv);
|
||||
|
||||
ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_TITLE, "title");
|
||||
if (!ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_ARTIST, "author"))
|
||||
ffmpeg_copy_metadata(tag, f->metadata,
|
||||
TAG_ITEM_ARTIST, "artist");
|
||||
ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_ALBUM, "album");
|
||||
ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_COMMENT, "comment");
|
||||
ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_GENRE, "genre");
|
||||
ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_TRACK, "track");
|
||||
ffmpeg_copy_metadata(tag, f->metadata, TAG_ITEM_DATE, "year");
|
||||
ffmpeg_copy_metadata(tag, f->metadata, TAG_TITLE, "title");
|
||||
if (!ffmpeg_copy_metadata(tag, f->metadata, TAG_ARTIST, "author"))
|
||||
ffmpeg_copy_metadata(tag, f->metadata, TAG_ARTIST, "artist");
|
||||
ffmpeg_copy_metadata(tag, f->metadata, TAG_ALBUM, "album");
|
||||
ffmpeg_copy_metadata(tag, f->metadata, TAG_COMMENT, "comment");
|
||||
ffmpeg_copy_metadata(tag, f->metadata, TAG_GENRE, "genre");
|
||||
ffmpeg_copy_metadata(tag, f->metadata, TAG_TRACK, "track");
|
||||
ffmpeg_copy_metadata(tag, f->metadata, TAG_DATE, "year");
|
||||
#else
|
||||
if (f->author[0])
|
||||
tag_add_item(tag, TAG_ITEM_ARTIST, f->author);
|
||||
tag_add_item(tag, TAG_ARTIST, f->author);
|
||||
if (f->title[0])
|
||||
tag_add_item(tag, TAG_ITEM_TITLE, f->title);
|
||||
tag_add_item(tag, TAG_TITLE, f->title);
|
||||
if (f->album[0])
|
||||
tag_add_item(tag, TAG_ITEM_ALBUM, f->album);
|
||||
tag_add_item(tag, TAG_ALBUM, f->album);
|
||||
|
||||
if (f->track > 0) {
|
||||
char buffer[16];
|
||||
snprintf(buffer, sizeof(buffer), "%d", f->track);
|
||||
tag_add_item(tag, TAG_ITEM_TRACK, buffer);
|
||||
tag_add_item(tag, TAG_TRACK, buffer);
|
||||
}
|
||||
|
||||
if (f->comment[0])
|
||||
tag_add_item(tag, TAG_ITEM_COMMENT, f->comment);
|
||||
tag_add_item(tag, TAG_COMMENT, f->comment);
|
||||
if (f->genre[0])
|
||||
tag_add_item(tag, TAG_ITEM_GENRE, f->genre);
|
||||
tag_add_item(tag, TAG_GENRE, f->genre);
|
||||
if (f->year > 0) {
|
||||
char buffer[16];
|
||||
snprintf(buffer, sizeof(buffer), "%d", f->year);
|
||||
tag_add_item(tag, TAG_ITEM_DATE, buffer);
|
||||
tag_add_item(tag, TAG_DATE, buffer);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -347,11 +347,8 @@ flac_cue_tag_load(const char *file)
|
|||
if (tag == NULL)
|
||||
tag = flac_tag_load(file, char_tnum);
|
||||
|
||||
if (char_tnum != NULL)
|
||||
{
|
||||
tag_add_item( tag,
|
||||
TAG_ITEM_TRACK,
|
||||
char_tnum);
|
||||
if (char_tnum != NULL) {
|
||||
tag_add_item(tag, TAG_TRACK, char_tnum);
|
||||
g_free(char_tnum);
|
||||
}
|
||||
|
||||
|
|
|
@ -220,7 +220,7 @@ static struct tag *modTagDup(const char *file)
|
|||
title = g_strdup(Player_LoadTitle(path2));
|
||||
g_free(path2);
|
||||
if (title)
|
||||
tag_add_item(ret, TAG_ITEM_TITLE, title);
|
||||
tag_add_item(ret, TAG_TITLE, title);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -188,7 +188,7 @@ static struct tag *mod_tagdup(const char *file)
|
|||
|
||||
title = g_strdup(ModPlug_GetName(f));
|
||||
if (title)
|
||||
tag_add_item(ret, TAG_ITEM_TITLE, title);
|
||||
tag_add_item(ret, TAG_TITLE, title);
|
||||
g_free(title);
|
||||
|
||||
ModPlug_Unload(f);
|
||||
|
|
|
@ -391,22 +391,22 @@ mp4_tag_dup(const char *file)
|
|||
mp4ff_meta_get_by_index(mp4fh, i, &item, &value);
|
||||
|
||||
if (0 == g_ascii_strcasecmp("artist", item)) {
|
||||
tag_add_item(ret, TAG_ITEM_ARTIST, value);
|
||||
tag_add_item(ret, TAG_ARTIST, value);
|
||||
} else if (0 == g_ascii_strcasecmp("title", item)) {
|
||||
tag_add_item(ret, TAG_ITEM_TITLE, value);
|
||||
tag_add_item(ret, TAG_TITLE, value);
|
||||
} else if (0 == g_ascii_strcasecmp("album", item)) {
|
||||
tag_add_item(ret, TAG_ITEM_ALBUM, value);
|
||||
tag_add_item(ret, TAG_ALBUM, value);
|
||||
} else if (0 == g_ascii_strcasecmp("track", item)) {
|
||||
tag_add_item(ret, TAG_ITEM_TRACK, value);
|
||||
tag_add_item(ret, TAG_TRACK, value);
|
||||
} else if (0 == g_ascii_strcasecmp("disc", item)) {
|
||||
/* Is that the correct id? */
|
||||
tag_add_item(ret, TAG_ITEM_DISC, value);
|
||||
tag_add_item(ret, TAG_DISC, value);
|
||||
} else if (0 == g_ascii_strcasecmp("genre", item)) {
|
||||
tag_add_item(ret, TAG_ITEM_GENRE, value);
|
||||
tag_add_item(ret, TAG_GENRE, value);
|
||||
} else if (0 == g_ascii_strcasecmp("date", item)) {
|
||||
tag_add_item(ret, TAG_ITEM_DATE, value);
|
||||
tag_add_item(ret, TAG_DATE, value);
|
||||
} else if (0 == g_ascii_strcasecmp("writer", item)) {
|
||||
tag_add_item(ret, TAG_ITEM_COMPOSER, value);
|
||||
tag_add_item(ret, TAG_COMPOSER, value);
|
||||
}
|
||||
|
||||
free(item);
|
||||
|
|
|
@ -347,18 +347,18 @@ sidplay_tag_dup(const char *path_fs)
|
|||
if(info.songs>1) {
|
||||
char *tag_title=g_strdup_printf("%s (%d/%d)",
|
||||
title, song_num, info.songs);
|
||||
tag_add_item(tag, TAG_ITEM_TITLE, tag_title);
|
||||
tag_add_item(tag, TAG_TITLE, tag_title);
|
||||
g_free(tag_title);
|
||||
} else
|
||||
tag_add_item(tag, TAG_ITEM_TITLE, title);
|
||||
tag_add_item(tag, TAG_TITLE, title);
|
||||
|
||||
/* artist */
|
||||
if (info.numberOfInfoStrings > 1 && info.infoString[1] != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_ARTIST, info.infoString[1]);
|
||||
tag_add_item(tag, TAG_ARTIST, info.infoString[1]);
|
||||
|
||||
/* track */
|
||||
char *track=g_strdup_printf("%d", song_num);
|
||||
tag_add_item(tag, TAG_ITEM_TRACK, track);
|
||||
tag_add_item(tag, TAG_TRACK, track);
|
||||
g_free(track);
|
||||
|
||||
/* time */
|
||||
|
|
|
@ -190,15 +190,15 @@ sndfile_tag_dup(const char *path_fs)
|
|||
|
||||
p = sf_get_string(sf, SF_STR_TITLE);
|
||||
if (p != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_TITLE, p);
|
||||
tag_add_item(tag, TAG_TITLE, p);
|
||||
|
||||
p = sf_get_string(sf, SF_STR_ARTIST);
|
||||
if (p != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_ARTIST, p);
|
||||
tag_add_item(tag, TAG_ARTIST, p);
|
||||
|
||||
p = sf_get_string(sf, SF_STR_DATE);
|
||||
if (p != NULL)
|
||||
tag_add_item(tag, TAG_ITEM_DATE, p);
|
||||
tag_add_item(tag, TAG_DATE, p);
|
||||
|
||||
sf_close(sf);
|
||||
|
||||
|
|
|
@ -176,11 +176,11 @@ vorbis_parse_comment(struct tag *tag, const char *comment)
|
|||
assert(tag != NULL);
|
||||
|
||||
if (vorbis_copy_comment(tag, comment, VORBIS_COMMENT_TRACK_KEY,
|
||||
TAG_ITEM_TRACK) ||
|
||||
TAG_TRACK) ||
|
||||
vorbis_copy_comment(tag, comment, VORBIS_COMMENT_DISC_KEY,
|
||||
TAG_ITEM_DISC) ||
|
||||
TAG_DISC) ||
|
||||
vorbis_copy_comment(tag, comment, "album artist",
|
||||
TAG_ITEM_ALBUM_ARTIST))
|
||||
TAG_ALBUM_ARTIST))
|
||||
return;
|
||||
|
||||
for (unsigned i = 0; i < TAG_NUM_OF_ITEM_TYPES; ++i)
|
||||
|
|
|
@ -41,17 +41,17 @@ static struct {
|
|||
const char *name;
|
||||
enum tag_type type;
|
||||
} tagtypes[] = {
|
||||
{ "artist", TAG_ITEM_ARTIST },
|
||||
{ "album", TAG_ITEM_ALBUM },
|
||||
{ "title", TAG_ITEM_TITLE },
|
||||
{ "track", TAG_ITEM_TRACK },
|
||||
{ "name", TAG_ITEM_NAME },
|
||||
{ "genre", TAG_ITEM_GENRE },
|
||||
{ "date", TAG_ITEM_DATE },
|
||||
{ "composer", TAG_ITEM_COMPOSER },
|
||||
{ "performer", TAG_ITEM_PERFORMER },
|
||||
{ "comment", TAG_ITEM_COMMENT },
|
||||
{ "disc", TAG_ITEM_DISC },
|
||||
{ "artist", TAG_ARTIST },
|
||||
{ "album", TAG_ALBUM },
|
||||
{ "title", TAG_TITLE },
|
||||
{ "track", TAG_TRACK },
|
||||
{ "name", TAG_NAME },
|
||||
{ "genre", TAG_GENRE },
|
||||
{ "date", TAG_DATE },
|
||||
{ "composer", TAG_COMPOSER },
|
||||
{ "performer", TAG_PERFORMER },
|
||||
{ "comment", TAG_COMMENT },
|
||||
{ "disc", TAG_DISC },
|
||||
};
|
||||
|
||||
/** A pointer type for format converter function. */
|
||||
|
|
|
@ -95,7 +95,7 @@ icy_parse_tag_item(struct tag *tag, const char *item)
|
|||
|
||||
if (p[0] != NULL && p[1] != NULL) {
|
||||
if (strcmp(p[0], "StreamTitle") == 0)
|
||||
icy_add_item(tag, TAG_ITEM_TITLE, p[1]);
|
||||
icy_add_item(tag, TAG_TITLE, p[1]);
|
||||
else
|
||||
g_debug("unknown icy-tag: '%s'", p[0]);
|
||||
}
|
||||
|
|
|
@ -402,8 +402,8 @@ copy_icy_tag(struct input_curl *c)
|
|||
if (c->tag != NULL)
|
||||
tag_free(c->tag);
|
||||
|
||||
if (c->meta_name != NULL && !tag_has_type(tag, TAG_ITEM_NAME))
|
||||
tag_add_item(tag, TAG_ITEM_NAME, c->meta_name);
|
||||
if (c->meta_name != NULL && !tag_has_type(tag, TAG_NAME))
|
||||
tag_add_item(tag, TAG_NAME, c->meta_name);
|
||||
|
||||
c->tag = tag;
|
||||
}
|
||||
|
@ -609,7 +609,7 @@ input_curl_headerfunction(void *ptr, size_t size, size_t nmemb, void *stream)
|
|||
tag_free(c->tag);
|
||||
|
||||
c->tag = tag_new();
|
||||
tag_add_item(c->tag, TAG_ITEM_NAME, c->meta_name);
|
||||
tag_add_item(c->tag, TAG_NAME, c->meta_name);
|
||||
} else if (g_ascii_strcasecmp(name, "icy-metaint") == 0) {
|
||||
char buffer[64];
|
||||
size_t icy_metaint;
|
||||
|
|
|
@ -223,9 +223,9 @@ lastfm_read_tag(const char *response)
|
|||
enum tag_type type;
|
||||
const char *xmltag;
|
||||
} aliases[] = {
|
||||
{TAG_ITEM_ARTIST, "creator"},
|
||||
{TAG_ITEM_TITLE, "title"},
|
||||
{TAG_ITEM_ALBUM, "album"}
|
||||
{TAG_ARTIST, "creator"},
|
||||
{TAG_TITLE, "title"},
|
||||
{TAG_ALBUM, "album"}
|
||||
};
|
||||
struct tag *tag = tag_new();
|
||||
unsigned int i;
|
||||
|
|
|
@ -433,9 +433,8 @@ httpd_output_tag(void *data, const struct tag *tag)
|
|||
page_unref (httpd->metadata);
|
||||
|
||||
httpd->metadata =
|
||||
icy_server_metadata_page(tag, TAG_ITEM_ALBUM,
|
||||
TAG_ITEM_ARTIST,
|
||||
TAG_ITEM_TITLE,
|
||||
icy_server_metadata_page(tag, TAG_ALBUM,
|
||||
TAG_ARTIST, TAG_TITLE,
|
||||
TAG_NUM_OF_ITEM_TYPES);
|
||||
if (httpd->metadata != NULL) {
|
||||
g_mutex_lock(httpd->mutex);
|
||||
|
|
|
@ -471,10 +471,10 @@ shout_tag_to_metadata(const struct tag *tag, char *dest, size_t size)
|
|||
|
||||
for (unsigned i = 0; i < tag->num_items; i++) {
|
||||
switch (tag->items[i]->type) {
|
||||
case TAG_ITEM_ARTIST:
|
||||
case TAG_ARTIST:
|
||||
strncpy(artist, tag->items[i]->value, size);
|
||||
break;
|
||||
case TAG_ITEM_TITLE:
|
||||
case TAG_TITLE:
|
||||
strncpy(title, tag->items[i]->value, size);
|
||||
break;
|
||||
|
||||
|
|
|
@ -69,12 +69,12 @@ static int songvec_cmp(const void *s1, const void *s2)
|
|||
int ret;
|
||||
|
||||
/* first sort by disc */
|
||||
ret = compare_tag_item(a->tag, b->tag, TAG_ITEM_DISC);
|
||||
ret = compare_tag_item(a->tag, b->tag, TAG_DISC);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
/* then by track number */
|
||||
ret = compare_tag_item(a->tag, b->tag, TAG_ITEM_TRACK);
|
||||
ret = compare_tag_item(a->tag, b->tag, TAG_TRACK);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
|
|
|
@ -52,11 +52,11 @@ visit_tag(struct visit_data *data, const struct tag *tag)
|
|||
const struct tag_item *item = tag->items[i];
|
||||
|
||||
switch (item->type) {
|
||||
case TAG_ITEM_ARTIST:
|
||||
case TAG_ARTIST:
|
||||
strset_add(data->artists, item->value);
|
||||
break;
|
||||
|
||||
case TAG_ITEM_ALBUM:
|
||||
case TAG_ALBUM:
|
||||
strset_add(data->albums, item->value);
|
||||
break;
|
||||
|
||||
|
|
26
src/tag.c
26
src/tag.c
|
@ -42,20 +42,20 @@ static struct {
|
|||
} bulk;
|
||||
|
||||
const char *tag_item_names[TAG_NUM_OF_ITEM_TYPES] = {
|
||||
"Artist",
|
||||
[TAG_ARTIST] = "Artist",
|
||||
[TAG_ARTIST_SORT] = "ArtistSort",
|
||||
"Album",
|
||||
"AlbumArtist",
|
||||
[TAG_ALBUM] = "Album",
|
||||
[TAG_ALBUM_ARTIST] = "AlbumArtist",
|
||||
[TAG_ALBUM_ARTIST_SORT] = "AlbumArtistSort",
|
||||
"Title",
|
||||
"Track",
|
||||
"Name",
|
||||
"Genre",
|
||||
"Date",
|
||||
"Composer",
|
||||
"Performer",
|
||||
"Comment",
|
||||
"Disc",
|
||||
[TAG_TITLE] = "Title",
|
||||
[TAG_TRACK] = "Track",
|
||||
[TAG_NAME] = "Name",
|
||||
[TAG_GENRE] = "Genre",
|
||||
[TAG_DATE] = "Date",
|
||||
[TAG_COMPOSER] = "Composer",
|
||||
[TAG_PERFORMER] = "Performer",
|
||||
[TAG_COMMENT] = "Comment",
|
||||
[TAG_DISC] = "Disc",
|
||||
|
||||
/* MusicBrainz tags from http://musicbrainz.org/doc/MusicBrainzTag */
|
||||
[TAG_MUSICBRAINZ_ARTISTID] = "MUSICBRAINZ_ARTISTID",
|
||||
|
@ -83,7 +83,7 @@ void tag_lib_init(void)
|
|||
/* parse the "metadata_to_use" config parameter below */
|
||||
|
||||
/* ignore comments by default */
|
||||
ignore_tag_items[TAG_ITEM_COMMENT] = true;
|
||||
ignore_tag_items[TAG_COMMENT] = true;
|
||||
|
||||
value = config_get_string(CONF_METADATA_TO_USE, NULL);
|
||||
if (value == NULL)
|
||||
|
|
24
src/tag.h
24
src/tag.h
|
@ -31,20 +31,20 @@
|
|||
* Codes for the type of a tag item.
|
||||
*/
|
||||
enum tag_type {
|
||||
TAG_ITEM_ARTIST,
|
||||
TAG_ARTIST,
|
||||
TAG_ARTIST_SORT,
|
||||
TAG_ITEM_ALBUM,
|
||||
TAG_ITEM_ALBUM_ARTIST,
|
||||
TAG_ALBUM,
|
||||
TAG_ALBUM_ARTIST,
|
||||
TAG_ALBUM_ARTIST_SORT,
|
||||
TAG_ITEM_TITLE,
|
||||
TAG_ITEM_TRACK,
|
||||
TAG_ITEM_NAME,
|
||||
TAG_ITEM_GENRE,
|
||||
TAG_ITEM_DATE,
|
||||
TAG_ITEM_COMPOSER,
|
||||
TAG_ITEM_PERFORMER,
|
||||
TAG_ITEM_COMMENT,
|
||||
TAG_ITEM_DISC,
|
||||
TAG_TITLE,
|
||||
TAG_TRACK,
|
||||
TAG_NAME,
|
||||
TAG_GENRE,
|
||||
TAG_DATE,
|
||||
TAG_COMPOSER,
|
||||
TAG_PERFORMER,
|
||||
TAG_COMMENT,
|
||||
TAG_DISC,
|
||||
|
||||
TAG_MUSICBRAINZ_ARTISTID,
|
||||
TAG_MUSICBRAINZ_ALBUMID,
|
||||
|
|
|
@ -26,13 +26,13 @@
|
|||
#include <stdio.h>
|
||||
|
||||
static const char *const ape_tag_names[] = {
|
||||
[TAG_ITEM_TITLE] = "title",
|
||||
[TAG_ITEM_ARTIST] = "artist",
|
||||
[TAG_ITEM_ALBUM] = "album",
|
||||
[TAG_ITEM_COMMENT] = "comment",
|
||||
[TAG_ITEM_GENRE] = "genre",
|
||||
[TAG_ITEM_TRACK] = "track",
|
||||
[TAG_ITEM_DATE] = "year"
|
||||
[TAG_TITLE] = "title",
|
||||
[TAG_ARTIST] = "artist",
|
||||
[TAG_ALBUM] = "album",
|
||||
[TAG_COMMENT] = "comment",
|
||||
[TAG_GENRE] = "genre",
|
||||
[TAG_TRACK] = "track",
|
||||
[TAG_DATE] = "year"
|
||||
};
|
||||
|
||||
static struct tag *
|
||||
|
|
|
@ -157,7 +157,7 @@ tag_id3_import_text(struct tag *dest, struct id3_tag *tag, const char *id,
|
|||
if (ucs4 == NULL)
|
||||
continue;
|
||||
|
||||
if (type == TAG_ITEM_GENRE)
|
||||
if (type == TAG_GENRE)
|
||||
ucs4 = id3_genre_name(ucs4);
|
||||
|
||||
utf8 = import_id3_string(tag_is_id3v1(tag), ucs4);
|
||||
|
@ -311,23 +311,23 @@ struct tag *tag_id3_import(struct id3_tag * tag)
|
|||
{
|
||||
struct tag *ret = tag_new();
|
||||
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_ARTIST, TAG_ITEM_ARTIST);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_ARTIST, TAG_ARTIST);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_ALBUM_ARTIST,
|
||||
TAG_ITEM_ALBUM_ARTIST);
|
||||
TAG_ALBUM_ARTIST);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_ARTIST_SORT,
|
||||
TAG_ARTIST_SORT);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_ALBUM_ARTIST_SORT,
|
||||
TAG_ALBUM_ARTIST_SORT);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_TITLE, TAG_ITEM_TITLE);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_ALBUM, TAG_ITEM_ALBUM);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_TRACK, TAG_ITEM_TRACK);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_YEAR, TAG_ITEM_DATE);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_GENRE, TAG_ITEM_GENRE);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_COMPOSER, TAG_ITEM_COMPOSER);
|
||||
tag_id3_import_text(ret, tag, "TPE3", TAG_ITEM_PERFORMER);
|
||||
tag_id3_import_text(ret, tag, "TPE4", TAG_ITEM_PERFORMER);
|
||||
tag_id3_import_comment(ret, tag, ID3_FRAME_COMMENT, TAG_ITEM_COMMENT);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_DISC, TAG_ITEM_DISC);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_TITLE, TAG_TITLE);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_ALBUM, TAG_ALBUM);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_TRACK, TAG_TRACK);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_YEAR, TAG_DATE);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_GENRE, TAG_GENRE);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_COMPOSER, TAG_COMPOSER);
|
||||
tag_id3_import_text(ret, tag, "TPE3", TAG_PERFORMER);
|
||||
tag_id3_import_text(ret, tag, "TPE4", TAG_PERFORMER);
|
||||
tag_id3_import_comment(ret, tag, ID3_FRAME_COMMENT, TAG_COMMENT);
|
||||
tag_id3_import_text(ret, tag, ID3_FRAME_DISC, TAG_DISC);
|
||||
|
||||
tag_id3_import_musicbrainz(ret, tag);
|
||||
tag_id3_import_ufid(ret, tag);
|
||||
|
|
Loading…
Reference in New Issue