beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.69k stars 1.81k forks source link

Can't modify ARTISTSORT tag #2737

Closed CommunicationAnimale closed 6 years ago

CommunicationAnimale commented 6 years ago

Problem

I cannot modify the albumsort tag on my songs. Whether I write it albumsort or ALBUMSORT, beet will ask if I want to modify the tag, however the old value is not the one seen by ffprobe. After that, the ALBUMSORT tag as seen by ffprobe is unchanged. However something did change because if I run beet modify again, nothing happens.

$ ffprobe 03\ Super\ disco.flac
ffprobe version 3.3.4 Copyright (c) 2007-2017 the FFmpeg developers
  ... (snip: ffmpeg build flags and version) 
Input #0, flac, from '03 Super disco.flac':
  Metadata:
    ACOUSTID_FINGERPRINT: AQADtMmkNEkTQ2RnhJfxHEdTB31kEdeDZkcydsjH7OhzeHwC_8d3lGuI_oMPf07QEzd6ZWg-9EHz4MGNHcyP4BD24_ghHrngwwf6ozCOHDYONDh6nMAB4TiG_waO4zgEHAcO_wCOaCeA4wiO4wKOQ8EOHz_M4zhwGz9w6DiG4_CNG8HhE8Nx5LiGD8rxG9KPA_keED5CHDJ9PDru3GjWD32iQOeRkcRTeHPx4_hxOgtCjofIULi2wBtIZYA_tHy
    ACOUSTID_ID     : 0cd16743-b3e8-4e54-a90c-38d9ae6b71c5
    ALBUM           : Super Discount
    ALBUM ARTIST    : Étienne de Crécy
    album_artist    : Étienne de Crécy
    ALBUMARTIST_CREDIT: Étienne de Crécy
    ALBUMARTISTSORT : Crécy, Étienne de
    MUSICBRAINZ_ALBUMCOMMENT: with 5 track bonus disc
    MUSICBRAINZ_ALBUMSTATUS: Official
    MUSICBRAINZ_ALBUMTYPE: remix
    ARTIST          : Alex Gopher
    ARTIST_CREDIT   : Alex Gopher
    ARTISTSORT      : Gopher, Alex
    BPM             : 0
    CATALOGNUMBER   : 451.0002.023
    COMPILATION     : 0
    RELEASECOUNTRY  : FR
    DATE            : 2002
    YEAR            : 2002
    disc            : 1
    DISCTOTAL       : 2
    DISCC           : 2
    TOTALDISCS      : 2
    GENRE           : Electronic
    LABEL           : Play It Again Sam
    PUBLISHER       : Play It Again Sam
    LANGUAGE        : fra
    MUSICBRAINZ_ALBUMARTISTID: f174152d-da33-46bd-8cb4-c8d24b834bf7
    MUSICBRAINZ_ALBUMID: 9cb4be22-0c33-4042-aba3-d6293750ce47
    MUSICBRAINZ_ARTISTID: ee1a6d4a-b1ff-46a8-acf2-af575424bda5
    MUSICBRAINZ_RELEASEGROUPID: f871a7a3-491f-3fb1-a8c0-51cfbd22def3
    MUSICBRAINZ_TRACKID: 0a6b2519-7be3-45bf-88a6-52ac16dbcf96
    MEDIA           : CD
    ORIGINALDATE    : 1997
    R128_ALBUM_GAIN : 0
    R128_TRACK_GAIN : 0
    SCRIPT          : Latn
    TITLE           : Super disco
    track           : 3
    TRACKTOTAL      : 16
    TRACKC          : 16
    TOTALTRACKS     : 16
  Duration: 00:06:35.67, start: 0.000000, bitrate: 1009 kb/s
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16

