# Sharing info

**URL:** <https://forums.plex.tv/t/sharing-info/47258>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [November 18, 2013, 9:13pm UTC](https://forums.plex.tv/t/sharing-info/47258 "2013-11-18T21:13:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [November 18, 2013, 9:13pm UTC](https://forums.plex.tv/t/sharing-info/47258/1 "2013-11-18T21:13:57Z")

</div>

Hi guys and girls.

&nbsp;

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

&nbsp;

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

&nbsp;

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

&nbsp;

It's like this:

&nbsp;

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

&nbsp;

&nbsp;

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

&nbsp;

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

&nbsp;

&nbsp;

&nbsp;

Best regards

&nbsp;

Tommy

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [November 22, 2013, 7:11am UTC](https://forums.plex.tv/t/sharing-info/47258/2 "2013-11-22T07:11:59Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![sa2000](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/sa2000/32/6922_2.png) [@sa2000](https://forums.plex.tv/u/sa2000)\
**Post date:** [February 10, 2014, 6:08pm UTC](https://forums.plex.tv/t/sharing-info/47258/3 "2014-02-10T18:08:23Z")

</div>

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

&nbsp;

So this is for media\_parts ID = 105232

The hash i have as 76f2d227168c81291c7a1bc7a21af5b5cef654fe which takes me to&nbsp;

**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&nbsp;683 x 512

The request is for 1151 x 620

The database entry for 105232 takes me to

media\_item\_id = 105730

&nbsp;

which takes me to metadata\_item\_id = 114503

This then gives me :

&nbsp;

GUID &nbsp; com.plexapp.agents.none://36370?lang=xn

&nbsp;

The thumbnail file which i found from the earlier hash

user\_thumb\_url =&nbsp;media://c/3479f499ed2e27069e7ae0aff8623b5c16b41a5.bundle/Contents/Thumbnails/thumb1.jpg

and another hash of 0d4f81b4ccef1dee7df30b82112425f0225dfb8a

&nbsp;

What I cannot find is how PMS gets to the Cache\PhotoTranscoder files for this media object

&nbsp;

So I experimented and used Process Monitor and log file and I have found

&nbsp;

So a new transcoded cache file was created&nbsp;

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

&nbsp;

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

&nbsp;

Then I changed the requested dimensions and asked for 500 x 620

&nbsp;

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

&nbsp;

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

&nbsp;

I can see PMS creating this new cache as&nbsp;

C:\Users\plex\AppData\Local\Temp\Plx-003362d8-c1df-4ca3-823c-13927011d395

&nbsp;

and at the end renamed to

C:\Users\plex\AppData\Local\Plex Media Server\Cache\PhotoTranscoder\45\45baa63ed8371ca3988bb9a68d52a1955de14889.jpg

&nbsp;

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)

&nbsp;

What have I missed from the database tables?

&nbsp;

Thanks

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

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [February 10, 2014, 7:14pm UTC](https://forums.plex.tv/t/sharing-info/47258/4 "2014-02-10T19:14:53Z")

</div>

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.....

---

<div class="post-metadata">

**Author:** ![sa2000](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/sa2000/32/6922_2.png) [@sa2000](https://forums.plex.tv/u/sa2000)\
**Post date:** [February 10, 2014, 8:21pm UTC](https://forums.plex.tv/t/sharing-info/47258/5 "2014-02-10T20:21:04Z")

</div>

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.&nbsp;

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

---

<div class="post-metadata">

**Author:** ![sa2000](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/sa2000/32/6922_2.png) [@sa2000](https://forums.plex.tv/u/sa2000)\
**Post date:** [August 22, 2014, 7:51am UTC](https://forums.plex.tv/t/sharing-info/47258/6 "2014-08-22T07:51:41Z")

</div>

> 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
> 
> &nbsp;
> 
> So this is for media\_parts ID = 105232
> 
> The hash i have as 76f2d227168c81291c7a1bc7a21af5b5cef654fe which takes me to&nbsp;
> 
> **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&nbsp;683 x 512
> 
> The request is for 1151 x 620
> 
> The database entry for 105232 takes me to
> 
> media\_item\_id = 105730
> 
> &nbsp;
> 
> which takes me to metadata\_item\_id = 114503
> 
> This then gives me :
> 
> &nbsp;
> 
> GUID &nbsp; com.plexapp.agents.none://36370?lang=xn
> 
> &nbsp;
> 
> The thumbnail file which i found from the earlier hash
> 
> user\_thumb\_url =&nbsp;media://c/3479f499ed2e27069e7ae0aff8623b5c16b41a5.bundle/Contents/Thumbnails/thumb1.jpg
> 
> and another hash of 0d4f81b4ccef1dee7df30b82112425f0225dfb8a
> 
> &nbsp;
> 
> What I cannot find is how PMS gets to the Cache\PhotoTranscoder files for this media object
> 
> &nbsp;
> 
> So I experimented and used Process Monitor and log file and I have found
> 
> &nbsp;
> 
> So a new transcoded cache file was created&nbsp;
> 
> 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
> 
> &nbsp;
> 
> 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
> 
> &nbsp;
> 
> Then I changed the requested dimensions and asked for 500 x 620
> 
> &nbsp;
> 
> 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
> 
> &nbsp;
> 
> 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
> 
> &nbsp;
> 
> I can see PMS creating this new cache as&nbsp;
> 
> C:\Users\plex\AppData\Local\Temp\Plx-003362d8-c1df-4ca3-823c-13927011d395
> 
> &nbsp;
> 
> and at the end renamed to
> 
> C:\Users\plex\AppData\Local\Plex Media Server\Cache\PhotoTranscoder\45\45baa63ed8371ca3988bb9a68d52a1955de14889.jpg
> 
> &nbsp;
> 
> 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)
> 
> &nbsp;
> 
> What have I missed from the database tables?
> 
> &nbsp;
> 
> 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.&nbsp;
> 
> I am investigating some errors I had and want to find out if a pointer was corrupted

My requirement is now solved - here:&nbsp;https://forums.plex.tv/topic/117842-how-does-plex-hash-urls-when-caching-images/#Comment\_705834

Many Thanks to&nbsp;[marlemion](https://forums.plex.tv/profile/marlemion)&nbsp;for cracking it

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 21, 2019, 12:29am UTC](https://forums.plex.tv/t/sharing-info/47258/7 "2019-12-21T00:29:07Z")

</div>

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