Jump to content

Search item by file path


Recommended Posts

Hi, no, but it's a good idea to add this. We can add Path for the next release, since that's something we currently keep in the database. Thanks.

  • Like 1
Link to post
Share on other sites
  • 11 months later...
henriquefer

Hi, no, but it's a good idea to add this. We can add Path for the next release, since that's something we currently keep in the database. Thanks.

 

 

Any developments regarding this?

Link to post
Share on other sites

Hi, looks like a Path param is already present. Granted I think this might difficult on the query string, but give it a shot. Thanks.

Link to post
Share on other sites
  • 1 month later...
TheShanMan

I've been trying to get this Path parameter to work either with a partial path or a full path including the filename but can't get it to work (returns 0 items). Here's a sample of what I'm trying:

 

http://myserver:8096/Items?Recursive=true&Fields=Path&Path=%5C%5Cmyserver%5Cmyshare%5CVideo%5Cmyshow.avi

 

Is this parameter functional? Do I need to specify another parameter to get it to work? Ultimately I'd like to specify a partial path in order to get all items inside a directory (recursively).

Link to post
Share on other sites

It needs to be the full path and it needs to match the path that emby server has for it, so partials will not work.

Link to post
Share on other sites
PenkethBoy

You can do this as a two stage process

 

add your path to the path search

 

i used "e:\serverfolders\multimedia\movies"  dont add a trailing slash as it will then fail or something longer like "e:\serverfolders\multimedia\movies\Alien"

 

 

the above path is the root of my movies library - just an example

 

the returned json has the ID of my Movies directory

 

take this ID and clear out the path you put in earlier

 

then put the id number in parentID , make recursive to true, put includeitemtype to movie(or whatever you need) and add "path" to the fields box

 

you will get a list of all movies with the parent ID and the full path to each file etc

 

not elegant - but works 

 

from swagger

"http://192.168.1.80:8096/emby/Items?Recursive=true&ParentId=6&IncludeItemTypes=movie&api_key=0c66fd28d42d4e6a82aa885500e29348"

Edited by PenkethBoy
Link to post
Share on other sites
TheShanMan

It needs to be the full path and it needs to match the path that emby server has for it, so partials will not work.

 

My example is a full path, which I tried both URI encoded and as plain text. Didn't work either way.

 

You can do this as a two stage process

 

add your path to the path search

 

i used "e:\serverfolders\multimedia\movies"  dont add a trailing slash as it will then fail or something longer like "e:\serverfolders\multimedia\movies\Alien"

 

What is the "path search"?

 

take this ID and clear out the path you put in earlier

 

then put the id number in parentID , make recursive to true, put includeitemtype to movie(or whatever you need) and add "path" to the fields box

 

Yeah, if I grab an ID from a folder URL when I browse to it in my browser, I can use it as you suggest. Thanks for that tip.

Link to post
Share on other sites
PenkethBoy

path search is the option to search by "path" in swagger

 

if used alone it returns very basic info on the last folder in the path provided - which includes the ID

Link to post
Share on other sites
TheShanMan

I have been looking at swagger but you and I must be doing it differently, which is why I asked. I'm doing "/Items?Path=" and it doesn't matter whether I use the local path, UNC path, or either of those paths URI encoded. No matter what I try I get "Unable to find the specified file."

Link to post
Share on other sites
PenkethBoy

yes same endpoint and it does work

 

5e8a19c092af2_Annotation20200405184600.j

 

gives

 

5e8a19d15892f_Annotation20200405184555.j

 

Dont understand why you are going via a path

 

get the library id, then get the media , compare path you are looking for with individual item path or part of it

Link to post
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...