Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
1.0.072 - Use IMVDB Video Year
Browse files Browse the repository at this point in the history
#235 - Should fix this, but untested....
  • Loading branch information
RandomNinjaAtk authored May 6, 2023
1 parent a59cc14 commit 693f13b
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions root/scripts/Video.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
scriptVersion="1.0.071"
scriptVersion="1.0.072"

if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then
lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
Expand Down Expand Up @@ -715,7 +715,7 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do
videoThumbnail="$(echo "$videoData" | jq -r .thumbnail)"
videoUploadDate="$(echo "$videoData" | jq -r .upload_date)"
videoYear="${videoUploadDate:0:4}"
videoSource="youtube"
videoSource="youtube"
fi

log "$processCount of $lidarrArtistIdsCount :: MBZDB :: $lidarrArtistName :: ${musicbrainzVideoTitle}${musicbrainzVideoDisambiguation} :: $videoDownloadUrl..."
Expand Down Expand Up @@ -812,7 +812,8 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do
imvdbProcessCount=$(( $imvdbProcessCount + 1 ))
imvdbVideoTitle="$(cat "$imvdbVideoData" | jq -r .song_title)"
videoTitleClean="$(echo "$imvdbVideoTitle" | sed -e "s/[^[:alpha:][:digit:]$^&_+=()'%;{},.@#]/ /g" -e "s/ */ /g" | sed 's/^[.]*//' | sed 's/[.]*$//g' | sed 's/^ *//g' | sed 's/ *$//g')"
imvdbVideoYear="$(cat "$imvdbVideoData" | jq -r .year)"
imvdbVideoYear=""
imvdbVideoYear="$(cat "$imvdbVideoData" | jq -r .year)"
imvdbVideoImage="$(cat "$imvdbVideoData" | jq -r .image.o)"
imvdbVideoArtistsSlug="$(cat "$imvdbVideoData" | jq -r .artists[].slug)"
echo "$lidarrArtistName" > /config/extended/cache/imvdb/$imvdbVideoArtistsSlug
Expand Down Expand Up @@ -871,10 +872,14 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do
videoData="$(yt-dlp -j "$videoDownloadUrl")"
fi

videoThumbnail="$imvdbVideoImage"
videoUploadDate="$(echo "$videoData" | jq -r .upload_date)"
videoYear="${videoUploadDate:0:4}"
videoSource="youtube"
videoThumbnail="$imvdbVideoImage"
if [ -z "$imvdbVideoYear" ]; then
videoUploadDate="$(echo "$videoData" | jq -r .upload_date)"
videoYear="${videoUploadDate:0:4}"
else
videoYear="$imvdbVideoYear"
fi
videoSource="youtube"

log "$processCount of $lidarrArtistIdsCount :: IMVDB :: $lidarrArtistName :: ${imvdbVideoTitle} :: $videoDownloadUrl..."
DownloadVideo "$videoDownloadUrl" "$videoTitleClean" "$plexVideoType" "IMVDB"
Expand Down

0 comments on commit 693f13b

Please sign in to comment.