I have connection set up to my Emby server, Radarr used to update emby when media was downloaded, but sometime in the last 6 months it stopped doing it, I just enabled more periodic library scadns in Emby, but I'd like to get this feature working again.
Radarr version 0.2.0.1358
Emby Server version 4.3.0.2
In the connection I have every option enabled, radarr is able to successfully perform a connection test with the Emby server.
Here's the snippets from both the radarr and emby logs when the update event is "performed".
Radarr
19-8-14 05:41:47.3|Debug|MediaBrowserProxy|Looking for error in response: Res: [POST] http://172.29.13.9:8096/mediabrowser/Library/Media/Updated: 204.NoContent
Emby
2019-08-14 05:41:47.357 Info HttpServer: HTTP POST http://172.29.13.9:8096/mediabrowser/Library/Media/Updated. UserAgent: Radarr/0.2.0.1358 (Linux 4.19)
2019-08-14 05:41:47.359 Info HttpServer: HTTP Response 204 to 172.17.0.10. Time: 2ms. http://172.29.13.9:8096/mediabrowser/Library/Media/Updated
Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.52. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
I am having the same issue using a fresh install of 0.2.0.1358 and a fresh copy of Emby 4.2.1.0. I can see that Radarr is trying to trigger Emby in the debug log - same as the line you listed above. It shows "204.NoContent". Emby does not update any of my media libraries.
I don't know if this is due to a malformed request from Radarr or if Emby is just not properly responding to a valid request for Radarr.
I'll see if I can get my configuration running on Windows later to debug. I don't know much about debugging this sort of code on Linux.
I did a bit of debugging and radarr is sending the path it has to the downloaded file, in my case this is wrong. The host and path based substitution for downloads should be available for connections, but they dont work, so radarr sends a path for emby to refresh which doesnt exist.
Unless you have the same mappjng both radarr side and emby side to your media then the conecct notification will not work.
That's definitely the case for me as well! I do not have the same directory mapping in both radarr and Emby. What you say makes sense, as unless it's making a request for Emby's folder paths, Radarr wouldn't know what path to specify. Even then, it would just need to refresh _all_ the potential paths because it couldn't know which one matches up with the appropriate Radarr path.
I may just switch to a cifs mount instead of smb:// path for Emby, and make sure the path is the same on both servers.
I鈥檓 going to write a script which does the path substution and then posts to the emby endpoint to do the update, luckily Radarr has a connect option for a custom script so this should be fairly trivial.
Turns out that when I checked I already had a script for updating emby (seems to have originated from the emby forum a while back, I don't know who the original author is), so I just added some modifications to it to do what I want.
Obviously set the apiKey and url variables to correct values from emby.
local_movie_path and local_tv_path are the paths that Radarr and Sonarr use respectively for their downloads, the movie (or show) is downloaded to this folder.
remote_movie_path and remote_tv_path are the paths to the same folder but on the emby server, I.e if it's a network mount then it likely has a different mount point, but they contain the same physical files.
The script will replace the local_movie_path with remote_movie_path and then send that to emby for updates, so emby will get the correct path for it's file locally.
So if for example your radarr downloads to a folder named /movies/ then set local_movie_path to "/movies/"
On emby, say the same destination folder instead maps to "/mnt/movies/" then set remote_movie_path to "/mnt/movies/"
When the script is called, the file location will be local to radarr, so the script substitutes the local part of the path with the correct remote location for emby, it then connects to the emby endpoint to tell it that a file has been downloaded and it should scan.
For anybody else suffering from this problem with different mount points, don't use the built in emby connection and instead create a script connection and use this script.
#!/bin/bash
apiKey="<your emby api key>"
url="http://<emby server ip>:8096"
local_movie_path="/unraid/Movies/"
local_tv_path="/unraid/TV/"
remote_movie_path="/mnt/Movies/"
remote_tv_path="/mnt/TV/"
if [ -z "$apiKey" ]
then
printf "*******************************\n"
printf "* Error: No API Key specified.*\n"
printf "*******************************\n"
exit 1
fi
if [ -z "$url" ]
then
printf "********************************\n"
printf "* Error: No Emby URL specified.*\n"
printf "********************************\n"
exit 1
fi
if [ -z "$sonarr_eventtype" ] && [ -z "$radarr_eventtype" ]
then
printf "******************************************************************\n"
printf "* Error: Must be called as a custom script from Sonarr or Radarr.*\n"
printf "******************************************************************\n"
exit 1
fi
#SONARR
if [ "$sonarr_eventtype" == "Download" ]; then
UpdateType="Series"
Path=$(echo "$sonarr_episodefile_path" | sed "s|$local_tv_path|$remote_tv_path|")
fi
if [ "$sonarr_eventtype" == "Rename" ]; then
UpdateType="Series"
Path=$(echo "$sonarr_episodefile_path" | sed "s|$local_tv_path|$remote_tv_path|")
fi
if [ "$sonarr_eventtype" == "Test" ]; then
exit 0
fi
# RADARR
if [ "$radarr_eventtype" == "Download" ]; then
UpdateType="Movie"
Path=$(echo "$radarr_movie_path" | sed "s|$local_movie_path|$remote_movie_path|")
fi
if [ "$radarr_eventtype" == "Rename" ]; then
UpdateType="Movie"
Path=$(echo "$radarr_movie_path" | sed "s|$local_movie_path|$remote_movie_path|")
fi
if [ "$radarr_eventtype" == "Test" ]; then
exit 0
fi
if [ -z "$UpdateType" ] || [ -z "$Path" ]
then
printf "*************************************************\n"
printf "* Error: Script unsupported for this event type.*\n"
printf "*************************************************\n"
exit 1
fi
curl -s -X POST "$url/mediabrowser/Library/Media/Updated?api_key=$apiKey" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"Updates\": [ { \"Path\": \"$Path\", \"UpdateType\" \"$UpdateType\" } ]}"
according to this thread on emby community sonarr / radarr are using the old API.
emby devs supposedly put in a pull request to fix this...
https://emby.media/community/index.php?/topic/60694-sonarr-update-library/
i am having the same issue with no auto-updates of emby library.
according to this thread on emby community sonarr / radarr are using the old API.
emby devs supposedly put in a pull request to fix this...
https://emby.media/community/index.php?/topic/60694-sonarr-update-library/i am having the same issue with no auto-updates of emby library.
That鈥檚 not the issue, it is using the correct API.
As I wrote above and provided a solution, the issue is the mapping of the path of the file between radarr and emby, if they do not use the same path then it will not work.
The modified script I provided allows you to replace the path provided by radarr so that it is correct for emby, this results in the update working.
Why can't you just use the correct path in both?
Will the script above work if local_movie_path is a network location?
My emby server is not the same machine that stores/downloads the files.
local_movie_path="\BIG-D\movies\"
local_tv_path="\BIG-D\movies\"
remote_movie_path="/mnt/user/movies/"
remote_tv_path="/mnt/user/tv/"
does not seem to work.
Why can't you just use the correct path in both?
Radarr passes it's path to the files, emby uses that. If that path doesn't match the mount point in emby then it doesn't work.
It's the same issue that occurs with the download tool and radarr and why you have an option there to specify the path substibution from one host to another.
Will the script above work if local_movie_path is a network location?
My emby server is not the same machine that stores/downloads the files.local_movie_path="BIG-D\movies"
local_tv_path="BIG-D\movies"
remote_movie_path="/mnt/user/movies/"
remote_tv_path="/mnt/user/tv/"does not seem to work.
Sorry, I've not tried it with UNC paths, you'd have to turn on the extra debugging in emby and then trigger a download from radarr and then check the emby logs to see what path radarr sent to emby and then adjust the script appropriately.
Most helpful comment
I did a bit of debugging and radarr is sending the path it has to the downloaded file, in my case this is wrong. The host and path based substitution for downloads should be available for connections, but they dont work, so radarr sends a path for emby to refresh which doesnt exist.
Unless you have the same mappjng both radarr side and emby side to your media then the conecct notification will not work.