Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] - Emby Notify Script #118

Open
ChristoffBo opened this issue Nov 26, 2023 · 5 comments
Open

[FEATURE] - Emby Notify Script #118

ChristoffBo opened this issue Nov 26, 2023 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed lidarr radarr readarr sonarr

Comments

@ChristoffBo
Copy link

Would it be possilbe to add an emby notify script such as plex notify? Or can plex notify be used for emby?

@ChristoffBo ChristoffBo added the enhancement New feature or request label Nov 26, 2023
@RandomNinjaAtk
Copy link
Owner

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…

@rairulyle
Copy link

rairulyle commented Jan 4, 2024

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.

@RandomNinjaAtk
Copy link
Owner

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

@abescalamis
Copy link

abescalamis commented Jun 2, 2024

#!/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

@Allram
Copy link

Allram commented Sep 14, 2024

I have tried to implement it here, it seems to do the work for me :)
#306

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed lidarr radarr readarr sonarr
Projects
None yet
Development

No branches or pull requests

5 participants