@ -1,5 +1,5 @@
#!/usr/bin/env bash
#!/usr/bin/env bash
scriptVersion = "1.0.01 7 "
scriptVersion = "1.0.01 8 "
arrEventType = " $radarr_eventtype "
arrEventType = " $radarr_eventtype "
arrItemId = $radarr_movie_id
arrItemId = $radarr_movie_id
tmdbApiKey = "3b7751e3179f796565d88fdb2fcdf426"
tmdbApiKey = "3b7751e3179f796565d88fdb2fcdf426"
@ -78,12 +78,15 @@ arrItemData=$(curl -s "$arrUrl/api/v3/movie/$arrItemId?apikey=$arrApiKey")
itemTitle = $( echo " $arrItemData " | jq -r .title)
itemTitle = $( echo " $arrItemData " | jq -r .title)
itemHasFile = $( echo " $arrItemData " | jq -r .hasFile)
itemHasFile = $( echo " $arrItemData " | jq -r .hasFile)
itemPath = " $( echo " $arrItemData " | jq -r ".path" ) "
itemPath = " $( echo " $arrItemData " | jq -r ".path" ) "
itemFileName = $( curl -s " $arrUrl /api/v3/moviefile?movieId= $arrItemId &apikey= $arrApiKey " | jq -r .[ ] .relativePath)
itemFileNameNoExt = " ${ itemFileName %.* } "
itemFolder = " $( basename " $itemPath " ) "
itemFolder = " $( basename " $itemPath " ) "
itemRelativePath = " $( echo " $arrItemData " | jq -r ".movieFile.relativePath" ) "
itemRelativePath = " $( echo " $arrItemData " | jq -r ".movieFile.relativePath" ) "
itemTrailerId = " $( echo " $arrItemData " | jq -r ".youTubeTrailerId" ) "
itemTrailerId = " $( echo " $arrItemData " | jq -r ".youTubeTrailerId" ) "
tmdbId = " $( echo " $arrItemData " | jq -r ".tmdbId" ) "
tmdbId = " $( echo " $arrItemData " | jq -r ".tmdbId" ) "
if [ ! -d " $itemPath " ] ; then
if [ ! -d " $itemPath " ] ; then
log " $itemTitle :: ERROR: Item Path does not exist ( $itemPath ), Skipping... "
log " $itemTitle :: ERROR: Item Path does not exist ( $itemPath ), Skipping... "
exit
exit
@ -157,10 +160,10 @@ do
log " $itemTitle :: $i of $tmdbVideosListDataIdsCount :: $tmdbExtraType :: Single Trailer Enabled... "
log " $itemTitle :: $i of $tmdbVideosListDataIdsCount :: $tmdbExtraType :: Single Trailer Enabled... "
if [ " $extrasKodiCompatibility " = = "true" ] ; then
if [ " $extrasKodiCompatibility " = = "true" ] ; then
finalPath = " $itemPath "
finalPath = " $itemPath "
finalFileName = " movie-trailer "
finalFileName = " $itemFileNameNoExt -trailer "
else
else
finalPath = " $itemPath / $extraFolderName "
finalPath = " $itemPath / $extraFolderName "
finalFileName = " $ itemFolder "
finalFileName = " $ tmdbExtraTitleClean "
fi
fi
else
else
finalPath = " $itemPath / $extraFolderName "
finalPath = " $itemPath / $extraFolderName "
@ -180,6 +183,11 @@ do
break
break
fi
fi
continue
continue
elif [ -f " $finalPath /movie-trailer.mkv " ] ; then
if [ " $extrasKodiCompatibility " = = "true" ] ; then
log " $itemTitle :: $i of $tmdbVideosListDataIdsCount :: $tmdbExtraType :: Removing old \"movie-trailer.mkv\" to replace with Kodi naming... "
rm " $finalPath /movie-trailer.mkv "
fi
fi
fi
videoLanguages = " $( echo " $extrasLanguages " | sed "s/-[[:alpha:]][[:alpha:]]//g" ) "
videoLanguages = " $( echo " $extrasLanguages " | sed "s/-[[:alpha:]][[:alpha:]]//g" ) "