Since rednoah help so nicely with the big main issue I had with my script I thought I do a little update in the complete script.
The goal of my script is following:
- It has to recognize if a movie is SD / HD / UHD that was easy to fix with
Code: Select all
if (getMediaInfo(f, '{vf}') == "1080p" || getMediaInfo(f, '{vf}') == "720p"){
}else if (getMediaInfo(f, '{vf}') == "2160p"){
}else{
}
Code: Select all
if (getMediaInfo(f, '{media.AudioCount}').toInteger() > 1){
f (getMediaInfo(f, '{media.Audio_Language_List}').contains("Ger") || getMediaInfo(f, '{media.Audio_Language_List}').contains("GER") && getMediaInfo(f, '{media.Audio_Language_List}').contains("Eng") || getMediaInfo(f, '{media.Audio_Language_List}').contains("ENG") || language.contains("ende") ){
Code: Select all
}else if (ParentFolder.toString().contains("decision1") || ParentFolder.toString().contains("decision2")){
- Then it has to search inside the movie directory for .idx .sub .srt files according to the movie and move them next to the movie file and also correct them so plex can read them correctly blablabla-ger-forced.idx has to become blablabla.ger.forced.idx and can no longer be in the sub folder should be on the same folder as the movie.mkv done with:
Code: Select all
//Get the Parent Folder
args.eachMediaFolder{
ParentFolder = it
println ParentFolder
//Move all the Subtitles to the Parent Folder
args.getFiles{ it.isSubtitle()}
.each{
rename(file:it,output:ParentFolder,format:"{fn}")
}
args.getFiles{ it.isSubtitle() }
.each{
SubFolder = new File(getMediaInfo(file:it, format:"{folder}"))
println it.moveTo(new File(getMediaInfo(file:it, format:ParentFolder+"/{fn}.{ext}")))
}
Code: Select all
new URL("http://$plexServer:32400/library/sections/$Decision1/refresh?X-Plex-Token=$mytoken").get()
Decision1
Irgendein.Film.1.German.DL.AC3.Dubbed.1080p.BluRay.x264-WhatEver
Irgendein.Film.2.2016.German.DTS.DL.1080p.BluRay.x264.PROPER-WhatEver
Irgendein.Film.3.2016.German.DTS.DL.1080p.BluRay.x264-WhatEver
Irgendein.Film.4.2016.German.DL.1080p.BluRay.x264-WhatEver
It will move the subs from \mnt\NAS\Decision1\Irgendein.Film.2.2016.German.DTS.DL.1080p.BluRay.x264.PROPER-WhatEver\Subs\blaba.idx to \mnt\NAS\Decision1\Irgendein.Film.1.German.DL.AC3.Dubbed.1080p.BluRay.x264-WhatEver\
I think my scripting is wrong in that part...
@rednoah I hope you are happy
Thanks for any help