Jump to content

Metadata Clean-up: How to properly identify the currently used elements


Recommended Posts

Posted

Hi,

My present setup of Emby is based on writing .nfo files into the media folders while related images and subtitles are stored in a centralized metadata directory.  After a long time of experimenting with different ways of managing the content, I am quite sure that there are tons of unnecessary files in my metadata directory, i.e. orphan files that are never referenced because of multiple library scans with different settings. I got this impression as I am managing about 1,000 media files and ended up with 10 GB of metadata which appears to be quite much. Clearly, the bif files with preview images each 10 seconds make quite an amount, but I would rather prefer to check whether everything is clean due to the high amount of space occupied.

Is there a recommended way of keeping the metadata directory clean?

If there are no other suggestions, I will write a small script that makes sure that only referenced metadata is maintained in the metadata directory. My idea is to collect all metadata elements that are referenced in the Emby database and to copy these metadata from their original location to a temporary metadata directory. When having copied all referenced metadata elements to the temporary metadata directory, I willcontinue with stopping the Emby Server, deleting the original metadata directory, renaming the temporary metadata directory back to the original name, and starting the Emby server again.

As I am not experienced enough with the Emby system, I would like to ask the experienced guys here as how to fully identify the metadata elements referenced by Emby. At present, I have identified those elements in the Emby library:

sqlite3 /var/lib/emby/data/library.db "SELECT Images FROM MediaItems WHERE Images LIKE '%MetadataPath%';"
sqlite3 /var/lib/emby/data/library.db "SELECT ImagePath FROM Chapters3 WHERE ImagePath LIKE '%MetadataPath%';"

However, I do not know where are subtitles referenced and whether there are further metadata elements referenced somewhere else.

Looking forward to receiving your comments!

Thanks
Peter

Posted

Hi, when library items are deleted from the database, the server will delete the corresponding metadata folder, so there's nothing you need to do.

On the other hand if you've manually copied in old folders from backups, and if nothing was ever using them, then those will not get cleaned up.

Carlo
Posted

BIF files can get quite large compared to other graphics.  They are only needed when viewing the videos so is there any reason not to store them with the media on your system?

Of course Emby is flexible in this regard so you have a choice.  Just wondering why you may want them in a central location vs with the media?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...