$ beet -vv modify title:"Super Disco" Crécy artist="Étienne de Crécy" artistsort="Étienne de Crécy," artist_credit="Étienne de Crécy"
user configuration: /home/vogier/.config/beets/config.yaml
data directory: /home/vogier/.config/beets
plugin paths:
Sending event: pluginload
lyrics: Disabling google source: no API key configured.
library database: /run/media/vogier/9744c941-8257-4b34-a90d-cf51debb94f9/Music/Beets/musiclibrary.db
library directory: /run/media/vogier/9744c941-8257-4b34-a90d-cf51debb94f9/Music/Beets/Library
Sending event: library_opened
Modifying 1 items.
Alex Gopher - Super Discount - Super disco
  artist: Alex Gopher -> Étienne de Crécy
  artist_credit: Alex Gopher -> Étienne de Crécy
  artistsort: Étienne de Crécy -> Étienne de Crécy,
Really modify, move and write tags? (Yes/no/select) yes
Sending event: write
Sending event: after_write
moving /run/media/vogier/9744c941-8257-4b34-a90d-cf51debb94f9/Music/Beets/Library/Étienne de Crécy/Super Discount/03 Super disco.flac to synchronize path
Sending event: before_item_moved
Sending event: item_moved
Sending event: database_change
Sending event: database_change
Sending event: database_change
Sending event: cli_exit

$ ffprobe 03\ Super\ disco.flac
ffprobe version 3.3.4 Copyright (c) 2007-2017 the FFmpeg developers
   ...(snip)...
Input #0, flac, from '03 Super disco.flac':
  Metadata:
    ACOUSTID_FINGERPRINT: AQADtMmkNEkTQ2RnhJfxHEdTB31kEdeDZkcydsjH7OhzeHwC_8d3lGuI_oMPf07QEzd6ZWg-9EHz4MGNHcyP4BD24_ghHrngwwf6ozCOHDYONDh6nMAB4TiG_waO4zgEHAcO_wCOaCeA4wiO4wKOQ8EOHz_M4zhwGz9w6DiG4_CNG8HhE8Nx5LiGD8rxG9KPA_keED5CHDJ9PDru3GjWD32iQOeRkcRTeHPx4_hxOgtCjofIULi2wBtIZYA_tHy
    ACOUSTID_ID     : 0cd16743-b3e8-4e54-a90c-38d9ae6b71c5
    ALBUM           : Super Discount
    ALBUM ARTIST    : Étienne de Crécy
    album_artist    : Étienne de Crécy
    ALBUMARTIST_CREDIT: Étienne de Crécy
    ALBUMARTISTSORT : Crécy, Étienne de
    MUSICBRAINZ_ALBUMCOMMENT: with 5 track bonus disc
    MUSICBRAINZ_ALBUMSTATUS: Official
    MUSICBRAINZ_ALBUMTYPE: remix
    ARTIST          : Étienne de Crécy
    ARTIST_CREDIT   : Étienne de Crécy
    ARTISTSORT      : Gopher, Alex
    BPM             : 0
    CATALOGNUMBER   : 451.0002.023
    COMPILATION     : 0
    RELEASECOUNTRY  : FR
    DATE            : 2002
    YEAR            : 2002
    disc            : 1
    DISCTOTAL       : 2
    DISCC           : 2
    TOTALDISCS      : 2
    GENRE           : Electronic
    LABEL           : Play It Again Sam
    PUBLISHER       : Play It Again Sam
    LANGUAGE        : fra
    MUSICBRAINZ_ALBUMARTISTID: f174152d-da33-46bd-8cb4-c8d24b834bf7
    MUSICBRAINZ_ALBUMID: 9cb4be22-0c33-4042-aba3-d6293750ce47
    MUSICBRAINZ_ARTISTID: ee1a6d4a-b1ff-46a8-acf2-af575424bda5
    MUSICBRAINZ_RELEASEGROUPID: f871a7a3-491f-3fb1-a8c0-51cfbd22def3
    MUSICBRAINZ_TRACKID: 0a6b2519-7be3-45bf-88a6-52ac16dbcf96
    MEDIA           : CD
    ORIGINALDATE    : 1997
    R128_ALBUM_GAIN : 0
    R128_TRACK_GAIN : 0
    SCRIPT          : Latn
    TITLE           : Super disco
    track           : 3
    TRACKTOTAL      : 16
    TRACKC          : 16
    TOTALTRACKS     : 16
  Duration: 00:06:35.67, start: 0.000000, bitrate: 1009 kb/s
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16

