Sharing info

Hi guys and girls.

 

Asked a few times for the missing link between a media file (like an mkv-file) and the directory where the metadata is stored, but sadly no answers

 

This time however I'm not asking, but just saying :D

 

In the table named media_parts you'll find a field named "hash", that is the key to the files, like the index etc.

 

It's like this:

 

Library/Plex Media Server/media/localhost//<Remaining characters in hash field>.bundle

 

 

So if a movie has an entry in the hash filed named b73ba82ee7663f538164d9cafda0384db6b1c52c then the metadata will be here:

 

Library/Plex Media Server/media/localhost/b/73ba82ee7663f538164d9cafda0384db6b1c52c.bundle

 

 

 

Best regards

 

Tommy


Library/Plex Media Server/media/localhost/b/73ba82ee7663f538164d9cafda0384db6b1c52c.bundle

Above path is for QNAP, and might be different on other platforms, that has the "Application Support" directory stuffed into the path as well

/T

Hi Tommy - I am trying to understand how PMS gets to an item in the cache transcode folders from the media item number

I have worked out what you shared above

but i am stuck with the final linkage to the cached files and I cannot see how PMS gets to the cache\phototranscoder image files

So we start with a request like this

Feb 10, 2014 02:28:59:538 [8772] DEBUG - Request: GET /photo/:/transcode?url=http%3A%2F%2F127.0.0.1%3A32400%2Flibrary%2Fparts%2F105232%2Ffile.JPG&width=1151&height=620
 

So this is for media_parts ID = 105232

The hash i have as 76f2d227168c81291c7a1bc7a21af5b5cef654fe which takes me to 

C:\Users\plex\AppData\Local\Plex Media Server\Media\localhost\7\6f2d227168c81291c7a1bc7a21af5b5cef654fe.bundle

and the default thumb file

media://7/6f2d227168c81291c7a1bc7a21af5b5cef654fe.bundle/Contents/Thumbnails/thumb1.jpg

which is 683 x 512

The request is for 1151 x 620

The database entry for 105232 takes me to

media_item_id = 105730
 
which takes me to metadata_item_id = 114503
This then gives me :
 
GUID   com.plexapp.agents.none://36370?lang=xn
 
The thumbnail file which i found from the earlier hash
user_thumb_url media://c/3479f499ed2e27069e7ae0aff8623b5c16b41a5.bundle/Contents/Thumbnails/thumb1.jpg
and another hash of 0d4f81b4ccef1dee7df30b82112425f0225dfb8a
 
What I cannot find is how PMS gets to the Cache\PhotoTranscoder files for this media object
 
So I experimented and used Process Monitor and log file and I have found
 
So a new transcoded cache file was created 
Feb 10, 2014 02:19:57:474 [10440] DEBUG - Created thumbnail of size 827x620, has pixels: 1
Which is here
C:\Users\plex\AppData\Local\Plex Media Server\Cache\PhotoTranscoder\af\af71d5a5615339508472e8061e8093550464e8aa.jpg
 
When I repeated the request - it used the earlier cache file above. So it had a link to it
It opened first the folder
C:\Users\plex\AppData\Local\Plex Media Server\Cache\PhotoTranscoder\af\
and then the file - but i cannot see what pointed to the file from the database or the media and metadata file structure in the app local data
 
Then I changed the requested dimensions and asked for 500 x 620
 
Feb 10, 2014 02:29:13:482 [0924] DEBUG - Request: GET /photo/:/transcode?url=http%3A%2F%2F127.0.0.1%3A32400%2Flibrary%2Fparts%2F105232%2Ffile.JPG&width=500&height=620
 
And it created another file - obviously it knew the files it had were wrong (but how did it know ?)
Feb 10, 2014 02:29:15:724 [0924] DEBUG - Created thumbnail of size 500x375, has pixels: 1
 
I can see PMS creating this new cache as 
C:\Users\plex\AppData\Local\Temp\Plx-003362d8-c1df-4ca3-823c-13927011d395
 
and at the end renamed to
C:\Users\plex\AppData\Local\Plex Media Server\Cache\PhotoTranscoder\45\45baa63ed8371ca3988bb9a68d52a1955de14889.jpg
 
And again i cannot find from the data I found in the database above what points to this item (500 x 375) and the other cache file (827 x 620)
 
What have I missed from the database tables?
 
Thanks

Would be nice to have a schema of all the data entities and how they link together ! Anyone done that?

