Jump to content

Recommended Posts

henriquefer
Posted (edited)

Hi,

 

I have a bash script that can trigger a library scan for a specific library (Movies or TVShows). However, I would like to know if it is possible to trigger a scan for a specific subdirectory.

 

For example, I have this structure for TV Shows:

 

TVShows/<TV SHOW NAME>/<SEASON>/EPISODE

I would like to trigger a scan only for a specific <TV SHOW NAME> directory. Is it possible?

Thank you in advance. 
 

Edited by henriquefer
Posted

Yes you could use the same API that the 3-dot context menu uses when you select "scan library files".

henriquefer
Posted

Yes you could use the same API that the 3-dot context menu uses when you select "scan library files".

 

 

But that API does not accept a path as parameter. I have to know the ID to run it. Moreover, I cannot use that approach for new TV Shows that are not on Emby library yet.

 

Is that right?

Posted

There's another api you can use to notify of a file change based on a path.

henriquefer
Posted

There's another api you can use to notify of a file change based on a path.

 

 

Can you tell me how or where I can found that information? I have checked your API documentation, but I could not find anything regarding this thing.

 

Currently I have this:

curl --data '' "http://192.168.1.99:8096/emby/Items/f137a2dd21bbc1b99aa5c0f6bf02a805/Refresh?Recursive=true&api_key=APIKEY"

Can you give me an example of how to trigger library scan for a specific path?

 

Thank you very much

Posted

I'm not in front of a computer right now but you should be able to find it in swagger. It's like psthsupdated or something like that.

PenkethBoy
Posted

simpler way to see an example is do the action you want to replicate in the web app

 

then immediately go to the end of the log file (debug mode) and you should be able to see the api command you need to replicate - then you can test in swagger/or you app

 

as i did here for a series folder

http://192.168.1.80:8096/emby/Items/203336/Refresh?Recursive=true&ImageRefreshMode=Default&MetadataRefreshMode=Default&ReplaceAllImages=false&ReplaceAllMetadata=false

if you dont know the item (series) id then you can use the api to find that easy enough

 

Not sure why you need to do this when the Real Time Monitor will do it anyway - if its turned on for your Tv Library?

  • Like 1
henriquefer
Posted

simpler way to see an example is do the action you want to replicate in the web app

 

then immediately go to the end of the log file (debug mode) and you should be able to see the api command you need to replicate - then you can test in swagger/or you app

 

as i did here for a series folder

http://192.168.1.80:8096/emby/Items/203336/Refresh?Recursive=true&ImageRefreshMode=Default&MetadataRefreshMode=Default&ReplaceAllImages=false&ReplaceAllMetadata=false

if you dont know the item (series) id then you can use the api to find that easy enough

 

Not sure why you need to do this when the Real Time Monitor will do it anyway - if its turned on for your Tv Library?

 

 

The Real Time Monitor does not work for my system. I have the Emby server on a Shield TV and the files are shared over samba. 

 

That why I am working on an alternative to specifically update only a certain path. 

For TV Shows that I have already added to my library, I can figure out how to do that. My question regards new TV Shows because in that case they do not have a ID yet.

 

Do you have any idea for that?

 

Thank you

Posted

Did you look in swagger for what I mentioned?

henriquefer
Posted

Did you look in swagger for what I mentioned?

 

 

Yes. I search for "psthsupdated", "path", and "update". Only the "ItemUpdateService" shows up.

 

5e4e557758ad7_Image6.jpg

PenkethBoy
Posted

if you have a newly added show directory - then run the scan on the parent folder - which i think is probably what you have already coded

 

If the show is new then as you say its not going to have an ID

 

I dont see what Luke is referring to either - will have to wait for him to respond again

henriquefer
Posted

if you have a newly added show directory - then run the scan on the parent folder - which i think is probably what you have already coded

 

If the show is new then as you say its not going to have an ID

 

I dont see what Luke is referring to either - will have to wait for him to respond again

 

 

Thank you for your help.

 

I am going to wait for Luke to clarify the "pathupdate" option.

Posted

It's /Library/Media/Updated

PenkethBoy
Posted

Ok - Thanks

 

What are the options for "UpdateType": "string" please?

 

As nothing shown in log or on Swagger to guide us

Posted

You can omit that for now as it's currently not used.

PenkethBoy
Posted

Ok thanks

  • 4 weeks later...
tattoomees
Posted

can something similar can set scheduled hourly cron job ?

Posted

can something similar can set scheduled hourly cron job ?

 

Hi, not built into the server but you could make api calls periodically.

symphonichorizon
Posted

for the path what are we putting in, library id or actual path ( /media/movie2 ) ?

if possible can you post an example?

Posted

It would be the path of the media that was updated that needs to be scanned again.

symphonichorizon
Posted

Just clarifying as the api only returns a 204 and emby doesn't give any feedback if something is happening.

 

if the folder i want scanned if named " Currently Airing Tv " and the path to that is /nfs/Tv5 I would put /nfs/Tv5 in the path?

  • 1 month later...
symphonichorizon
Posted

further small update on this, is there a limit to how many folders Emby can scan at once? ie if I were to use this to run a api call on /tv could I also overlap a call to scan /Movies and heck lets add a third one for /Music lets say?

Posted

There is no limit.

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