henriquefer 3 Posted February 19, 2020 Posted February 19, 2020 (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>/EPISODEI would like to trigger a scan only for a specific <TV SHOW NAME> directory. Is it possible?Thank you in advance. Edited February 19, 2020 by henriquefer
Luke 40022 Posted February 19, 2020 Posted February 19, 2020 Yes you could use the same API that the 3-dot context menu uses when you select "scan library files".
henriquefer 3 Posted February 19, 2020 Author Posted February 19, 2020 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?
Luke 40022 Posted February 19, 2020 Posted February 19, 2020 There's another api you can use to notify of a file change based on a path.
henriquefer 3 Posted February 19, 2020 Author Posted February 19, 2020 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
Luke 40022 Posted February 19, 2020 Posted February 19, 2020 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 2066 Posted February 19, 2020 Posted February 19, 2020 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? 1
henriquefer 3 Posted February 20, 2020 Author Posted February 20, 2020 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
Luke 40022 Posted February 20, 2020 Posted February 20, 2020 Did you look in swagger for what I mentioned?
henriquefer 3 Posted February 20, 2020 Author Posted February 20, 2020 Did you look in swagger for what I mentioned? Yes. I search for "psthsupdated", "path", and "update". Only the "ItemUpdateService" shows up.
PenkethBoy 2066 Posted February 20, 2020 Posted February 20, 2020 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 3 Posted February 20, 2020 Author Posted February 20, 2020 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.
PenkethBoy 2066 Posted February 20, 2020 Posted February 20, 2020 Ok - Thanks What are the options for "UpdateType": "string" please? As nothing shown in log or on Swagger to guide us
Luke 40022 Posted February 20, 2020 Posted February 20, 2020 You can omit that for now as it's currently not used.
tattoomees 2 Posted March 17, 2020 Posted March 17, 2020 can something similar can set scheduled hourly cron job ?
Luke 40022 Posted March 17, 2020 Posted March 17, 2020 can something similar can set scheduled hourly cron job ? Hi, not built into the server but you could make api calls periodically.
symphonichorizon 4 Posted March 21, 2020 Posted March 21, 2020 for the path what are we putting in, library id or actual path ( /media/movie2 ) ? if possible can you post an example?
Luke 40022 Posted March 21, 2020 Posted March 21, 2020 It would be the path of the media that was updated that needs to be scanned again.
symphonichorizon 4 Posted March 22, 2020 Posted March 22, 2020 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?
symphonichorizon 4 Posted April 27, 2020 Posted April 27, 2020 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?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now