Jump to content


Photo

Search item by file path


  • Please log in to reply
12 replies to this topic

#1 onny OFFLINE  

onny

    Newbie

  • Members
  • 1 posts
  • Local time: 03:03 AM

Posted 26 February 2019 - 10:36 AM

Hey,

is it possible to query an item by searching for the file path or file name?

 

Thank you and best regards,

Jonas



#2 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 157224 posts
  • Local time: 09:03 PM

Posted 26 February 2019 - 02:37 PM

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.


  • henriquefer likes this

#3 henriquefer OFFLINE  

henriquefer

    Advanced Member

  • Members
  • 51 posts
  • Local time: 02:03 AM

Posted 06 February 2020 - 05:51 AM

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?



#4 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 157224 posts
  • Local time: 09:03 PM

Posted 07 February 2020 - 02:45 PM

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.



#5 TheShanMan OFFLINE  

TheShanMan

    Advanced Member

  • Members
  • 465 posts
  • Local time: 06:03 PM

Posted 04 April 2020 - 06:12 PM

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...ideo\myshow.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).



#6 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 157224 posts
  • Local time: 09:03 PM

Posted 04 April 2020 - 06:32 PM

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.



#7 PenkethBoy OFFLINE  

PenkethBoy

    Advanced Member

  • Members
  • 4315 posts
  • Local time: 02:03 AM
  • LocationWarrington,UK

Posted 04 April 2020 - 06:42 PM

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:...aa885500e29348"


Edited by PenkethBoy, 04 April 2020 - 06:44 PM.


#8 TheShanMan OFFLINE  

TheShanMan

    Advanced Member

  • Members
  • 465 posts
  • Local time: 06:03 PM

Posted 04 April 2020 - 10:59 PM

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.



#9 PenkethBoy OFFLINE  

PenkethBoy

    Advanced Member

  • Members
  • 4315 posts
  • Local time: 02:03 AM
  • LocationWarrington,UK

Posted 05 April 2020 - 06:13 AM

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



#10 TheShanMan OFFLINE  

TheShanMan

    Advanced Member

  • Members
  • 465 posts
  • Local time: 06:03 PM

Posted 05 April 2020 - 01:15 PM

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



#11 PenkethBoy OFFLINE  

PenkethBoy

    Advanced Member

  • Members
  • 4315 posts
  • Local time: 02:03 AM
  • LocationWarrington,UK

Posted 05 April 2020 - 01:49 PM

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



#12 TheShanMan OFFLINE  

TheShanMan

    Advanced Member

  • Members
  • 465 posts
  • Local time: 06:03 PM

Posted 05 April 2020 - 03:35 PM

Hmm... looks the same to me. Wonder why it fails for me.  :huh:



#13 PenkethBoy OFFLINE  

PenkethBoy

    Advanced Member

  • Members
  • 4315 posts
  • Local time: 02:03 AM
  • LocationWarrington,UK

Posted 05 April 2020 - 05:50 PM

without any detail impossible to say






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users