Marc0 29 Posted December 29, 2022 Posted December 29, 2022 Hi There. I have a issue/question on scanning the library. When a piece of content is imported by Radarr/Sonarr, you can set up a "notification" so Emby will update its library. This is standard option in Radarr/Sonarr. You can choose "EMBY" in notifications, set it up and it's suppose to trigger a Library update. However this never happens for me, for what I can tell from the logging, the trigger happens but the library does not update. What I did was write the script below. Now I also set a "Notification" in Raddar(or Sonarr), choose for a custom script. And choose the run the script when a movie is import. Now the library is updated Key here is that I call "curl --data '' http://$EMBY_HOST:$EMBY_PORT/Emby/Library/Refresh?api_key=$EMBY_RADARR_APIKEY", this will trigger a library scan. Question: 1. Is the default trigger from Radarr/Sonarr broken? 2. Is some wrong of the Emby site? 3. Why will "curl --data '' http://$EMBY_HOST:$EMBY_PORT/Emby/Library/Refresh?api_key=$EMBY_RADARR_APIKEY" given the desired result, and the default trigger doesn't? If you need more info, let me know. #!/bin/bash NOW=$(date +"%d-%m-%Y %H:%M") LOG_FILE="/logging/radarr/emby_scan.txt" TMP_FILE="/tmp/tmp_emby_radarr.txt" DL_FILE="/scripts/dl_radarr.txt" DEL_FILE="/scripts/del_radarr.txt" EMBY_HOST="192.168.xxx.xxx" EMBY_PORT="8097" EMBY_RADARR_APIKEY="xxyyzz" if [ "${radarr_eventtype}" != "" ]; then if [ "${radarr_eventtype}" == "ApplicationUpdate" ] || [ "${radarr_eventtype}" == "MovieAdded" ] || [ "${radarr_eventtype}" == "Grab" ] || [ "${radarr_eventtype}" == "HealthIssue" ] || [ "${radarr_eventtype}" == "Test" ]; then (echo "$NOW - [Emby Library Scan] Radarr Event Type is ${radarr_eventtype}, exiting."; cat $LOG_FILE) > $TMP_FILE; mv $TMP_FILE $LOG_FILE exit fi (echo "$NOW - [Emby Library Scan] Radarr Event Type is ${radarr_eventtype}, updating Emby Library for ${radarr_movie_title}."; cat $LOG_FILE) > $TMP_FILE; mv $TMP_FILE $LOG_FILE if [ "${radarr_eventtype}" == "Download" ]; then echo "${radarr_movie_title} (${radarr_movie_year})" >> $DL_FILE elif [ "${radarr_eventtype}" == "MovieDelete" ]; then echo "${radarr_movie_title} (${radarr_movie_year})" >> $DEL_FILE fi curl --data '' http://$EMBY_HOST:$EMBY_PORT/Emby/Library/Refresh?api_key=$EMBY_RADARR_APIKEY else (echo "$NOW - [Emby Library Scan] Radarr Event Type is empty for ${radarr_movie_title}."; cat $LOG_FILE) > $TMP_FILE; mv $TMP_FILE $LOG_FILE fi # write a status file with date of last run. Helps troubleshoot that cron task is running. echo "$(basename $0) last run was at $(date)" > /logging/radarr/_$(basename $0)_lastrun.txt
Eigeplackter 90 Posted December 29, 2022 Posted December 29, 2022 Why don‘t you use the „Watch library“ Real-Time-Surveillance option in Emby ? Option is in libraries- edit 3rd from top I think. 1
Marc0 29 Posted December 29, 2022 Author Posted December 29, 2022 1 hour ago, Eigeplackter said: Why don‘t you use the „Watch library“ Real-Time-Surveillance option in Emby ? Option is in libraries- edit 3rd from top I think.
Eigeplackter 90 Posted December 29, 2022 Posted December 29, 2022 Are you sure ? Maybe it‘s working for me as it‘s actually a path on my Synology where Emby is running top. But it is a shared folder.
Marc0 29 Posted December 29, 2022 Author Posted December 29, 2022 Just now, Eigeplackter said: Are you sure ? Maybe it‘s working for me as it‘s actually a path on my Synology where Emby is running top. But it is a shared folder. Yes! That is way it is working for you. From the perspective of Emby , The Synology is not a share but a "local" drive. I have an Intel NUC running with EMBY, which is connect through shares to a Synology. That's a different set up. But thanks anyway... you help is appreciated !
Luke 42077 Posted December 29, 2022 Posted December 29, 2022 6 hours ago, Marc0 said: It's not supported on all file systems. It will be more likely to work if you mount the network share to a local folder on the Synology and then import that path into emby server.
Marc0 29 Posted January 12, 2023 Author Posted January 12, 2023 On 12/29/2022 at 5:43 PM, Luke said: It's not supported on all file systems. It will be more likely to work if you mount the network share to a local folder on the Synology and then import that path into emby server. Luke can you explain this is bit more?
Luke 42077 Posted January 12, 2023 Posted January 12, 2023 It's limited to file systems supported by both INotify and the .Net runtime, which SMB on linux is not. That's why you need to mount it to a local share to give the realtime monitor a better chance of working.
Marc0 29 Posted January 12, 2023 Author Posted January 12, 2023 41 minutes ago, Luke said: It's limited to file systems supported by both INotify and the .Net runtime, which SMB on linux is not. That's why you need to mount it to a local share to give the realtime monitor a better chance of working. But what do you exactly mean "mount to a local share"? I mount the the remote CIFS path at a mount point on the node that runs Emby... Is there another way?
Luke 42077 Posted January 19, 2023 Posted January 19, 2023 On 1/12/2023 at 2:13 PM, Marc0 said: But what do you exactly mean "mount to a local share"? I mount the the remote CIFS path at a mount point on the node that runs Emby... Is there another way? And then it gets a local path, right? What path did you import into Emby library setup?
Marc0 29 Posted January 20, 2023 Author Posted January 20, 2023 6 hours ago, Luke said: And then it gets a local path, right? What path did you import into Emby library setup? I browsed in Emby to that path in library settings.
Luke 42077 Posted January 20, 2023 Posted January 20, 2023 19 minutes ago, Marc0 said: I browsed in Emby to that path in library settings. What path?
Marc0 29 Posted January 20, 2023 Author Posted January 20, 2023 (edited) In the fstab file: //192.168.xxx.xxx/video /mnt/video Then in docker-compose /mnt/video to /video The /video is picked up by Emby Does this help? Edited January 20, 2023 by Marc0
Q-Droid 989 Posted January 20, 2023 Posted January 20, 2023 It doesn't work with network file systems (remote storage) regardless of how they're mounted or accessed. 1
Q-Droid 989 Posted January 20, 2023 Posted January 20, 2023 I need to add that this isn't a problem with Emby but a limitation of the inotify API which is kernel based and does not detect changes made on network shares. In those cases it's the host exporting those shares that detects the change on storage local to itself. It's a limitation of the kernel/OS. 1
Marc0 29 Posted January 20, 2023 Author Posted January 20, 2023 1 minute ago, Q-Droid said: I need to add that this isn't a problem with Emby but a limitation of the inotify API which is kernel based and does not detect changes made on network shares. In those cases it's the host exporting those shares that detects the change on storage local to itself. It's a limitation of the kernel/OS. Agreed Q-Droid, I do understand all of this, and knew this. Going back to the original question of this thread: - Why is the built-in radarr/sonarr trigger for Emby not working? But When I trigger my own script (see above), the library is scanned. To me it seems a sonarr/radarr problem with the built in trigger. But I was verifying here if it's just me.
Luke 42077 Posted January 20, 2023 Posted January 20, 2023 4 hours ago, Marc0 said: Agreed Q-Droid, I do understand all of this, and knew this. Going back to the original question of this thread: - Why is the built-in radarr/sonarr trigger for Emby not working? But When I trigger my own script (see above), the library is scanned. To me it seems a sonarr/radarr problem with the built in trigger. But I was verifying here if it's just me. Don't know. We'd have to look at an example. How to Report a Problem Thanks.
Q-Droid 989 Posted January 20, 2023 Posted January 20, 2023 10 hours ago, Marc0 said: Agreed Q-Droid, I do understand all of this, and knew this. Going back to the original question of this thread: - Why is the built-in radarr/sonarr trigger for Emby not working? But When I trigger my own script (see above), the library is scanned. To me it seems a sonarr/radarr problem with the built in trigger. But I was verifying here if it's just me. Have you been able to check what the *arrs are using for the trigger? Perhaps they haven't kept up with changes in the Emby API, that is if it has changed over time.
Happy2Play 9780 Posted January 20, 2023 Posted January 20, 2023 Do not know code but isn't the curl above missing POST? curl -X POST "http://$EMBY_HOST:$EMBY_PORT/emby/Library/Refresh?api_key=$EMBY_RADARR_APIKEY"
Q-Droid 989 Posted January 20, 2023 Posted January 20, 2023 With curl it is a POST. -d, --data <data> HTTP POST data (H) 1
Q-Droid 989 Posted January 21, 2023 Posted January 21, 2023 I see this API which appears to be more granular but no documentation on the expected input values. My guess is this would be preferable to a full library scan/refresh. /Library/Media/Updated { "Updates": [ { "Path": "string", "UpdateType": "string" } ] }
Marc0 29 Posted January 21, 2023 Author Posted January 21, 2023 Hmmmm seems so. But we need so docs to make it work properly.
adminExitium 355 Posted February 1, 2023 Posted February 1, 2023 Both Sonarr & Radarr are already using that API: https://github.com/Sonarr/Sonarr/blob/ad42d4a14c814d5911dafb5e78e97ec09b4b13a5/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserProxy.cs#L34 https://github.com/Radarr/Radarr/blob/daf81c5b26bde93b06121c09d7e87e19fcda0a88/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserProxy.cs#L34
Marc0 29 Posted February 1, 2023 Author Posted February 1, 2023 On 1/21/2023 at 2:25 PM, Q-Droid said: I see this API which appears to be more granular but no documentation on the expected input values. My guess is this would be preferable to a full library scan/refresh. /Library/Media/Updated { "Updates": [ { "Path": "string", "UpdateType": "string" } ] } Complete not clear what "UpdateType" is...
Marc0 29 Posted February 1, 2023 Author Posted February 1, 2023 1 hour ago, adminExitium said: Both Sonarr & Radarr are already using that API: https://github.com/Sonarr/Sonarr/blob/ad42d4a14c814d5911dafb5e78e97ec09b4b13a5/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserProxy.cs#L34 https://github.com/Radarr/Radarr/blob/daf81c5b26bde93b06121c09d7e87e19fcda0a88/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserProxy.cs#L34 Doesn't seem the work for me.... I run the latest develop version
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