|
|
@ -1,23 +1,21 @@
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
version=1.0.006
|
|
|
|
version=1.0.007
|
|
|
|
if [ -z "$lidarr_artist_path" ]; then
|
|
|
|
if [ -z "$lidarr_artist_path" ]; then
|
|
|
|
lidarr_artist_path="$1"
|
|
|
|
lidarr_artist_path="$1"
|
|
|
|
notfidedBy=Extended_Script
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
notfidedBy=Lidarr
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# auto-clean up log file to reduce space usage
|
|
|
|
# auto-clean up log file to reduce space usage
|
|
|
|
if [ -f "/config/logs/MetadataPostProcess.txt" ]; then
|
|
|
|
if [ -f "/config/logs/MetadataPostProcess.txt" ]; then
|
|
|
|
find /config/logs -type f -name "MetadataPostProcess.txt" -size +1024k -delete
|
|
|
|
find /config/logs -type f -name "MetadataPostProcess.txt" -size +1024k -delete
|
|
|
|
|
|
|
|
sleep 0.01
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
exec &> >(tee -a "/config/logs/MetadataPostProcess.txt")
|
|
|
|
exec &>> "/config/logs/MetadataPostProcess.txt"
|
|
|
|
touch "/config/logs/MetadataPostProcess.txt"
|
|
|
|
chmod 777 "/config/logs/MetadataPostProcess.txt"
|
|
|
|
chmod 666 "/config/logs/MetadataPostProcess.txt"
|
|
|
|
|
|
|
|
|
|
|
|
log () {
|
|
|
|
log () {
|
|
|
|
m_time=`date "+%F %T"`
|
|
|
|
m_time=`date "+%F %T"`
|
|
|
|
echo $m_time" :: $notfidedBy :: "$1
|
|
|
|
echo $m_time" :: MetadataPostProcess :: "$1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$lidarr_eventtype" == "Test" ]; then
|
|
|
|
if [ "$lidarr_eventtype" == "Test" ]; then
|
|
|
@ -48,7 +46,7 @@ fileExt="${fileName##*.}"
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$fileExt" == "flac" ]; then
|
|
|
|
if [ "$fileExt" == "flac" ]; then
|
|
|
|
getLyrics="$(ffprobe -loglevel 0 -print_format json -show_format -show_streams "$lidarr_trackfile_path" | jq -r ".format.tags.LYRICS" | sed "s/null//g" | sed "/^$/d")"
|
|
|
|
getLyrics="$(ffprobe -loglevel 0 -print_format json -show_format -show_streams "$lidarr_trackfile_path" | jq -r ".format.tags.LYRICS" | sed "s/null//g" | sed "/^$/d")"
|
|
|
|
processLyrics=true
|
|
|
|
getArtistCredit="$(ffprobe -loglevel 0 -print_format json -show_format -show_streams "$lidarr_trackfile_path" | jq -r ".format.tags.ARTIST_CREDIT" | sed "s/null//g" | sed "/^$/d")"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$fileExt" == "opus" ]; then
|
|
|
|
if [ "$fileExt" == "opus" ]; then
|
|
|
@ -62,4 +60,11 @@ if [ ! -z "$getLyrics" ]; then
|
|
|
|
chmod 666 "$lrcFile"
|
|
|
|
chmod 666 "$lrcFile"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$fileExt" == "flac" ]; then
|
|
|
|
|
|
|
|
if [ ! -z "$getArtistCredit" ]; then
|
|
|
|
|
|
|
|
metaflac --remove-tag=ARTIST "$lidarr_trackfile_path"
|
|
|
|
|
|
|
|
metaflac --set-tag=ARTIST_CREDIT="$getArtistCredit" "$lidarr_trackfile_path"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
exit
|
|
|
|
exit
|
|
|
|