Duplicate Music Albums

Hello. I have seen multiple posts on this, but all I see is people saying to do the Plex Dance.

I keep getting multiple albums on a single folder, with songs being split between them:

Metadata should be all set correctly. Naming is as follows:
/data/music/Immortal Technique/Behind the Bars (2005)/<number - trackname>.mp3
Same goes for any other artist.

It’s annoying since these albums appear on random artists when adding media anywhere, and finding and doing the Plex Dance for each time this happens is not an option.

  1. see Plex sorts albums with identical album artist info in random ways - #5 by OttoKerner
  2. additonally, don’t forget to add the track number tag to all tracks of an album

Naming matches Music/ArtistName/AlbumName/TrackNumber - TrackName.ext from https://support.plex.tv/articles/200265296-adding-music-media-from-folders/

VLC reads media info like:

What else am I missing?

I don’t see a meta tag for AlbumArtist. Use a fully-blown tagger software like e.g. mp3tag which shows all tags.

Do also check for additional, but unnoticed white space characters in AlbumTitle and AlbumArtist tags. These could make tracks seem to be in different albums, when they only differ in some unseen space characters.

{
    "format": {
        "filename": "01 - Creation and Destruction (Instrumental).mp3",
        "nb_streams": 2,
        "nb_programs": 0,
        "nb_stream_groups": 0,
        "format_name": "mp3",
        "format_long_name": "MP2/3 (MPEG audio layer 2/3)",
        "start_time": "0.023021",
        "duration": "250.104000",
        "size": "5988343",
        "bit_rate": "191547",
        "probe_score": 51,
        "tags": {
            "title": "Creation and Destruction (Instrumental)",
            "artist": "Immortal Technique",
            "track": "1/20",
            "album": "Behind the Bars",
            "date": "2005-01-01",
            "genre": "Hip Hop",
            "encoder": "Lavf60.16.100",
            "album_artist": "Immortal Technique",
            "ID3v1 Comment": "https://www.youtube.com/watch",
            "purl": "https://www.youtube.com/watch?v=F8sAU-JeMto",
            "comment": "https://www.youtube.com/watch?v=F8sAU-JeMto",
            "synopsis": "Voici L'Instru De Immortal Technique \"Creation & Destruction\" Issue de Lalbum Revolutionary Vol.1 2002. Régalez Vous ! :)",
            "description": "Voici L'Instru De Immortal Technique \"Creation & Destruction\" Issue de Lalbum Revolutionary Vol.1 2002. Régalez Vous ! :)",
            "disc": "1/1",
            "publisher": "Viper Records",
            "MusicBrainz Album Status": "official",
            "MusicBrainz Album Type": "album",
            "MusicBrainz Album Id": "1488dfbe-1e48-4033-9c05-a25f898489eb",
            "MusicBrainz Artist Id": "ef4db186-ff43-4708-a713-3ce1e05657a1",
            "MusicBrainz Album Artist Id": "ef4db186-ff43-4708-a713-3ce1e05657a1",
            "MusicBrainz Release Group Id": "2a14736a-93f5-425c-a9a1-16a8dc5e44c3",
            "TMED": "CD",
            "TDOR": "2005-01-01",
            "MusicBrainz Release Track Id": "ad9a8346-59b3-47af-b6f4-79262784a220"
        }
    }
}

All the tags seem to be in order.

Just to make sure I checked all the files in this folder:

╰─$ for f in *.mp3; do 
  echo -n "$f: "; 
  ffprobe -v quiet -print_format json -show_format "$f" | jq -r '.format.tags.album_artist // "N/A"'
done

01 - Creation and Destruction (Instrumental).mp3: Immortal Technique
02 - Dominant Species (Instrumental).mp3: Immortal Technique
03 - Positive Balance (Instrumental).mp3: Immortal Technique
04 - Beef and Broccoli (Instrumental).mp3: Immortal Technique
05 - Spend Some Time (Remix) (Instrumental).mp3: Immortal Technique
06 - Dance With The Devil (Instrumental).mp3: Immortal Technique
07 - The Prophecy (Instrumental).mp3: Immortal Technique
08 - Understanding Why (Instrumental).mp3: Immortal Technique
09 - No Mercy (Instrumental).mp3: Immortal Technique
10 - The Illest (Instrumental).mp3: Immortal Technique
11 - The Point of No Return (Instrumental).mp3: Immortal Technique
12 - Harlem Streets (Instrumental).mp3: Immortal Technique
13 - Industrial Revolution (Instrumental).mp3: Immortal Technique
14 - Crossing the Boundary (Instrumental).mp3: Immortal Technique
15 - Internally Bleeding (Instrumental).mp3: Immortal Technique
16 - The Cause of Death (Instrumental).mp3: Immortal Technique
17 - Leaving the Past (Instrumental).mp3: Immortal Technique
18 - You Never Know (Instrumental).mp3: Immortal Technique
19 - Bin Laden (Instrumental).mp3: Immortal Technique
20 - Bin Laden (Remix) (Instrumental).mp3: Immortal Technique

