You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
3.8 KiB
Python
85 lines
3.8 KiB
Python
import os, sys, importlib, glob, inspect, itertools
|
|
|
|
from ffx.track_type import TrackType
|
|
|
|
from ffx.track_descriptor import TrackDescriptor
|
|
from ffx.media_descriptor import MediaDescriptor
|
|
|
|
from .basename_combinator import BasenameCombinator
|
|
|
|
from .indicator_combinator import IndicatorCombinator
|
|
|
|
|
|
class BasenameCombinator0(BasenameCombinator):
|
|
|
|
VARIANT = 'B0'
|
|
|
|
# def __init__(self, SubCombinators: dict = {}, context = None):
|
|
def __init__(self, context = None):
|
|
self._context = context
|
|
self._logger = context['logger']
|
|
self._reportLogger = context['report_logger']
|
|
|
|
def getVariant(self):
|
|
return BasenameCombinator0.VARIANT
|
|
|
|
def getPayload(self):
|
|
return {}
|
|
|
|
def assertFunc(self, testObj = {}):
|
|
pass
|
|
|
|
def shouldFail(self):
|
|
return False
|
|
|
|
def getYield(self):
|
|
|
|
for MTC in MediaTagCombinator.getAllClassReferences():
|
|
for DC2_A in DispositionCombinator2.getAllClassReferences():
|
|
for TC2_A in TrackTagCombinator2.getAllClassReferences():
|
|
for DC3_S in DispositionCombinator3.getAllClassReferences():
|
|
for TC3_S in TrackTagCombinator3.getAllClassReferences():
|
|
for J in JellyfinCombinator.getAllClassReferences():
|
|
|
|
j = J(self._context)
|
|
self._context['use_jellyfin'] = j.getPayload()
|
|
|
|
dc2a = DC2_A(self._context)
|
|
tc2a = TC2_A(self._context)
|
|
dc3s = DC3_S(self._context)
|
|
tc3s = TC3_S(self._context)
|
|
mtc = MTC(self._context)
|
|
|
|
yieldObj = {}
|
|
|
|
yieldObj['identifier'] = self.getIdentifier()
|
|
yieldObj['variants'] = [self.getVariant(),
|
|
f"A:{dc2a.getVariant()}",
|
|
f"A:{tc2a.getVariant()}",
|
|
f"S:{dc3s.getVariant()}",
|
|
f"S:{tc3s.getVariant()}",
|
|
mtc.getVariant(),
|
|
j.getVariant()]
|
|
|
|
yieldObj['payload'] = self.getPayload(dc2a.getPayload(), tc2a.getPayload(), dc3s.getPayload(), tc3s.getPayload())
|
|
|
|
yieldObj['assertSelectors'] = ['M', 'AD', 'AT', 'SD', 'ST', 'MT', 'J']
|
|
|
|
yieldObj['assertFuncs'] = [self.assertFunc,
|
|
dc2a.assertFunc,
|
|
tc2a.assertFunc,
|
|
dc3s.assertFunc,
|
|
tc3s.assertFunc,
|
|
mtc.assertFunc,
|
|
j.assertFunc]
|
|
|
|
yieldObj['shouldFail'] = (self.shouldFail()
|
|
| dc2a.shouldFail()
|
|
| tc2a.shouldFail()
|
|
| dc3s.shouldFail()
|
|
| tc3s.shouldFail()
|
|
| mtc.shouldFail()
|
|
| j.shouldFail())
|
|
|
|
yield yieldObj
|