Help with sorting to different drives
-
- Posts: 40
- Joined: 03 Sep 2016, 21:27
Help with sorting to different drives
OK, it's probably pretty simple but I cannot get it right. What I want is if a video is x264 then I want it to move to a folder on my F:\ drive that would be F:\Movies (x264), If it is any other codec I want it to go to I:\Movies (whatever the codec is). I have been trying for a few hours but just cannot get it to work.
Re: Help with sorting to different drives
e.g.
Conditional Structures (if-then-else)
Format: Select all
{ vc == 'x264' ? 'F:/Movies (x264)' : 'I:/Movies' }/{ ~plex.id }
Please read the FAQ and How to Request Help.
-
- Posts: 40
- Joined: 03 Sep 2016, 21:27
Re: Help with sorting to different drives
Thanks rednoah My script was a little more complex so I cheated with an AI bot and got this line working quite well.
Format: Select all
{fn=~/2160p/ ? (vc in ['x264', 'AVC'] ? 'F:\\Movies 4K (x264)' : vc=='HEVC' ? 'I:\\Movies 4K (x265)' : 'I:\\Movies 4K (' + vc + ')') : (vc in ['x264', 'AVC'] ? 'F:\\Movies (x264)' : vc=='HEVC' ? 'I:\\Movies (x265)' : 'I:\\Movies (' + vc + ')')}
Re: Help with sorting to different drives
Seems repetitive / hard to read / certainly does not express well the rules you mean to codify...
I'd probably do it like this, because you might want to read / understand / modify the code in the future:
(1) Use F:/ or I:/ depending on the video codec
(2) Use Movies or Movies 4K depending on the video resolution
(3) Add the video codec (use x265 instead of HEVC if applicable) in parenthesis
I'd probably do it like this, because you might want to read / understand / modify the code in the future:
Format: Select all
{ vc ==~ /x264|AVC/ ? 'F:/' : 'I:/' }
{ hd ==~ /UHD/ ? 'Movies 4K' : 'Movies' } ({ vc.replace('HEVC':'x265') })/
(2) Use Movies or Movies 4K depending on the video resolution
(3) Add the video codec (use x265 instead of HEVC if applicable) in parenthesis
Please read the FAQ and How to Request Help.
-
- Posts: 40
- Joined: 03 Sep 2016, 21:27
Re: Help with sorting to different drives
Thanks for the cleanup and the lesson. I appreciate your help.