Separate out WEBRip from WEB-DL

All about user-defined episode / movie format expressions
Post Reply
jwl
Posts: 2
Joined: 15 Aug 2022, 16:04

Separate out WEBRip from WEB-DL

Post by jwl »

Is there an easy way to separate out WEBRip from WEB-DL? I'd like to keep WEBRip as it's own source and not bundle it together with WEB-DL.
User avatar
rednoah
The Source
Posts: 21333
Joined: 16 Nov 2011, 08:59

Re: Separate out WEBRip from WEB-DL

Post by rednoah »

e.g. if the file says WEBRip yield WEBRip otherwise yield whatever value vs has:

Code: Select all

{ f =~ /WEBRip/ ? 'WEBRip' : vs }

:idea: You would use this as part of the folder structure to separate different sources into different folders like so:

Code: Select all

{ drive }/Media/{ f =~ /WEBRip/ ? 'WEBRip' : vs }/{ ny }/{ plex.name }
:idea: Please read the FAQ and How to Request Help.
jwl
Posts: 2
Joined: 15 Aug 2022, 16:04

Re: Separate out WEBRip from WEB-DL

Post by jwl »

Sorry, I should have be more clear. I don't want them in separate folders, I want to rename them using the vs value but instead of grouping WEBRip and WEB-DL together, I want to keep WEBRip as is.

But using your example above, I think I was able to come up with something that should work for me.

Code: Select all

{ source.lower() =~ /webrip/ ? 'WEBRip' : vs }
Thanks!
User avatar
rednoah
The Source
Posts: 21333
Joined: 16 Nov 2011, 08:59

Re: Separate out WEBRip from WEB-DL

Post by rednoah »

e.g. you can do a case-insensitive match on the file name like so:

Code: Select all

{ fn =~ /(?i)WEBRip/ ? 'WEBRip' : vs }
or so:

Code: Select all

{ any{ fn.match(/WEBRip/) }{ vs } }
:idea: Please read the FAQ and How to Request Help.
Post Reply