Add titleSort tag

This commit is contained in:
Sonico 2022-07-20 18:12:51 -03:00
parent 0c98d93e9a
commit 3ef83cc34e
5 changed files with 10 additions and 0 deletions

View File

@ -283,6 +283,7 @@ The following tags are supported by :program:`MPD`:
* **albumartist**: on multi-artist albums, this is the artist name which shall be used for the whole album. The exact meaning of this tag is not well-defined.
* **albumartistsort**: same as albumartist, but for sorting.
* **title**: the song title.
* **titlesort**: same as title, but for sorting.
* **track**: the decimal track number within the album.
* **name**: a name for this song. This is not the song title. The exact meaning of this tag is not well-defined. It is often used by badly configured internet radio stations with broken tags to squeeze both the artist name and the song title in one tag.
* **genre**: the music genre.

View File

@ -40,11 +40,13 @@ static constexpr struct tag_table ffmpeg_tags[] = {
/* from libavformat/id3v2.c */
{ "album-sort", TAG_ALBUM_SORT },
{ "artist-sort", TAG_ARTIST_SORT },
{ "title-sort", TAG_TITLE_SORT},
/* from libavformat/mov.c */
{ "sort_album_artist", TAG_ALBUM_ARTIST_SORT },
{ "sort_album", TAG_ALBUM_SORT },
{ "sort_artist", TAG_ARTIST_SORT },
{ "sort_name", TAG_TITLE_SORT },
/* sentinel */
{ nullptr, TAG_NUM_OF_ITEM_TYPES }

View File

@ -55,6 +55,10 @@
#define ID3_FRAME_ALBUM_ARTIST "TPE2"
#endif
#ifndef ID3_FRAME_TITLE_SORT
#define ID3_FRAME_TITLE_SORT "TSOT"
#endif
#ifndef ID3_FRAME_ORIGINAL_RELEASE_DATE
#define ID3_FRAME_ORIGINAL_RELEASE_DATE "TDOR"
#endif
@ -352,6 +356,7 @@ scan_id3_tag(const struct id3_tag *tag, TagHandler &handler) noexcept
tag_id3_import_text(tag, ID3_FRAME_LABEL, TAG_LABEL,
handler);
tag_id3_import_text(tag, ID3_FRAME_MOOD, TAG_MOOD, handler);
tag_id3_import_text(tag, ID3_FRAME_TITLE_SORT, TAG_TITLE_SORT, handler);
tag_id3_import_musicbrainz(tag, handler);
tag_id3_import_ufid(tag, handler);

View File

@ -27,6 +27,7 @@ const char *const tag_item_names[TAG_NUM_OF_ITEM_TYPES] = {
[TAG_ALBUM_ARTIST] = "AlbumArtist",
[TAG_ALBUM_ARTIST_SORT] = "AlbumArtistSort",
[TAG_TITLE] = "Title",
[TAG_TITLE_SORT] = "TitleSort",
[TAG_TRACK] = "Track",
[TAG_NAME] = "Name",
[TAG_GENRE] = "Genre",

View File

@ -42,6 +42,7 @@ enum TagType
TAG_ALBUM_ARTIST,
TAG_ALBUM_ARTIST_SORT,
TAG_TITLE,
TAG_TITLE_SORT,
TAG_TRACK,
TAG_NAME,
TAG_GENRE,