Jump to content

How do I get the Metadata Physical Path in c#


mickle026

Recommended Posts

mickle026

I am trying to get the physical path of metadata images.  ie this part below and this part alone.

"C:\Users\User1\AppData\Roaming\Emby-Server\programdata\metadata"

This example has the images stored in the metadata path so this one is easy, but i just want to return the metadata configured path.

 

I have the Guid so I know part of the path, but I want to get the physical location incase the user is using their own.

8f53edfb-0634-11a5-c92d-5c099e7a2bfb
\library\8f\8f53edfb063411a5c92d5c099e7a2bfb\
2020-05-07 19:46:11.004 Info FetchImageInfoApi: Movie internal ID: 40
2020-05-07 19:46:11.004 Info FetchImageInfoApi: Movie name: Throw Momma from the Train
2020-05-07 19:46:11.004 Info FetchImageInfoApi: Original name: Throw Momma from the Train
2020-05-07 19:46:11.004 Info FetchImageInfoApi: Production Year: 1987
2020-05-07 19:46:11.004 Info FetchImageInfoApi: GUID: 8f53edfb-0634-11a5-c92d-5c099e7a2bfb
2020-05-07 19:46:11.004 Info FetchImageInfoApi: GUID Path: (8f53edfb-0634-11a5-c92d-5c099e7a2bfb, \\NAS2\Videos\MOVIES2\Throw Momma From The Train (1987)\Throw Momma From The Train (1987).mp4)
2020-05-07 19:46:11.004 Info FetchImageInfoApi: Image Info: C:\Users\User1\AppData\Roaming\Emby-Server\programdata\metadata\library\8f\8f53edfb063411a5c92d5c099e7a2bfb\poster.jpg
2020-05-07 19:46:11.004 Info FetchImageInfoApi: Image Info: C:\Users\User1\AppData\Roaming\Emby-Server\programdata\metadata\library\8f\8f53edfb063411a5c92d5c099e7a2bfb\landscape.jpg

 

I looked all over but cannot find this.  I can get all other drives, sizes etc, where the playlists and collections are - but where is this (metadata configured path)?
 

Link to comment
Share on other sites

rechigo

If you're trying to find the path to an image, I think you're overcomplicating things

 

You can do something like this and it'll return the path depending on the image type:

BaseItem.GetImagePath(ImageType.Primary)

 

Sent from my Galaxy S10

Link to comment
Share on other sites

mickle026

No, I can get the images assigned to an item as shown above, I want to get the metadata path thats configured on the server.

 

but thanks anyway.

Link to comment
Share on other sites

rechigo

Try IServerConfigurationManager.Configuration.MetadataPath, that should work...

Edited by rechigo
  • Like 1
Link to comment
Share on other sites

mickle026

private readonly IServerConfigurationManager configurationManager;
.
.
.

var metapath = configurationManager.Configuration.MetadataPath;

UNCONFIGURED

2020-05-07 21:22:16.327 Info FetchImageInfoApi: Metapath: 
2020-05-07 21:22:16.327 Info FetchImageInfoApi: Movie internal ID: 47
2020-05-07 21:22:16.327 Info FetchImageInfoApi: Movie name: The Dunwich Horror
2020-05-07 21:22:16.327 Info FetchImageInfoApi: Original name: The Dunwich Horror
2020-05-07 21:22:16.327 Info FetchImageInfoApi: Production Year: 1970
2020-05-07 21:22:16.327 Info FetchImageInfoApi: GUID: 913a00c9-9ef6-b970-a515-60c10d861d1b

CONFIGURED

2020-05-07 21:25:55.397 Info FetchImageInfoApi: Metapath: K:\New folder
2020-05-07 21:25:55.397 Info FetchImageInfoApi: Movie internal ID: 47
2020-05-07 21:25:55.397 Info FetchImageInfoApi: Movie name: The Dunwich Horror
2020-05-07 21:25:55.397 Info FetchImageInfoApi: Original name: The Dunwich Horror
2020-05-07 21:25:55.397 Info FetchImageInfoApi: Production Year: 1970
2020-05-07 21:25:55.397 Info FetchImageInfoApi: GUID: 913a00c9-9ef6-b970-a515-60c10d861d1b

Thank You Thank You :) :)

 

Woot Woot :)

 

Thank you.  It returns an empty path if its in its original location, ie "" otherwise it returns the user configured path. 

 

Trying to figure it out from swagger is a nightmare.  Its SystemInfo {"InternalMetadataPath"} in that. configurationManager.Configuration. also gives me the cache path which will be handy later :)

 

Thank you :)

Edited by mickle026
Link to comment
Share on other sites

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