Page 1 of 1

Help with sorting to different drives

Posted: 10 Aug 2024, 04:17
by cyberdoggy
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

Posted: 10 Aug 2024, 04:25
by rednoah
e.g.

Format: Select all

{ vc == 'x264' ? 'F:/Movies (x264)' : 'I:/Movies' }/{ ~plex.id }
:arrow: Conditional Structures (if-then-else)

Re: Help with sorting to different drives

Posted: 11 Aug 2024, 00:09
by cyberdoggy
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

Posted: 11 Aug 2024, 06:25
by rednoah
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:

Format: Select all

{ vc ==~ /x264|AVC/ ? 'F:/' : 'I:/' }
{ hd ==~ /UHD/ ? 'Movies 4K' : 'Movies' } ({ vc.replace('HEVC':'x265') })/
(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

Re: Help with sorting to different drives

Posted: 15 Aug 2024, 01:11
by cyberdoggy
Thanks for the cleanup and the lesson. I appreciate your help.