Every album_artist is the same.
I can skip the Plex Dance by renaming the album (remove one letter for example), saving, and then restoring the album name. This also shows that Plex does recognize the album, and fetches correct metadata. The name is also the same as shown in the screenshot (there is no extra spaces, or any special characters).
However, this still does not fix the issue of Plex making multiple albums for a single entry.

I have also forgotten to mention, that these albums were already in the library before, and got split later on when I added something else (doesn’t matter what, another artist, another album, another track). So basically these albums split on scans.

Are you using the modern metadata agent? (“Plex Music”)

Have you checked your Server database file for corruption? GitHub - ChuckPa/DBRepair: Database repair utility for Plex Media Server databases

Yes (for the metadata agent), and actually, yes, I have used that tool just a week ago. Had an issue with stalling scans and metadata refreshes as soon as I started adding music to the library.

The stalling stopped after I ran the auto option. Took like 2h to finish.

I could try running it again and see if the issue reappears.

Verify that you are not affected by this: Library.db size more than doubled in latest version

I was, as it seems, but not anymore.


Backup from 21.05 is 32gb in size, but the one in use is 800mb. No wonder the repair tool took 2h to finish haha.

I have run the repair tool again, just in case, rescanned all my media, and refreshed music metadata. I will be on the lookout for the album duplicates.

Okay, so I think I figured it out.

The issue appears when converting flac to mp3. On scan, it splits the album for some reason, and imports some to the old one, and some to the newer one. It’s not like one album has flac files and another mp3 tho, all of them were converted sometime between scans.

Never convert. Particularly not from flac to mp3. It doesn’t make sense.

If you want a quality upgrade, add a new folder with the upgraded files while the old one is still present.
Scan the library.
Only then remove the old folder and scan the library again +empty trash.

That makes no sense. Series and movies work the same way but get scanned in just fine. Why should I “never convert”. I don’t really hear the difference between FLAC and 320kbps mp3.

Also, empty trash is enabled. Even emptying it manually doesn’t help in this case.

To have a future proof media collection. Storing the full quality of the source medium in a lossless format is the way to go. Already there are freely usable lossy compression formats which achieve the same sonic quality with way lower bitrate than mp3. Plexamp for example uses OPUS by default.
And there will be even more improved ones in the years to come, I’m certain.
But if you degrade the quality of your source files with a lossy format, then converting them into another lossy format will degrade their sonic quality much further than going from a lossless directly to the modern lossy format.
In other words: lossy re-compression=bad

And converting flac to opus on-the-fly, only when needed, is something that even low-end CPUs can do. No need to do that work in advance.

But don’t understand why I should not do it. I understand the benefits of lossless, I just don’t really care for it. I’d rather have 40-80% smaller files with no comparable difference with my setup.

Plex should scan these albums in without making duplicate albums regardless, since they are in the same directory with same metadata. When I transcode a series I don’t get a duplicate of the season, and same goes for movies.

As I said: future proof.
Listening habits/devices/environments change over time. In the future you may be in a situation where you will be able to discern between a lossy and a lossless playback. Or where you could reap the benefits of more modern compression formats. But you won’t be able to, because you painted yourself into a corner by using an ancient lossy format for your collection.
Which would then mean re-rip the discs – if you still have them, and if they all survived that long.

Have you tried the method I laid out above?

Once again, I do not care for audio quality, I want Plex to scan stuff correctly. This probably happens whenever you covert anything to anything.

Have you tried the method I laid out above?

No, as I have no files left to convert right now. And even if it would work using that method, what is the logic behind it? Why can a series be scanned in correctly when a file changes, but music does not?

Same thing happens when upgrading files. If I import my old files (FLAC), Plex creates a new album for them. Using your method works, but is the same annoyance as with the Plex Dance, since I have to move the files over by hand anytime I want to make a change.

I have also noticed the same issue when I convert from 24bit FLAC to 16bit.

I think scanning should work the same as it does for all other media, this just makes things confusing and tedious.