Code: Select all
{media.Keyword == null ? "" : " - " + media.Keyword}
Code: Select all
{media.Keyword == null ? "" : " - " + media.Keyword}
Code: Select all
{' - '.concat('FileBot')}
Code: Select all
{' - '.concat(null)}
Code: Select all
{if (media.title) ' - ' + media.title}
Code: Select all
{vf == /2160p/ ? 'Movies 4K' : 'Movies'}
Code: Select all
M:/{vf == /2160p/ ? 'Movies 4K' : 'Movies'}/{n.upperInitial().colon(' -').replace('?', '!')} ({y})/
Code: Select all
vf == /2160p/ ? 'Movies 4K' : vf == /1080p|720p/ ? 'Movies HD' : 'Movies'
Code: Select all
{vf == /2160p/ ? 'Movies 4K' : vf == /1080p|720p/ ? 'Movies HD' : 'Movies'}
Code: Select all
{vf == /2160p/ ? 'Movies 4K' : vf == /720p/ ? 'Movies HD' : vf == /1080p/ ? 'Movies HD' : 'Movies'}
Code: Select all
== ... equals
=~ ... matches
Code: Select all
{vf == /2160p/ ? 'Movies 4K' : vf =~ /1080p|720p/ ? 'Movies HD' : 'Movies'}
Yup, thanks..that did the trick.. Nice to know, though, that apparently the logic can just go on and on if need be.rednoah wrote: ↑13 Mar 2018, 17:44 Sorry, my bad, typo.
e.g.Code: Select all
== ... equals =~ ... matches
Code: Select all
{vf == /2160p/ ? 'Movies 4K' : vf =~ /1080p|720p/ ? 'Movies HD' : 'Movies'}
Code: Select all
any{certification}{'Not Rated'}.replace('Not Rated', 'NR')
Ok.. let me expand on this one (sorry, with over 5000 files to rename again I keep finding files with NEW issues.. LOL)rednoah wrote: ↑14 Mar 2018, 03:30 Try this:any{certification}{'Not Rated'} gives you either the certification, if defined, or "Not Rated", and then replace does what replace does.Code: Select all
any{certification}{'Not Rated'}.replace('Not Rated', 'NR')
![]()
Code: Select all
any{certification}{'Not Rated'}.replace('Not Rated', 'NR').replace('Not Approved', 'NA')
Code: Select all
any{certification}{'Not Rated'}.replaceAll(/[ a-z]/)
I like this idea. Where can I get more information on how to set up the csv file as well as correctly inserting that code into my code.rednoah wrote: ↑14 Mar 2018, 05:18
If you have a lot of replacement / lookup logic, then you can use external CSV files for those mappings, akin to Example 4 here:
viewtopic.php?f=5&t=182
This is the complete example. What exactly is unclear?rednoah wrote: ↑15 Jul 2012, 09:03 4. Mappings from a CSV filee.g. /path/to/names.csvCode: Select all
{csv('/path/to/names.csv').get(n) ?: n}
Code: Select all
Deep Space 9;DS9 How I Met Your Mother;HIMYM
I am doing it exactly as shown but it is doing something very strange. Here is a screenshot:rednoah wrote: ↑14 Mar 2018, 18:36This is the complete example. What exactly is unclear?rednoah wrote: ↑15 Jul 2012, 09:03 4. Mappings from a CSV filee.g. /path/to/names.csvCode: Select all
{csv('/path/to/names.csv').get(n) ?: n}
Code: Select all
Deep Space 9;DS9 How I Met Your Mother;HIMYM
Code: Select all
csv('/path/to/names.csv')
Code: Select all
def m = csv('/path/to/names.csv'); m.get('Not Rated')
Code: Select all
csv('/path/to/names.csv').get(certification)
Code: Select all
any{csv('/path/to/names.csv').get(certification)}{"Unkown Certification: $certification"}
Code: Select all
def m = [A: 'X', B:'Y']
Code: Select all
def m = [A: 'X', B:'Y']
m.get('A') // yield X
m.get('BAD KEY') // yield null
Code: Select all
{ any{csv('/path/to/names.csv').get(certification)}{"Unkown Certification: $certification"}{"No Certification"} }
Code: Select all
{ csv('/path/to/names.csv') }
Code: Select all
{certification}
Code: Select all
Binding "certification": undefined
Code: Select all
{Not Rated=NR, APPROVED=NR, N A=NR, N R=NR, =NR}
Code: Select all
{"Unkown Certification: $certification"}
Code: Select all
{ any{csv('/path/to/names.csv').get(certification)}{"Unkown Certification: $certification"}{"No Certification"} }
Code: Select all
{ any{csv('/path/to/names.csv').get(certification)}{"Unkown Certification: $certification"}{"No Certification"} }