WEBSource for logo-free releases

All about user-defined episode / movie format expressions
Post Reply
devster
Posts: 332
Joined: 06 Jun 2017, 22:56

WEBSource for logo-free releases

Post by devster » 12 Jan 2018, 18:42

Given the recent surge in web releases I'm trying to add information specific to this to my naming scheme.

Usually it's quite standard with:

Code: Select all

n.s00e00.vf.WEBSource.source.AUDIO.vc-group
But there's an unusual field: WEBSource.
For example: Nashville.S06E02.1080p.AMZN.WEBRip.DDP5.1.x264-KiNGS

What I'd like to propose is to have a snippet to allow this to be included in the final rename.
This is as far as I got but it doesn't seem well written:

Code: Select all

{ 
	def isWeb = (source ==~ /WEB.*/)
	def lfr = isWeb ? (fn =~ /(AMZN|HBO|HULU|NF|iT)\.(WEB)/) : null
	ret = allOf{lfr[0][1]}{source}.join(".")
	return ret
}
Ideally it should check against a list which could be more easily edited, like FileBot already does for example for the source binding using ReleaseInfo.properties.
I only work in black and sometimes very, very dark grey. (Batman)

User avatar
rednoah
The Source
Posts: 16600
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: WEBSource for logo-free releases

Post by rednoah » 13 Jan 2018, 10:18

Here's what I'm thinking:

Code: Select all

{
	allOf
		{fn.match(/AMZN|HBO|HULU/)}
		{source}
	.join('.')
}
If this kind of format becomes popular, then I can add convenience bindings as well.
:idea: Please read the FAQ and How to Request Help.

devster
Posts: 332
Joined: 06 Jun 2017, 22:56

Re: WEBSource for logo-free releases

Post by devster » 15 Jan 2018, 19:25

This is the list of Web Sources I'd use:

Code: Select all

9NOW
AE
AUBC
AMBC
AS
AJAZ
AMZN
AMC
ATK
ANPL
ANLB
AOL
ARD
iP
BRAV
CNLP
CN
CBC
CBS
4OD
CHGD
CMAX
CNBC
CC
CCGC
COOK
CMT
CRKL
CR
CSPN
CTV
CUR
CWS
DSKI
DHF
DEST
DDY
DTV
DISC
DSNY
DIY
DOCC
DPLY
ETV
ETTV
EPIX
ESPN
ESQ
FAM
FJR
FOOD
FOX
FREE
FYI
GLBL
GLOB
GO90
GC
HLMK
HBO
HGTV
HIDI
HIST
HULU
TOU
IFC
ID
iT
ITV
KNOW
LIFE
LN
MNBC
MTOD
MTV
NATG
NBA
NBC
NF
NFLN
NFL
NICK
NRK
PLUZ
PBS
PBSK
PSN
RSTR
RTE
SBS
SESO
SHMI
SPIK
SNET
SPRT
STAN
STZ
SVT
SWER
SYFY
TBS
TEN
TFOU
TLC
TRVL
TUBI
TV3
TV4
TVL
VH1
VICE
VMEO
UFC
UKTV
UNIV
VLCT
VIAP
VRV
WNET
WME
WWEN
XBOX
YHOO
RED
ZDF
So I'd propose:

Code: Select all

{ def websources = readLines("/path/to/websources.txt").join("|")
  def isWeb = (source ==~ /WEB.*/)
  // def isWeb = source.matches(/WEB.*/) don't know which one is preferrable
  def lfr = { if (isWeb) fn.match(/($websources)\.(?i)WEB/) }
  return allOf{lfr}{source}.join(".") }
I kept the regex with the WEB component and the WEB check because with the amount of websources an accidental match could be possible. But it can safely be removed.

Is .match() basic Groovy or is it something from FileBot?
I only work in black and sometimes very, very dark grey. (Batman)

User avatar
rednoah
The Source
Posts: 16600
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: WEBSource for logo-free releases

Post by rednoah » 15 Jan 2018, 19:53

String.match() is specific to FileBot.
:idea: Please read the FAQ and How to Request Help.

Post Reply