1.0.065 - Add source tag to NFO files

#208 - Partial implementation of item 4....
pull/226/head
RandomNinjaAtk 2 years ago committed by GitHub
parent f585973994
commit b309864070
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
scriptVersion="1.0.064" scriptVersion="1.0.065"
if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then
lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
@ -491,6 +491,7 @@ VideoNfoWriter () {
echo " <musicBrainzArtistID>$lidarrArtistMusicbrainzId</musicBrainzArtistID>" >> "$nfo" echo " <musicBrainzArtistID>$lidarrArtistMusicbrainzId</musicBrainzArtistID>" >> "$nfo"
echo " </albumArtistCredits>" >> "$nfo" echo " </albumArtistCredits>" >> "$nfo"
echo " <thumb>${1}${2}.jpg</thumb>" >> "$nfo" echo " <thumb>${1}${2}.jpg</thumb>" >> "$nfo"
echo " <source>$8</source>" >> "$nfo"
echo "</musicvideo>" >> "$nfo" echo "</musicvideo>" >> "$nfo"
tidy -w 2000 -i -m -xml "$nfo" &>/dev/null tidy -w 2000 -i -m -xml "$nfo" &>/dev/null
chmod 666 "$nfo" chmod 666 "$nfo"
@ -718,6 +719,7 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do
videoImageId="$(echo "$videoData" | jq -r ".imageId")" videoImageId="$(echo "$videoData" | jq -r ".imageId")"
videoImageIdFix="$(echo "$videoImageId" | sed "s/-/\//g")" videoImageIdFix="$(echo "$videoImageId" | sed "s/-/\//g")"
videoThumbnail="https://resources.tidal.com/images/$videoImageIdFix/750x500.jpg" videoThumbnail="https://resources.tidal.com/images/$videoImageIdFix/750x500.jpg"
videoSource="tidal"
fi fi
if echo "$videoDownloadUrl" | grep -i "youtube" | read; then if echo "$videoDownloadUrl" | grep -i "youtube" | read; then
@ -730,6 +732,7 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do
videoThumbnail="$(echo "$videoData" | jq -r .thumbnail)" videoThumbnail="$(echo "$videoData" | jq -r .thumbnail)"
videoUploadDate="$(echo "$videoData" | jq -r .upload_date)" videoUploadDate="$(echo "$videoData" | jq -r .upload_date)"
videoYear="${videoUploadDate:0:4}" videoYear="${videoUploadDate:0:4}"
videoSource="youtube"
fi fi
DownloadVideo "$videoDownloadUrl" "$musicbrainzVideoTitleClean" "$plexVideoType" "MBZDB" DownloadVideo "$videoDownloadUrl" "$musicbrainzVideoTitleClean" "$plexVideoType" "MBZDB"
@ -740,7 +743,7 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do
DownloadThumb "$videoThumbnail" "$musicbrainzVideoTitleClean" "$plexVideoType" "MBZDB" DownloadThumb "$videoThumbnail" "$musicbrainzVideoTitleClean" "$plexVideoType" "MBZDB"
VideoProcessWithSMA "MBZDB" "$musicbrainzVideoTitle" VideoProcessWithSMA "MBZDB" "$musicbrainzVideoTitle"
VideoTagProcess "$musicbrainzVideoTitleClean" "$plexVideoType" "$videoYear" "MBZDB" VideoTagProcess "$musicbrainzVideoTitleClean" "$plexVideoType" "$videoYear" "MBZDB"
VideoNfoWriter "$musicbrainzVideoTitleClean" "$plexVideoType" "$musicbrainzVideoTitle" "" "musicbrainz" "$videoYear" "MBZDB" VideoNfoWriter "$musicbrainzVideoTitleClean" "$plexVideoType" "$musicbrainzVideoTitle" "" "musicbrainz" "$videoYear" "MBZDB" "$videoSource"
if [ ! -d "$videoPath/$lidarrArtistFolderNoDisambig" ]; then if [ ! -d "$videoPath/$lidarrArtistFolderNoDisambig" ]; then
mkdir -p "$videoPath/$lidarrArtistFolderNoDisambig" mkdir -p "$videoPath/$lidarrArtistFolderNoDisambig"
@ -835,6 +838,7 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do
videoThumbnail="$imvdbVideoImage" videoThumbnail="$imvdbVideoImage"
videoUploadDate="$(echo "$videoData" | jq -r .upload_date)" videoUploadDate="$(echo "$videoData" | jq -r .upload_date)"
videoYear="${videoUploadDate:0:4}" videoYear="${videoUploadDate:0:4}"
videoSource="youtube"
log "$processCount of $lidarrArtistIdsCount :: IMVDB :: $lidarrArtistName :: ${imvdbVideoTitle} :: $videoDownloadUrl..." log "$processCount of $lidarrArtistIdsCount :: IMVDB :: $lidarrArtistName :: ${imvdbVideoTitle} :: $videoDownloadUrl..."
DownloadVideo "$videoDownloadUrl" "$videoTitleClean" "$plexVideoType" "IMVDB" DownloadVideo "$videoDownloadUrl" "$videoTitleClean" "$plexVideoType" "IMVDB"
@ -845,7 +849,7 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do
DownloadThumb "$imvdbVideoImage" "$videoTitleClean" "$plexVideoType" "IMVDB" DownloadThumb "$imvdbVideoImage" "$videoTitleClean" "$plexVideoType" "IMVDB"
VideoProcessWithSMA "IMVDB" "$imvdbVideoTitle" VideoProcessWithSMA "IMVDB" "$imvdbVideoTitle"
VideoTagProcess "$videoTitleClean" "$plexVideoType" "$videoYear" "IMVDB" VideoTagProcess "$videoTitleClean" "$plexVideoType" "$videoYear" "IMVDB"
VideoNfoWriter "$videoTitleClean" "$plexVideoType" "$imvdbVideoTitle" "" "imvdb" "$videoYear" "IMVDB" VideoNfoWriter "$videoTitleClean" "$plexVideoType" "$imvdbVideoTitle" "" "imvdb" "$videoYear" "IMVDB" "$videoSource"
if [ ! -d "$videoPath/$lidarrArtistFolderNoDisambig" ]; then if [ ! -d "$videoPath/$lidarrArtistFolderNoDisambig" ]; then
mkdir -p "$videoPath/$lidarrArtistFolderNoDisambig" mkdir -p "$videoPath/$lidarrArtistFolderNoDisambig"

Loading…
Cancel
Save