[FEATURE] - Emby Notify Script
Would it be possilbe to add an emby notify script such as plex notify? Or can plex notify be used for emby?
When I last looked at it, I couldn’t find a way to do targeted scans. If you can find a way to do that and a link to some documentation, I’ll look into it. Because I wanted to implement the same thing for Jellyfin and Emby but couldn’t find a way to accomplish it…
Would this API help?
https://api.jellyfin.org/#tag/Items/operation/GetItems
/Items?artists=YOASOBI&albums=Idol
https://api.jellyfin.org/#tag/ItemRefresh
/Items/c44cf79584cf3d3adee49bc97d45055c/Refresh?Recursive=true&ImageRefreshMode=Default&MetadataRefreshMode=Default&ReplaceAllImages=false&ReplaceAllMetadata=false
I might take a look at this. I just wished that I had found your repo sooner before my work break lol.
No, those don't help. There is a feature request for what is needed to make what your asking for possible... But as of now, as far as I can tell, the functionality doesn't exist:
https://features.jellyfin.org/posts/1758/scan-specific-folders-from-a-larger-library
#!/bin/bash
NOW=$(date +"%d-%m-%Y %H:%M") LOG_FILE="/config/logging/emby_scan.txt" TMP_FILE="/tmp/tmp_emby_radarr.txt" DL_FILE="/config/scripts/dl_radarr.txt" DEL_FILE="/config/scripts/del_radarr.txt" REN_FILE="/config/scripts/ren_radarr.txt" EMBY_URL="" EMBY_RADARR_APIKEY="" local_movie_path="" remote_movie_path=""
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} UpdateType="Created" Path=$(echo "$radarr_movie_path" | sed "s|$local_movie_path|$remote_movie_path|") fi
if [ "${radarr_eventtype}" == "MovieDelete" ]; then echo "${radarr_movie_title} (${radarr_movie_year})" >> ${DEL_FILE} UpdateType="Deleted" Path=$(echo "$radarr_movie_path" | sed "s|$local_movie_path|$remote_movie_path|") fi
if [ "$radarr_eventtype" == "Rename" ]; then echo "${radarr_movie_title} (${radarr_movie_year})" >> ${REN_FILE} UpdateType="Modified" Path=$(echo "$radarr_movie_path" | sed "s|$local_movie_path|$remote_movie_path|") fi
curl -X POST "${EMBY_URL}/emby/Library/Media/Updated?api_key=${EMBY_RADARR_APIKEY}" -H "accept: */*" -H "Content-Type: application/json" -d "{\"Updates\":[{\"Path\":\"${Path}\",\"UpdateType\":\"${UpdateType}\"}]}"
else (echo "${NOW} - [Emby Library Scan] Radarr Event Type is empty."; 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)" > /config/logging/$(basename $0)_lastrun.txt
I have tried to implement it here, it seems to do the work for me :) https://github.com/RandomNinjaAtk/arr-scripts/pull/306