$ beet -vv modify title:"Super Disco" Crécy artist="Étienne de Crécy" artistsort="Étienne de Crécy," artist_credit="Étienne de Crécy"
user configuration: /home/vogier/.config/beets/config.yaml
data directory: /home/vogier/.config/beets
plugin paths:
Sending event: pluginload
lyrics: Disabling google source: no API key configured.
library database: /run/media/vogier/9744c941-8257-4b34-a90d-cf51debb94f9/Music/Beets/musiclibrary.db
library directory: /run/media/vogier/9744c941-8257-4b34-a90d-cf51debb94f9/Music/Beets/Library
Sending event: library_opened
Modifying 1 items.
No changes to make.
Sending event: cli_exit

Setup

My configuration (output of beet config) is:

lyrics:
    bing_lang_from: []
    auto: yes
    bing_client_secret: REDACTED
    bing_lang_to:
    google_API_key: REDACTED
    google_engine_ID: REDACTED
    genius_api_key: REDACTED
    fallback:
    force: no
    sources: [google, lyricwiki, musixmatch]
directory: /run/media/vogier/9744c941-8257-4b34-a90d-cf51debb94f9/Music/Beets/Library
library: /run/media/vogier/9744c941-8257-4b34-a90d-cf51debb94f9/Music/Beets/musiclibrary.db

import:
    copy: yes
    move: no
    incremental: yes
    autotag: no

plugins:
- fetchart
- lyrics
- convert
- ftintitle
- chroma
convert:
    dest: /run/media/vogier/9744c941-8257-4b34-a90d-cf51debb94f9/Music/Converted
    never_convert_lossy_files: yes
    copy_album_art: yes
    command: ffmpeg -i $source -vn -c:a libopus -vbr on -b:a 129k -threads 0 $dest
    extension: ogg
    pretend: no
    threads: 4
    format: mp3
    formats:
        aac:
            command: ffmpeg -i $source -y -vn -acodec aac -aq 1 $dest
            extension: m4a
        alac:
            command: ffmpeg -i $source -y -vn -acodec alac $dest
            extension: m4a
        flac: ffmpeg -i $source -y -vn -acodec flac $dest
        mp3: ffmpeg -i $source -y -vn -aq 2 $dest
        opus: ffmpeg -i $source -y -vn -acodec libopus -ab 96k $dest
        ogg: ffmpeg -i $source -y -vn -acodec libvorbis -aq 3 $dest
        wma: ffmpeg -i $source -y -vn -acodec wmav2 -vn $dest
    max_bitrate: 500
    auto: no
    tmpdir:
    quiet: no
    embed: yes

    paths: {}
    album_art_maxwidth: 0
acoustid:
    apikey: REDACTED
ftintitle:
    auto: yes
    drop: no
    format: feat. {0}
fetchart:
    auto: yes
    minwidth: 0
    maxwidth: 0
    enforce_ratio: no
    cautious: no
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
    sources:
    - filesystem
    - coverart
    - itunes
    - amazon
    - albumart
    google_key: REDACTED
    google_engine: 001442825323518660753:hrh5ch1gjzm
    fanarttv_key: REDACTED
    store_source: no
chroma:
    auto: yes

EDIT: I can independently edit the ARTISTSORT and the artistsort tag (set them to two different values), they both had the value "Etienne de Crécy", but modifications don't show up in ffprobe.

sampsyo commented 6 years ago

Hello! An important insight here is that beets has its own internal names for tags. These map onto the various tag names in different file formats, so they do not necessarily match the names in Vorbis Comments specifically.

You can see a list of fields beets supports by typing beet fields. I think the tag you want is called artist_sort.

CommunicationAnimale commented 6 years ago

My mistake ! After trying different solutions, it appears that the sorting issue was simply a bug in the version of VLC for Android I was using. I will close this issue in a minute. Thank you for the quick reply (I'm several orders of magnitude slower than you here)!