Extract the first value from the multi-valued tag of the album artist in flac

Considering that it is unlikely that Plex will support multiple artists at the database level, I suggest only reading the first value of the multi-value tag for the album artist of FLAC audio, because merging multiple values into a new field and saving it to the Plex database is too cumbersome, which makes it impossible to navigate by album artist.

Server Version#: 1.41.9.9961

❯ ffprobe "101 - Purple Moonlight.flac"
ffprobe version 2025-08-04-git-9a32b86307-full_build-www.gyan.dev Copyright (c) 2007-2025 the FFmpeg developers
  built with gcc 15.1.0 (Rev6, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-lcms2 --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-libdvdnav --enable-libdvdread --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libopenjpeg --enable-libquirc --enable-libuavs3d --enable-libxevd --enable-libzvbi --enable-liboapv --enable-libqrencode --enable-librav1e --enable-libsvtav1 --enable-libvvenc --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxeve --enable-libxvid --enable-libaom --enable-libjxl --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl --enable-nvdec --enable-nvenc --enable-vaapi --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-openal --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-liblc3 --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      60.  7.100 / 60.  7.100
  libavcodec     62.  8.100 / 62.  8.100
  libavformat    62.  1.103 / 62.  1.103
  libavdevice    62.  0.100 / 62.  0.100
  libavfilter    11.  3.100 / 11.  3.100
  libswscale      9.  0.100 /  9.  0.100
  libswresample   6.  0.100 /  6.  0.100
Input #0, flac, from '101 - Purple Moonlight.flac':
  Metadata:
    album           : Endless Recollection
    album_artist    : 14?;Aosaki
    albumartistsortorder: 14?
    albumsortorder  : Endless Recollection
    artist          : 14?
    artistsortorder : 14?
    composer        : 金志
    composersortorder: 金志
    copyright       : ℗ 2021 Mintone Records
    date            : 2021-11-09
    disc            : 1
    genre           : Hip-Hop/Rap
    ISRC            : FRX872166128
    itunesadvisory  : 0
    itunesartistid  : 1459222068
    itunescatalogid : 1596855269
    itunescompilation: 0
    LABEL           : Mintone Records
    PERFORMER       : 14?
    title           : Purple Moonlight
    titlesortorder  : Purple Moonlight
    DISCTOTAL       : 1
    TRACKTOTAL      : 10
    track           : 1
    UPC             : 3616841971347
  Duration: 00:03:26.85, start: 0.000000, bitrate: 1560 kb/s
  Stream #0:0: Audio: flac, 48000 Hz, stereo, s32 (24 bit)
  Stream #0:1: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1440x1440 [SAR 72:72 DAR 1:1], 90k tbr, 90k tbn (attached pic)
    Metadata:
      comment         : Cover (front)

❯ metaflac --list --block-type=VORBIS_COMMENT ‘101 - Purple Moonlight.flac’
METADATA block #1
type: 4 (VORBIS_COMMENT)
is last: false
length: 652
vendor string: reference libFLAC 1.4.3 20230623
comments: 26
comment[0]: album=Endless Recollection
comment[1]: ALBUMARTIST=14?
comment[2]: ALBUMARTIST=Aosaki
comment[3]: albumartistsortorder=14?
comment[4]: albumsortorder=Endless Recollection
comment[5]: artist=14?
comment[6]: artistsortorder=14?
comment[7]: composer=金志
comment[8]: composersortorder=金志
comment[9]: copyright=℗ 2021 Mintone Records
comment[10]: date=2021-11-09
comment[11]: discnumber=1
comment[12]: genre=Hip-Hop/Rap
comment[13]: ISRC=FRX872166128
comment[14]: itunesadvisory=0
comment[15]: itunesartistid=1459222068
comment[16]: itunescatalogid=1596855269
comment[17]: itunescompilation=0
comment[18]: LABEL=Mintone Records
comment[19]: PERFORMER=14?
comment[20]: title=Purple Moonlight
comment[21]: titlesortorder=Purple Moonlight
comment[22]: DISCTOTAL=1
comment[23]: TRACKTOTAL=10
comment[24]: tracknumber=1
comment[25]: UPC=3616841971347

I don’t know whether Plex uses ffmpeg or taglib to parse audio metadata. Since the current database does not support multi-album artists, it would be unreasonable to concatenate multi-album artists and save them as a new field. It would be more user-friendly to just read the first field.

If Plex ever radically rebuilt its database and implemented true multi-artist support, users would only need to refresh their metadata instead of manually re-entering all the lost album artist metadata one by one!

If, in order to adapt to the current Plex, you delete all but one of the multi-value album artists and then have to fill them back in one by one when the time comes, it would be a disaster for a large audio library. Who has the time and energy for that?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.