Sadly no idea....And also still trying to grap the one in the first post directly from the http api, still without any luck....SNIFF

What I can tell though, is that to figure out the MetaData directory for an item, it's SHA1(guid)

But this is indeed up hill, and stopping great 3.Party tools and plug-ins.....SNIFF.....

Thanks Tommy

Anybody else know how to get to all the cached objects from the database media item?

In this example there are 2 different cached sizes of the image and i have not figured out how to get to these from the media item. 

I am investigating some errors I had and want to find out if a pointer was corrupted

Hi Tommy - I am trying to understand how PMS gets to an item in the cache transcode folders from the media item number

I have worked out what you shared above

but i am stuck with the final linkage to the cached files and I cannot see how PMS gets to the cache\phototranscoder image files

So we start with a request like this

Feb 10, 2014 02:28:59:538 [8772] DEBUG - Request: GET /photo/:/transcode?url=http%3A%2F%2F127.0.0.1%3A32400%2Flibrary%2Fparts%2F105232%2Ffile.JPG&width=1151&height=620
 

So this is for media_parts ID = 105232

The hash i have as 76f2d227168c81291c7a1bc7a21af5b5cef654fe which takes me to 

C:\Users\plex\AppData\Local\Plex Media Server\Media\localhost\7\6f2d227168c81291c7a1bc7a21af5b5cef654fe.bundle

and the default thumb file

media://7/6f2d227168c81291c7a1bc7a21af5b5cef654fe.bundle/Contents/Thumbnails/thumb1.jpg

which is 683 x 512

The request is for 1151 x 620

The database entry for 105232 takes me to

media_item_id = 105730
 
which takes me to metadata_item_id = 114503
This then gives me :
 
GUID   com.plexapp.agents.none://36370?lang=xn
 
The thumbnail file which i found from the earlier hash
user_thumb_url = media://c/3479f499ed2e27069e7ae0aff8623b5c16b41a5.bundle/Contents/Thumbnails/thumb1.jpg
and another hash of 0d4f81b4ccef1dee7df30b82112425f0225dfb8a
 
What I cannot find is how PMS gets to the Cache\PhotoTranscoder files for this media object
 
So I experimented and used Process Monitor and log file and I have found
 
So a new transcoded cache file was created 
Feb 10, 2014 02:19:57:474 [10440] DEBUG - Created thumbnail of size 827x620, has pixels: 1
Which is here
C:\Users\plex\AppData\Local\Plex Media Server\Cache\PhotoTranscoder\af\af71d5a5615339508472e8061e8093550464e8aa.jpg
 
When I repeated the request - it used the earlier cache file above. So it had a link to it
It opened first the folder
C:\Users\plex\AppData\Local\Plex Media Server\Cache\PhotoTranscoder\af\
and then the file - but i cannot see what pointed to the file from the database or the media and metadata file structure in the app local data
 
Then I changed the requested dimensions and asked for 500 x 620
 
Feb 10, 2014 02:29:13:482 [0924] DEBUG - Request: GET /photo/:/transcode?url=http%3A%2F%2F127.0.0.1%3A32400%2Flibrary%2Fparts%2F105232%2Ffile.JPG&width=500&height=620
 
And it created another file - obviously it knew the files it had were wrong (but how did it know ?)
Feb 10, 2014 02:29:15:724 [0924] DEBUG - Created thumbnail of size 500x375, has pixels: 1
 
I can see PMS creating this new cache as 
C:\Users\plex\AppData\Local\Temp\Plx-003362d8-c1df-4ca3-823c-13927011d395
 
and at the end renamed to
C:\Users\plex\AppData\Local\Plex Media Server\Cache\PhotoTranscoder\45\45baa63ed8371ca3988bb9a68d52a1955de14889.jpg
 
And again i cannot find from the data I found in the database above what points to this item (500 x 375) and the other cache file (827 x 620)
 
What have I missed from the database tables?
 
Thanks

Would be nice to have a schema of all the data entities and how they link together ! Anyone done that?

Thanks Tommy

Anybody else know how to get to all the cached objects from the database media item?

In this example there are 2 different cached sizes of the image and i have not figured out how to get to these from the media item. 

I am investigating some errors I had and want to find out if a pointer was corrupted

My requirement is now solved - here: https://forums.plex.tv/topic/117842-how-does-plex-hash-urls-when-caching-images/#Comment_705834

Many Thanks to marlemion for cracking it

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