Jump to content


Photo

Scan only a specific subdirectory

scan library subdirectory

  • Please log in to reply
26 replies to this topic

#1 henriquefer OFFLINE  

henriquefer

    Advanced Member

  • Members
  • 51 posts
  • Local time: 05:50 AM

Posted 19 February 2020 - 10:32 AM

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, 19 February 2020 - 10:33 AM.


#2 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 156602 posts
  • Local time: 12:50 AM

Posted 19 February 2020 - 01:33 PM

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



#3 henriquefer OFFLINE  

henriquefer

    Advanced Member

  • Members
  • 51 posts
  • Local time: 05:50 AM

Posted 19 February 2020 - 01:57 PM

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?



#4 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 156602 posts
  • Local time: 12:50 AM

Posted 19 February 2020 - 02:33 PM

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

#5 henriquefer OFFLINE  

henriquefer

    Advanced Member

  • Members
  • 51 posts
  • Local time: 05:50 AM

Posted 19 February 2020 - 03:50 PM

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



#6 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 156602 posts
  • Local time: 12:50 AM

Posted 19 February 2020 - 03:58 PM

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.

#7 PenkethBoy OFFLINE  

PenkethBoy

    Advanced Member

  • Members
  • 4287 posts
  • Local time: 05:50 AM
  • LocationWarrington,UK

Posted 19 February 2020 - 06:41 PM

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?


  • chef likes this

#8 henriquefer OFFLINE  

henriquefer

    Advanced Member

  • Members
  • 51 posts
  • Local time: 05:50 AM

Posted 20 February 2020 - 04:55 AM

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



#9 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 156602 posts
  • Local time: 12:50 AM

Posted 20 February 2020 - 05:08 AM

Did you look in swagger for what I mentioned?

#10 henriquefer OFFLINE  

henriquefer

    Advanced Member

  • Members
  • 51 posts
  • Local time: 05:50 AM

Posted 20 February 2020 - 05:46 AM

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



#11 PenkethBoy OFFLINE  

PenkethBoy

    Advanced Member

  • Members
  • 4287 posts
  • Local time: 05:50 AM
  • LocationWarrington,UK

Posted 20 February 2020 - 08:02 AM

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



#12 henriquefer OFFLINE  

henriquefer

    Advanced Member

  • Members
  • 51 posts
  • Local time: 05:50 AM

Posted 20 February 2020 - 09:08 AM

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.



#13 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 156602 posts
  • Local time: 12:50 AM

Posted 20 February 2020 - 03:10 PM

It's /Library/Media/Updated



#14 PenkethBoy OFFLINE  

PenkethBoy

    Advanced Member

  • Members
  • 4287 posts
  • Local time: 05:50 AM
  • LocationWarrington,UK

Posted 20 February 2020 - 07:03 PM

Ok - Thanks

 

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

 

As nothing shown in log or on Swagger to guide us



#15 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 156602 posts
  • Local time: 12:50 AM

Posted 20 February 2020 - 07:16 PM

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

#16 PenkethBoy OFFLINE  

PenkethBoy

    Advanced Member

  • Members
  • 4287 posts
  • Local time: 05:50 AM
  • LocationWarrington,UK

Posted 20 February 2020 - 08:01 PM

Ok thanks



#17 tattoomees OFFLINE  

tattoomees

    Advanced Member

  • Members
  • 47 posts
  • Local time: 05:50 AM

Posted 17 March 2020 - 06:58 PM

can something similar can set scheduled hourly cron job ?



#18 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 156602 posts
  • Local time: 12:50 AM

Posted 17 March 2020 - 07:48 PM

can something similar can set scheduled hourly cron job ?

 

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



#19 symphonichorizon OFFLINE  

symphonichorizon

    Advanced Member

  • Members
  • 30 posts
  • Local time: 12:50 AM

Posted 20 March 2020 - 11:33 PM

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

if possible can you post an example?



#20 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 156602 posts
  • Local time: 12:50 AM

Posted 20 March 2020 - 11:35 PM

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







Also tagged with one or more of these keywords: scan, library, subdirectory

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users