Page 1 of 1

WEBSource for logo-free releases

Posted: 12 Jan 2018, 18:42
by devster
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.

Re: WEBSource for logo-free releases

Posted: 13 Jan 2018, 10:18
by rednoah
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.

Re: WEBSource for logo-free releases

Posted: 15 Jan 2018, 19:25
by devster
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?

Re: WEBSource for logo-free releases

Posted: 15 Jan 2018, 19:53
by rednoah
String.match() is specific to FileBot.