Unmanic / unmanic

Unmanic - Library Optimiser
GNU General Public License v3.0
1.66k stars 82 forks source link

[Feature Request] Library Scanning at a schedule time #416

Closed Minxster closed 1 year ago

Minxster commented 1 year ago

Would it be possible to have a library scan triggered at a set time? I'm currently monitoring my DVR folder, and ideally I only want it to start transcoding on a night time, so there's no need to scan every X hours.

Josh5 commented 1 year ago

Could I suggest setting a cron job to trigger the library scan?

Minxster commented 1 year ago

@Josh5 I'm happy to use that, do you have an example of how to achieve this? Ideally something that can be easily repeated, especially when a container image upgrade/update happens?

Minxster commented 1 year ago

@Josh5 I finally figured it out. It took me some time, but did track down info about the API info/doc actually being available inside UnManic itself. So I'm just posting this back, in case others come along and want a working example of how to use the API 😉

curl -X 'POST' \
  'http://unmanic/unmanic/api/v2/pending/rescan' \
  -H 'accept: application/json' \
  -d ''
wget --header="accept: application/json" \
  --header="content-type: application/x-www-form-urlencoded" \
  --post-data= \
  --output-document - \
  http://unmanic/unmanic/api/v2/pending/rescan