Smitty018210 160 Posted June 7 Posted June 7 I am working on a small helper app for my Emby People metadata. The app scans the Emby metadata/people area and looks for possible duplicate person profiles. The goal is not to blindly delete anything. The goal is to help review possible duplicate People folders before doing anything risky. Right now the app is looking for duplicates by things like: Same normalized person name Same TMDB person ID Same IMDb person ID Linked duplicate chains, where one profile matches by name and another matches by provider ID Skipped/problem profiles with missing or unreadable info The issue I am trying to solve is duplicate People folders like this: Vin Diesel Vin Diesel-tmdb-12835 or cases where one profile has provider IDs and another is name-only. My concern is this: If I delete the “bad” / name-only People folder, will Emby just recreate it later from movie/show/episode cast metadata? From what I understand, the person profile NFO itself does not store credits/media links. The media item metadata is what contains cast/actor information. So deleting a People folder may only delete the stored person metadata/image folder, but it may not fix whatever source caused Emby to create that person entry in the first place. I am trying to find the safest and most Emby-correct cleanup path. Questions for the Emby dev team: Is the correct preferred People folder format still like this? Person Name-tmdb-123456 Person Name-imdb-nm1234567 Should TMDB ID be treated as the preferred primary person ID, with IMDb as fallback? If a duplicate name-only People folder exists beside a provider-ID folder, what is the safest way to remove or merge that duplicate? Does Emby recreate name-only People folders when media NFO/cast metadata does not include a provider ID? If local NFOs are used, should the fix be made in the movie/show/episode NFO actor entries first, before deleting any duplicate People folder? Is there any safe way through Emby API or metadata refresh to tell Emby that one person profile should be treated as the correct one? Is there a recommended process for cleaning duplicate People records without damaging existing images, locked profiles, or manually edited person metadata? What I am trying to avoid is building a delete/cleanup feature that appears to work, but then Emby recreates the same duplicate People profile on the next scan because the source metadata still points to a name-only actor entry. Any guidance on the correct order of operations would help. For example, should the safe process be something like: Identify the good provider-ID People profile. Check movie/show/episode cast metadata for name-only actor entries. Correct actor/provider IDs in the media NFOs first. Refresh/rescan Emby. Only delete the duplicate People folder after Emby stops recreating or using it. I would appreciate any clarification on how Emby decides when to create a new People folder versus reuse an existing People profile, especially when one profile is name-only and another has TMDB/IMDb IDs.
ginjaninja 613 Posted June 7 Posted June 7 Is the end goal to ensure your library metadata is right/deduped or the metadata folder on filesystem? I would be tempted to focus on getting the library metadata correct and trust that emby will sort out the filesystem (apart from wasted space, does it matter?). That wont clean duplicates on the filesystem but at least your library will be 'correct'. I dont recall the api exposes the filesystem related metadata links, i think you just have to trust Emby in that regard..
Smitty018210 160 Posted June 7 Author Posted June 7 (edited) 1 hour ago, ginjaninja said: Is the end goal to ensure your library metadata is right/deduped or the metadata folder on filesystem? I would be tempted to focus on getting the library metadata correct and trust that emby will sort out the filesystem (apart from wasted space, does it matter?). That wont clean duplicates on the filesystem but at least your library will be 'correct'. I dont recall the api exposes the filesystem related metadata links, i think you just have to trust Emby in that regard.. Right now I have 14,883 possible duplicate People profiles showing in my People folder. A lot of them have wrong information, duplicated information, or look like old/bad profiles that are just sitting there doing nothing. Emby could be using a profile with outdated info, missing info, or just plain wrong info, while the correct profile/folder is sitting right next to it. I know some of these are probably not true duplicates. Some are likely different people who happen to share the same name. I understand that part. What I am trying to figure out is why Emby created so many of these People folders in the first place. These are not just empty folders. They have pictures, NFO files, and profile data. Right now I am trying to do two things: Remove old, bad, wrong, or duplicate profiles. Understand why Emby created this many People folders, so when I do clean them up, I don't end up having the same problem happen again. Edited Sunday at 10:40 AM by Smitty018210
Smitty018210 160 Posted Wednesday at 09:38 AM Author Posted Wednesday at 09:38 AM (edited) @LukeIs there anyway you can point me in the right direction/give me info on this? Edited Wednesday at 09:39 AM by Smitty018210
Luke 42557 Posted Wednesday at 05:50 PM Posted Wednesday at 05:50 PM Quote The app scans the Emby metadata/people area and looks for possible duplicate person profiles. For starters I would have it look in the database rather than the folders. You could have old folders in there left behind that aren't being used anymore but that doesn't mean that you have a duplicate person in the database.
Luke 42557 Posted Wednesday at 05:51 PM Posted Wednesday at 05:51 PM Quote If I delete the “bad” / name-only People folder You're not deleting a person when you do this. The only thing this accomplishes is deleting metadata saved to disk.
Luke 42557 Posted Wednesday at 05:52 PM Posted Wednesday at 05:52 PM I think first you have to decide whether your goal is to cleanup duplicates in the emby user interface, or in the folders.
Smitty018210 160 Posted Wednesday at 08:47 PM Author Posted Wednesday at 08:47 PM 2 hours ago, Luke said: I think first you have to decide whether your goal is to cleanup duplicates in the emby user interface, or in the folders. It’s kind of both. This is only part of a larger app I’m creating to help clean up and manage Emby people profiles, including profile images, backdrop images, metadata, and related files. You might not remember, but last year I asked about adding backdrop support for people profiles in Emby, and it was added. Thanks again for that. While I was deciding how I wanted to add and organize my backdrop images, I discovered that I had a large number of duplicate people folders and profiles. I decided that I need to clean up those duplicate folders and profiles before moving forward with the backdrop images. The ultimate goal is to have one profile/folder for each person, and not have old unused data just sitting there taking up space.
Luke 42557 Posted Wednesday at 09:17 PM Posted Wednesday at 09:17 PM In the UI it would be going to the content the actor is tagged in and editing the people list to make sure data matches across all usages of that person. it's not about editing the person themselves.
Smitty018210 160 Posted Wednesday at 09:47 PM Author Posted Wednesday at 09:47 PM Ok, so you mean going to the metadata of each of media/videos that the person is in and making sure that the name is correct across all of them. Ok, that make sense. But that does not explain how this happened. Vin Diesel Vin Diesel-tmdb-12835 Why would Emby create this profile "Vin Diesel-tmdb-12835" when the other one was already there? How did that happen? Why does profile have "tmdb-12835 " in the name?
Luke 42557 Posted Wednesday at 10:18 PM Posted Wednesday at 10:18 PM it's not a profile, it's just a folder holding data. Quote Why does profile have "tmdb-12835 " in the name? This helps deal with cases of different people of the same name.
Smitty018210 160 Posted Wednesday at 10:28 PM Author Posted Wednesday at 10:28 PM 9 minutes ago, Luke said: it's not a profile, it's just a folder holding data. This helps deal with cases of different people of the same name. Ok, that does not make sense with my example? Vin Diesel Vin Diesel-tmdb-12835
pünktchen 1418 Posted Wednesday at 10:48 PM Posted Wednesday at 10:48 PM 48 minutes ago, Smitty018210 said: Why would Emby create this profile "Vin Diesel-tmdb-12835" when the other one was already there? How did that happen? This happens at the time of the library scan if the meta data provider doesn't know the persons TMDB id, most of the times if TVDB is the primary meta data provider. This will just create the "Vin Diesel" folder with only the person image inside. If you now click on the person in Emby, it will use TMDB to search for the person and it's details. This will create the "Vin Diesel-tmdb-12835" folder with the person nfo inside. But the person image is still referenced in the old folder!
Smitty018210 160 Posted Wednesday at 11:22 PM Author Posted Wednesday at 11:22 PM 21 minutes ago, pünktchen said: This happens at the time of the library scan if the meta data provider doesn't know the persons TMDB id, most of the times if TVDB is the primary meta data provider. This will just create the "Vin Diesel" folder with only the person image inside. If you now click on the person in Emby, it will use TMDB to search for the person and it's details. This will create the "Vin Diesel-tmdb-12835" folder with the person nfo inside. But the person image is still referenced in the old folder! Ok, that makes more sense now. Emby can be using multiple folders to store info/images for one person. Seems weird that happened for someone like Vin Diesel, but at least that makes more sense. What would be the best way to clean this up? Quarantine these folders/ move them to different folder, and then wait for Emby to recreate person folder over time?
pünktchen 1418 Posted Wednesday at 11:47 PM Posted Wednesday at 11:47 PM 22 minutes ago, Smitty018210 said: What would be the best way to clean this up? Copy the image from the old to the new folder, update the image path in the library, delete the old folder.
Solution Smitty018210 160 Posted 2 hours ago Author Solution Posted 2 hours ago (edited) On 6/10/2026 at 6:48 PM, pünktchen said: This happens at the time of the library scan if the meta data provider doesn't know the persons TMDB id, most of the times if TVDB is the primary meta data provider. This will just create the "Vin Diesel" folder with only the person image inside. If you now click on the person in Emby, it will use TMDB to search for the person and it's details. This will create the "Vin Diesel-tmdb-12835" folder with the person nfo inside. But the person image is still referenced in the old folder! After doing some testing, what I’m finding does not match what you described. Most of these duplicate folders do not have images. Most are just folders with NFO files. In a few cases, they are completely empty folders. Sadly, it looks like my app dies here. Without a reliable way to clean up these folders, and without truly understanding why Emby creates two folders for the same person in the first place, I cannot move forward with testing. I really do thank you for your help though. Edited 2 hours ago by Smitty018210
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now