I've hacked together a script that I run via cron on my Linux system to update the Library periodically until the Problem has been fixed upstream. It takes any number of sections as argument and refreshes them. Feel free to use/modify if you find it useful. Don't forget to adjust the paths to whatever you're using on your system.
Example:
/etc/cron.d/plexscan (mode 0644)
0 * * * * plex /usr/local/bin/plexscan.bash "TV Shows" "Movies" > /dev/null 2>&1
/usr/local/bin/plexscan.bash (mode 0755)
#!/bin/bash set -o errexit -o nounset -o pipefailexport PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/var/lib/plexmediaserver/Library/Application Support"
export PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
export PLEX_MEDIA_SERVER_TMPDIR=/tmp
export LD_LIBRARY_PATH="$PLEX_MEDIA_SERVER_HOME"
export LC_ALL=“en_US.UTF-8”
export LANG=“en_US.UTF-8”
ulimit -s 3000function -h {
cat <<USAGE
USAGE: $0 [options] *
Scans the section and refreshes metadata.Options:
-l List section names
-h Print this help
USAGE
}; function --help { -h ;}function -l {
scanner --list | cut -d : -f 2 | sort
}function scanner {
“${PLEX_MEDIA_SERVER_HOME}/Plex Media Scanner” “$@”
}function sectionId {
scanner -l |
awk -v section="$1" ’
BEGIN { FS=OFS=":" }
{
gsub(/^[ ]+|[ ]+$/, “”, $1);
gsub(/^[ ]+|[ ]+$/, “”, $2);
if($2==section) print $1
}’
}function scan {
scanner --scan --refresh --section $1
}function main {
[[ -z “$@” ]] && --helpfor section in “$@”
do
declare -i sectionId=$(sectionId “$section”)
if ! [ $sectionId -gt 0 ] ; then
echo “error: could not find section ID for section $section” >&2
continue
fiecho “scanning section $section with id $sectionId”
scan $sectionId &
done
wait
}if [[ ${1:-} ]] && declare -F | cut -d’ ’ -f3 | fgrep -qx – “${1:-}”
then “$@”
else main “$@”
fi