jmos1277 9 Posted December 3, 2022 Posted December 3, 2022 I just reinstalled Emby and re-imported my media using the NFO reader setting. All of my media imported great and things are going well. However, since I imported from NFO files, Emby didn't go out to TMDB to fetch 'people' images. Thus, all of my movies look like the attached image ... no headshots. I keep my MediaItems locked to prevent undesirable changes to my metadata. WITHOUT unlocking the metadata for each individual movie, is there a way that I can download headshots and metadata for the people in my database? Like a "Refresh People" option? Once upon a time, I feel like I remember "People" being in the Metadata Manager ... but there doesn't appear to be a "People" section anymore.
Luke 42085 Posted December 4, 2022 Posted December 4, 2022 Hi, if you run the scheduled task to scan the metadata folder, then you might get some of them back. The rest you will have to solve by refreshing the metadata on the movies or series. I understand your use case, that's just an open issue with it right now. Thanks.
jmos1277 9 Posted December 4, 2022 Author Posted December 4, 2022 1 hour ago, Luke said: Hi, if you run the scheduled task to scan the metadata folder, then you might get some of them back. The rest you will have to solve by refreshing the metadata on the movies or series. I understand your use case, that's just an open issue with it right now. Thanks. @Luke, I came up with a bit of a roundabout solution that will allow me to download actor metadata without losing any of my custom sort fields, titles, etc. I (1) opened the library.db in a DB editor, (2) ran an SQL query to set the 'LockedFields' to 'Name|OriginalTitle|SortName', (3) set the 'IsLocked' field to 0 for all movies, (4) delete the library.db-shm and library.db-wal, (5) restarted Emby and started a metadata refresh. This should protect the fields that I'm most concerned with during the metadata refresh while the metadata and artwork for actors downloads. My refresh is running right now. I'm hoping things go to plan. Worst case scenario, something goes haywire and I restore the DB backup that I made prior to fiddling with it.
Luke 42085 Posted December 4, 2022 Posted December 4, 2022 Sounds great. Let us know how you get on. Thanks !
Solution jmos1277 9 Posted December 4, 2022 Author Solution Posted December 4, 2022 (edited) My plans worked out great, but my first run didn't work as expected ... explanation follows. After manually updating my database to protect the Name, Original Title, and Sort Name fields, I ran a 'Refresh Metadata -> Search for missing metadata' operation . However, it didn't update people images as I had hoped. My problem was that I backup and metadata into NFO files using the NFO saver feature. Since I just rebuilt my database from those NFO files, I still had the 'NFO Reader' setting enabled for metadata. All of my NFO files had the 'lockeddata' field set to true and the NFO Loader / NFO file setting seem to take precedence over other settings. Furthermore, I didn't even know that there was a 'lockedfields' tag in the NFO file ... so my NFO files were inconsistent with my database. Anyway, after running my first attempt, all MediaItem locks were BACK to where they were when I started. The entire MediaItem was locked and the Name, Original Title, and Sort Name were back to being unlocked. This pass didn't work but at least it didn't destroy my metadata. TAKE 2 After a few minutes, I quickly realized what had happened and developed a new plan: shut down Emby backup my database (library.db file) open the library.db in a DB editor run an SQL query to set the 'LockedFields' to 'Name|OriginalTitle|SortName' For anyone looking to run a query, all MediaItems that are in Libraries with a 'Content Type' of 'Movies' are of 'type' '5' in the DB. UPDATE MediaItems SET IsLocked=0, LockedFields='Name|OriginalTitle|SortName' WHERE type=5; run an SQL query to set the 'IsLocked' field to 0 for all movies (included in above) delete the library.db-shm and library.db-wal restart Emby in my Library settings, DISABLE the NFO 'Metadata Readers' setting run 'Refresh Metadata -> Search for missing metadata' for the entire library This refresh took about 12 hours to complete but WORKED GREAT. All people images and metadata were downloaded as desired. My existing metadata hasn't changed. Most importantly (for me) my 'Name', 'Original Title', and 'Sort Name' fields are still locked and unchanged. FINAL STEP I prefer to keep my metadata locked at all times, so I have one final step to complete -- re-lock ALL metadata. This process is a bit different since I don't want to run another refresh but I DO want my database and my NFO files to be consistent. Furthermore, Emby doesn't currently have any UI element that will let me set the "Lock this item to prevent future changes" for all items in a Library at once. I REALLY don't want to set them individually. Here's the plan: shut down Emby backup my database again (library.db file) open the library.db in a DB editor run an SQL query to set the 'IsLocked' field to 1 for all movies UPDATE MediaItems SET IsLocked=1 WHERE type=5; delete the library.db-shm and library.db-wal from within my 'Movies' directory, run the following terminal command to manually adjust my NFO files and make them consistent with my manually modified DB find . -type f -name '*.nfo' | while read n; do sed -e 's/<lockdata>\(F\|f\)alse/<lockdata>true/' -i "$n" ; done ; restart Emby celebrate and watch a movie Edited December 5, 2022 by jmos1277 Added my SQL queries for anyone unfamiliar with SQL. 1
jmos1277 9 Posted December 5, 2022 Author Posted December 5, 2022 To conclude this thread I wanted to note that you can do this for TV Show / Episodes as well. However, TV shows are stored with a different 'type' value in the Emby database. I've listed the different types related to TV shows below: TV Series name :: type=6 TV Season labels :: type=7 TV Series episode name :: type=8 If you wanted to unlock ALL items related to TV shows, you could execute the following SQL query: UPDATE MediaItems SET IsLocked=0 WHERE type=6 OR type=7 OR type=8; To relock, set IsLocked=1. 1
jmos1277 9 Posted December 5, 2022 Author Posted December 5, 2022 Lastly, Movie collections are 'type' 9. 1
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