nightl matrix tests hMWE
This commit is contained in:
17
bin/ffx.py
17
bin/ffx.py
@@ -252,6 +252,7 @@ def shows(ctx):
|
|||||||
@click.option("-t", "--no-tmdb", is_flag=True, default=False)
|
@click.option("-t", "--no-tmdb", is_flag=True, default=False)
|
||||||
@click.option("-j", "--no-jellyfin", is_flag=True, default=False)
|
@click.option("-j", "--no-jellyfin", is_flag=True, default=False)
|
||||||
@click.option("-np", "--no-pattern", is_flag=True, default=False)
|
@click.option("-np", "--no-pattern", is_flag=True, default=False)
|
||||||
|
@click.option("--no-prompt", is_flag=True, default=False)
|
||||||
|
|
||||||
def convert(ctx,
|
def convert(ctx,
|
||||||
paths,
|
paths,
|
||||||
@@ -281,7 +282,8 @@ def convert(ctx,
|
|||||||
denoise,
|
denoise,
|
||||||
no_tmdb,
|
no_tmdb,
|
||||||
no_jellyfin,
|
no_jellyfin,
|
||||||
no_pattern):
|
no_pattern,
|
||||||
|
no_prompt):
|
||||||
"""Batch conversion of audiovideo files in format suitable for web playback, e.g. jellyfin
|
"""Batch conversion of audiovideo files in format suitable for web playback, e.g. jellyfin
|
||||||
|
|
||||||
Files found under PATHS will be converted according to parameters.
|
Files found under PATHS will be converted according to parameters.
|
||||||
@@ -298,6 +300,7 @@ def convert(ctx,
|
|||||||
context['use_jellyfin'] = not no_jellyfin
|
context['use_jellyfin'] = not no_jellyfin
|
||||||
context['use_tmdb'] = not no_tmdb
|
context['use_tmdb'] = not no_tmdb
|
||||||
context['use_pattern'] = not no_pattern
|
context['use_pattern'] = not no_pattern
|
||||||
|
context['no_prompt'] = no_prompt
|
||||||
|
|
||||||
context['import_subtitles'] = (subtitle_directory and subtitle_prefix)
|
context['import_subtitles'] = (subtitle_directory and subtitle_prefix)
|
||||||
if context['import_subtitles']:
|
if context['import_subtitles']:
|
||||||
@@ -377,26 +380,38 @@ def convert(ctx,
|
|||||||
# Query user for the correct sub indices, then configure flags in track descriptors associated with media descriptor accordingly.
|
# Query user for the correct sub indices, then configure flags in track descriptors associated with media descriptor accordingly.
|
||||||
# The correct tokens should then be created by
|
# The correct tokens should then be created by
|
||||||
if len([v for v in sourceMediaDescriptor.getVideoTracks() if v.getDispositionFlag(TrackDisposition.DEFAULT)]) > 1:
|
if len([v for v in sourceMediaDescriptor.getVideoTracks() if v.getDispositionFlag(TrackDisposition.DEFAULT)]) > 1:
|
||||||
|
if context['no_prompt']:
|
||||||
|
raise click.ClickException('More than one default video stream detected and no prompt set')
|
||||||
defaultVideoTrackSubIndex = click.prompt("More than one default video stream detected! Please select stream", type=int)
|
defaultVideoTrackSubIndex = click.prompt("More than one default video stream detected! Please select stream", type=int)
|
||||||
sourceMediaDescriptor.setDefaultSubTrack(TrackType.VIDEO, defaultVideoTrackSubIndex)
|
sourceMediaDescriptor.setDefaultSubTrack(TrackType.VIDEO, defaultVideoTrackSubIndex)
|
||||||
|
|
||||||
if len([v for v in sourceMediaDescriptor.getVideoTracks() if v.getDispositionFlag(TrackDisposition.FORCED)]) > 1:
|
if len([v for v in sourceMediaDescriptor.getVideoTracks() if v.getDispositionFlag(TrackDisposition.FORCED)]) > 1:
|
||||||
|
if context['no_prompt']:
|
||||||
|
raise click.ClickException('More than one forced video stream detected and no prompt set')
|
||||||
forcedVideoTrackSubIndex = click.prompt("More than one forced video stream detected! Please select stream", type=int)
|
forcedVideoTrackSubIndex = click.prompt("More than one forced video stream detected! Please select stream", type=int)
|
||||||
sourceMediaDescriptor.setForcedSubTrack(TrackType.VIDEO, forcedVideoTrackSubIndex)
|
sourceMediaDescriptor.setForcedSubTrack(TrackType.VIDEO, forcedVideoTrackSubIndex)
|
||||||
|
|
||||||
if len([a for a in sourceMediaDescriptor.getAudioTracks() if a.getDispositionFlag(TrackDisposition.DEFAULT)]) > 1:
|
if len([a for a in sourceMediaDescriptor.getAudioTracks() if a.getDispositionFlag(TrackDisposition.DEFAULT)]) > 1:
|
||||||
|
if context['no_prompt']:
|
||||||
|
raise click.ClickException('More than one default audio stream detected and no prompt set')
|
||||||
defaultAudioTrackSubIndex = click.prompt("More than one default audio stream detected! Please select stream", type=int)
|
defaultAudioTrackSubIndex = click.prompt("More than one default audio stream detected! Please select stream", type=int)
|
||||||
sourceMediaDescriptor.setDefaultSubTrack(TrackType.AUDIO, defaultAudioTrackSubIndex)
|
sourceMediaDescriptor.setDefaultSubTrack(TrackType.AUDIO, defaultAudioTrackSubIndex)
|
||||||
|
|
||||||
if len([a for a in sourceMediaDescriptor.getAudioTracks() if a.getDispositionFlag(TrackDisposition.FORCED)]) > 1:
|
if len([a for a in sourceMediaDescriptor.getAudioTracks() if a.getDispositionFlag(TrackDisposition.FORCED)]) > 1:
|
||||||
|
if context['no_prompt']:
|
||||||
|
raise click.ClickException('More than one forced audio stream detected and no prompt set')
|
||||||
forcedAudioTrackSubIndex = click.prompt("More than one forced audio stream detected! Please select stream", type=int)
|
forcedAudioTrackSubIndex = click.prompt("More than one forced audio stream detected! Please select stream", type=int)
|
||||||
sourceMediaDescriptor.setForcedSubTrack(TrackType.AUDIO, forcedAudioTrackSubIndex)
|
sourceMediaDescriptor.setForcedSubTrack(TrackType.AUDIO, forcedAudioTrackSubIndex)
|
||||||
|
|
||||||
if len([s for s in sourceMediaDescriptor.getSubtitleTracks() if s.getDispositionFlag(TrackDisposition.DEFAULT)]) > 1:
|
if len([s for s in sourceMediaDescriptor.getSubtitleTracks() if s.getDispositionFlag(TrackDisposition.DEFAULT)]) > 1:
|
||||||
|
if context['no_prompt']:
|
||||||
|
raise click.ClickException('More than one default subtitle stream detected and no prompt set')
|
||||||
defaultSubtitleTrackSubIndex = click.prompt("More than one default subtitle stream detected! Please select stream", type=int)
|
defaultSubtitleTrackSubIndex = click.prompt("More than one default subtitle stream detected! Please select stream", type=int)
|
||||||
sourceMediaDescriptor.setDefaultSubTrack(TrackType.SUBTITLE, defaultSubtitleTrackSubIndex)
|
sourceMediaDescriptor.setDefaultSubTrack(TrackType.SUBTITLE, defaultSubtitleTrackSubIndex)
|
||||||
|
|
||||||
if len([s for s in sourceMediaDescriptor.getSubtitleTracks() if s.getDispositionFlag(TrackDisposition.FORCED)]) > 1:
|
if len([s for s in sourceMediaDescriptor.getSubtitleTracks() if s.getDispositionFlag(TrackDisposition.FORCED)]) > 1:
|
||||||
|
if context['no_prompt']:
|
||||||
|
raise click.ClickException('More than one forced subtitle stream detected and no prompt set')
|
||||||
forcedSubtitleTrackSubIndex = click.prompt("More than one forced subtitle stream detected! Please select stream", type=int)
|
forcedSubtitleTrackSubIndex = click.prompt("More than one forced subtitle stream detected! Please select stream", type=int)
|
||||||
sourceMediaDescriptor.setForcedSubTrack(TrackType.SUBTITLE, forcedSubtitleTrackSubIndex)
|
sourceMediaDescriptor.setForcedSubTrack(TrackType.SUBTITLE, forcedSubtitleTrackSubIndex)
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
import os, sys, importlib, glob, inspect
|
|
||||||
|
|
||||||
class Disposition():
|
|
||||||
|
|
||||||
def __init__(self, context = None):
|
|
||||||
self._context = context
|
|
||||||
self._logger = context['logger']
|
|
||||||
self._reportLogger = context['report_logger']
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def list():
|
|
||||||
basePath = os.path.dirname(__file__)
|
|
||||||
return [os.path.basename(p)[9:-3]
|
|
||||||
for p
|
|
||||||
in glob.glob(f"{ basePath }/disposition_*.py", recursive = True)
|
|
||||||
if p != __file__]
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def getClassReference(identifier):
|
|
||||||
importlib.import_module(f"ffx.test.disposition_{ identifier }")
|
|
||||||
for name, obj in inspect.getmembers(sys.modules[f"ffx.test.disposition_{ identifier }"]):
|
|
||||||
#HINT: Excluding Disposition as it seems to be included by import (?)
|
|
||||||
if inspect.isclass(obj) and name != 'Disposition' and name.startswith('Disposition'):
|
|
||||||
return obj
|
|
||||||
24
bin/ffx/test/disposition_combination_2.py
Normal file
24
bin/ffx/test/disposition_combination_2.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
class DispositionCombination2():
|
||||||
|
|
||||||
|
def __init__(self, context = None):
|
||||||
|
self._context = context
|
||||||
|
self._logger = context['logger']
|
||||||
|
self._reportLogger = context['report_logger']
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def list():
|
||||||
|
basePath = os.path.dirname(__file__)
|
||||||
|
return [os.path.basename(p)[26:-3]
|
||||||
|
for p
|
||||||
|
in glob.glob(f"{ basePath }/disposition_combination_2_*.py", recursive = True)
|
||||||
|
if p != __file__]
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def getClassReference(identifier):
|
||||||
|
importlib.import_module(f"ffx.test.disposition_combination_2_{ identifier }")
|
||||||
|
for name, obj in inspect.getmembers(sys.modules[f"ffx.test.disposition_combination_2_{ identifier }"]):
|
||||||
|
#HINT: Excluding DispositionCombination as it seems to be included by import (?)
|
||||||
|
if inspect.isclass(obj) and name != 'DispositionCombination2' and name.startswith('DispositionCombination2'):
|
||||||
|
return obj
|
||||||
21
bin/ffx/test/disposition_combination_2_0.py
Normal file
21
bin/ffx/test/disposition_combination_2_0.py
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
from .disposition_combination_2 import DispositionCombination2
|
||||||
|
|
||||||
|
|
||||||
|
class DispositionCombination20(DispositionCombination2):
|
||||||
|
|
||||||
|
def __init__(self, context):
|
||||||
|
super().__init__(context)
|
||||||
|
|
||||||
|
def getDispositionTuple(self):
|
||||||
|
return (set(), # 0
|
||||||
|
set()) # 1
|
||||||
|
|
||||||
|
def evaluateTrackDescriptors(self, trackDescriptors):
|
||||||
|
assert not trackDescriptors[0].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #0 has set default disposition"
|
||||||
|
assert not trackDescriptors[1].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #1 has set default disposition"
|
||||||
|
|
||||||
|
def shouldFail(self):
|
||||||
|
return False
|
||||||
25
bin/ffx/test/disposition_combination_2_1.py
Normal file
25
bin/ffx/test/disposition_combination_2_1.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
from .disposition_combination_2 import DispositionCombination2
|
||||||
|
|
||||||
|
|
||||||
|
class DispositionCombination21(DispositionCombination2):
|
||||||
|
|
||||||
|
def __init__(self, context):
|
||||||
|
super().__init__(context)
|
||||||
|
|
||||||
|
def getDispositionTuple(self):
|
||||||
|
return (set([TrackDisposition.DEFAULT]), # 0
|
||||||
|
set()) # 1
|
||||||
|
|
||||||
|
def evaluateTrackDescriptors(self, trackDescriptors):
|
||||||
|
if self._context['use_jellyfin']:
|
||||||
|
assert not trackDescriptors[0].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #0 has set default disposition"
|
||||||
|
assert trackDescriptors[1].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #1 has not set default disposition"
|
||||||
|
else:
|
||||||
|
assert trackDescriptors[0].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #0 has not set default disposition"
|
||||||
|
assert not trackDescriptors[1].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #1 has set default disposition"
|
||||||
|
|
||||||
|
def shouldFail(self):
|
||||||
|
return False
|
||||||
21
bin/ffx/test/disposition_combination_2_2.py
Normal file
21
bin/ffx/test/disposition_combination_2_2.py
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
from .disposition_combination_2 import DispositionCombination2
|
||||||
|
|
||||||
|
|
||||||
|
class DispositionCombination22(DispositionCombination2):
|
||||||
|
|
||||||
|
def __init__(self, context):
|
||||||
|
super().__init__(context)
|
||||||
|
|
||||||
|
def getDispositionTuple(self):
|
||||||
|
return (set(), # 0
|
||||||
|
set([TrackDisposition.DEFAULT])) # 1
|
||||||
|
|
||||||
|
def evaluateTrackDescriptors(self, trackDescriptors):
|
||||||
|
assert trackDescriptors[0].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #0 has set default disposition"
|
||||||
|
assert not trackDescriptors[1].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #1 has not set default disposition"
|
||||||
|
|
||||||
|
def shouldFail(self):
|
||||||
|
return False
|
||||||
20
bin/ffx/test/disposition_combination_2_3.py
Normal file
20
bin/ffx/test/disposition_combination_2_3.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
from .disposition_combination_2 import DispositionCombination2
|
||||||
|
|
||||||
|
|
||||||
|
class DispositionCombination23(DispositionCombination2):
|
||||||
|
|
||||||
|
def __init__(self, context):
|
||||||
|
super().__init__(context)
|
||||||
|
|
||||||
|
def getDispositionTuple(self):
|
||||||
|
return (set([TrackDisposition.DEFAULT]), # 0
|
||||||
|
set([TrackDisposition.DEFAULT])) # 1
|
||||||
|
|
||||||
|
def evaluateTrackDescriptors(self, trackDescriptors):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def shouldFail(self):
|
||||||
|
return True
|
||||||
24
bin/ffx/test/disposition_combination_3.py
Normal file
24
bin/ffx/test/disposition_combination_3.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
class DispositionCombination3():
|
||||||
|
|
||||||
|
def __init__(self, context = None):
|
||||||
|
self._context = context
|
||||||
|
self._logger = context['logger']
|
||||||
|
self._reportLogger = context['report_logger']
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def list():
|
||||||
|
basePath = os.path.dirname(__file__)
|
||||||
|
return [os.path.basename(p)[26:-3]
|
||||||
|
for p
|
||||||
|
in glob.glob(f"{ basePath }/disposition_combination_3_*.py", recursive = True)
|
||||||
|
if p != __file__]
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def getClassReference(identifier):
|
||||||
|
importlib.import_module(f"ffx.test.disposition_combination_3_{ identifier }")
|
||||||
|
for name, obj in inspect.getmembers(sys.modules[f"ffx.test.disposition_combination_3_{ identifier }"]):
|
||||||
|
#HINT: Excluding DispositionCombination as it seems to be included by import (?)
|
||||||
|
if inspect.isclass(obj) and name != 'DispositionCombination3' and name.startswith('DispositionCombination3'):
|
||||||
|
return obj
|
||||||
23
bin/ffx/test/disposition_combination_3_0.py
Normal file
23
bin/ffx/test/disposition_combination_3_0.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
from .disposition_combination_3 import DispositionCombination3
|
||||||
|
|
||||||
|
|
||||||
|
class DispositionCombination30(DispositionCombination3):
|
||||||
|
|
||||||
|
def __init__(self, context):
|
||||||
|
super().__init__(context)
|
||||||
|
|
||||||
|
def getDispositionTuple(self):
|
||||||
|
return (set(), # 0
|
||||||
|
set(), # 1
|
||||||
|
set()) # 2
|
||||||
|
|
||||||
|
def evaluateTrackDescriptors(self, trackDescriptors):
|
||||||
|
assert not trackDescriptors[0].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #0 has set default disposition"
|
||||||
|
assert not trackDescriptors[1].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #1 has set default disposition"
|
||||||
|
assert not trackDescriptors[2].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #2 has set default disposition"
|
||||||
|
|
||||||
|
def shouldFail(self):
|
||||||
|
return False
|
||||||
28
bin/ffx/test/disposition_combination_3_1.py
Normal file
28
bin/ffx/test/disposition_combination_3_1.py
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
from .disposition_combination_3 import DispositionCombination3
|
||||||
|
|
||||||
|
|
||||||
|
class DispositionCombination31(DispositionCombination3):
|
||||||
|
|
||||||
|
def __init__(self, context):
|
||||||
|
super().__init__(context)
|
||||||
|
|
||||||
|
def getDispositionTuple(self):
|
||||||
|
return (set([TrackDisposition.DEFAULT]), # 0
|
||||||
|
set(), # 1
|
||||||
|
set()) # 2
|
||||||
|
|
||||||
|
def evaluateTrackDescriptors(self, trackDescriptors):
|
||||||
|
if self._context['use_jellyfin']:
|
||||||
|
assert not trackDescriptors[0].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #0 has set default disposition"
|
||||||
|
assert not trackDescriptors[1].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #1 has set default disposition"
|
||||||
|
assert trackDescriptors[2].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #2 has not set default disposition"
|
||||||
|
else:
|
||||||
|
assert trackDescriptors[0].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #0 has not set default disposition"
|
||||||
|
assert not trackDescriptors[1].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #1 has set default disposition"
|
||||||
|
assert not trackDescriptors[2].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #2 has set default disposition"
|
||||||
|
|
||||||
|
def shouldFail(self):
|
||||||
|
return False
|
||||||
28
bin/ffx/test/disposition_combination_3_2.py
Normal file
28
bin/ffx/test/disposition_combination_3_2.py
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
from .disposition_combination_3 import DispositionCombination3
|
||||||
|
|
||||||
|
|
||||||
|
class DispositionCombination32(DispositionCombination3):
|
||||||
|
|
||||||
|
def __init__(self, context):
|
||||||
|
super().__init__(context)
|
||||||
|
|
||||||
|
def getDispositionTuple(self):
|
||||||
|
return (set(), # 0
|
||||||
|
set([TrackDisposition.DEFAULT]), # 1
|
||||||
|
set()) # 2
|
||||||
|
|
||||||
|
def evaluateTrackDescriptors(self, trackDescriptors):
|
||||||
|
if self._context['use_jellyfin']:
|
||||||
|
assert not trackDescriptors[0].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #0 has set default disposition"
|
||||||
|
assert not trackDescriptors[1].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #1 has set default disposition"
|
||||||
|
assert trackDescriptors[2].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #2 has not set default disposition"
|
||||||
|
else:
|
||||||
|
assert not trackDescriptors[0].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #0 has set default disposition"
|
||||||
|
assert trackDescriptors[1].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #1 has not set default disposition"
|
||||||
|
assert not trackDescriptors[2].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #2 has set default disposition"
|
||||||
|
|
||||||
|
def shouldFail(self):
|
||||||
|
return False
|
||||||
24
bin/ffx/test/disposition_combination_3_3.py
Normal file
24
bin/ffx/test/disposition_combination_3_3.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
from .disposition_combination_3 import DispositionCombination3
|
||||||
|
|
||||||
|
|
||||||
|
class DispositionCombination33(DispositionCombination3):
|
||||||
|
|
||||||
|
def __init__(self, context):
|
||||||
|
super().__init__(context)
|
||||||
|
|
||||||
|
def getDispositionTuple(self):
|
||||||
|
return (set(), # 0
|
||||||
|
set(), # 1
|
||||||
|
set([TrackDisposition.DEFAULT])) # 2
|
||||||
|
|
||||||
|
def evaluateTrackDescriptors(self, trackDescriptors):
|
||||||
|
if self._context['use_jellyfin']:
|
||||||
|
assert not trackDescriptors[0].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #0 has set default disposition"
|
||||||
|
assert not trackDescriptors[1].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #1 has set default disposition"
|
||||||
|
assert trackDescriptors[2].getDispositionFlag(TrackDisposition.DEFAULT), f"Stream #2 has not set default disposition"
|
||||||
|
|
||||||
|
def shouldFail(self):
|
||||||
|
return False
|
||||||
21
bin/ffx/test/disposition_combination_3_4.py
Normal file
21
bin/ffx/test/disposition_combination_3_4.py
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
from .disposition_combination_3 import DispositionCombination3
|
||||||
|
|
||||||
|
|
||||||
|
class DispositionCombination34(DispositionCombination3):
|
||||||
|
|
||||||
|
def __init__(self, context):
|
||||||
|
super().__init__(context)
|
||||||
|
|
||||||
|
def getDispositionTuple(self):
|
||||||
|
return (set([TrackDisposition.DEFAULT]), # 0
|
||||||
|
set(), # 1
|
||||||
|
set([TrackDisposition.DEFAULT])) # 2
|
||||||
|
|
||||||
|
def evaluateTrackDescriptors(self, trackDescriptors):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def shouldFail(self):
|
||||||
|
return True
|
||||||
@@ -4,6 +4,85 @@ from ffx.test.helper import createEmptyDirectory
|
|||||||
|
|
||||||
|
|
||||||
class Scenario():
|
class Scenario():
|
||||||
|
"""Scenarios
|
||||||
|
|
||||||
|
Scenario1: Jellyfin, MediaTags, Stream-Kombinationen, Dispositions und StreamTags per Kombinatoren
|
||||||
|
|
||||||
|
Scenario2: <pattern> mit 3 Files x Scenario1
|
||||||
|
|
||||||
|
Scenario3: <tmdb+pattern> mit 3 Files (wenn TMDB API Key verfügbar)
|
||||||
|
|
||||||
|
Naming:
|
||||||
|
|
||||||
|
1: test.mkv no tmdb, no pattern
|
||||||
|
2: test_s01e02.mkv
|
||||||
|
|
||||||
|
Operationen:
|
||||||
|
|
||||||
|
tmdb lookup: Set Showname as prefix, append episode name
|
||||||
|
pattern lookup: Set/update tags/dispositions; Filter/Reorder Tracks
|
||||||
|
jellyfin reordering: default track last (2)
|
||||||
|
|
||||||
|
MediaTag-Kombinationen (2)
|
||||||
|
|
||||||
|
0: nichs
|
||||||
|
1: Yolo=Holo
|
||||||
|
|
||||||
|
Stream-Kombinationen (8)
|
||||||
|
|
||||||
|
VA D=1 T=1 =1
|
||||||
|
VAS D=1 T=1 =1
|
||||||
|
VASS D=4 T=4 =16
|
||||||
|
VASSS D=5 T=5 =25
|
||||||
|
VAA D=4 T=4 =16
|
||||||
|
VAAS D=4 T=4 =16
|
||||||
|
VAASS D=16 T=16 =256
|
||||||
|
VAASSS D=20 T=20 =400
|
||||||
|
=731
|
||||||
|
|
||||||
|
Dispositions-Kombinationen (per TrackType)
|
||||||
|
|
||||||
|
0 = keine
|
||||||
|
1 = DEFAULT
|
||||||
|
|
||||||
|
2 Streams (4):
|
||||||
|
|
||||||
|
D1: 00
|
||||||
|
D2: 01
|
||||||
|
D3: 10
|
||||||
|
D4: 11
|
||||||
|
|
||||||
|
3 Streams (5):
|
||||||
|
|
||||||
|
D5: 000
|
||||||
|
D6: 001
|
||||||
|
D7: 010
|
||||||
|
D8: 100
|
||||||
|
D9: 101
|
||||||
|
|
||||||
|
Stream-Tag-Kombinationen (per TrackType)
|
||||||
|
|
||||||
|
0 = keine
|
||||||
|
1 = lang+title
|
||||||
|
|
||||||
|
2 Streams:
|
||||||
|
|
||||||
|
00
|
||||||
|
01
|
||||||
|
10
|
||||||
|
11
|
||||||
|
|
||||||
|
3 Streams:
|
||||||
|
|
||||||
|
000
|
||||||
|
001
|
||||||
|
010
|
||||||
|
100
|
||||||
|
101
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, context = None):
|
def __init__(self, context = None):
|
||||||
self._context = context
|
self._context = context
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ from ffx.track_descriptor import TrackDescriptor
|
|||||||
from ffx.track_type import TrackType
|
from ffx.track_type import TrackType
|
||||||
from ffx.track_disposition import TrackDisposition
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
|
||||||
|
from ffx.test.track_combination import TrackCombination
|
||||||
|
|
||||||
|
|
||||||
class Scenario1(Scenario):
|
class Scenario1(Scenario):
|
||||||
"""Creating file VAa, h264/aac/aac
|
"""Creating file VAa, h264/aac/aac
|
||||||
@@ -24,6 +26,92 @@ class Scenario1(Scenario):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
||||||
|
# TrackCombinations -> asserts
|
||||||
|
# * Dispositions[2] -> asserts[2]
|
||||||
|
# * Tags[2] -> asserts[2]
|
||||||
|
# * MediaTags -> asserts
|
||||||
|
|
||||||
|
for tci in TrackCombination.list():
|
||||||
|
combinationContext = self._context.copy()
|
||||||
|
combinationContext['use_jellyfin'] = False
|
||||||
|
combinationContext['use_tmdb'] = False
|
||||||
|
combinationContext['use_pattern'] = False
|
||||||
|
trackCombination = TrackCombination.getClassReference(tci)(combinationContext)
|
||||||
|
|
||||||
|
subcombinations = trackCombination.getSubcombinations()
|
||||||
|
if not subcombinations is None:
|
||||||
|
for trackDescriptors, evaluateFunc, shouldFail in subcombinations:
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[MediaDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[MediaDescriptor.TRACK_DESCRIPTOR_LIST_KEY] = trackDescriptors
|
||||||
|
sourceMediaDescriptor = MediaDescriptor(**kwargs)
|
||||||
|
sourceMediaDescriptor.reindexSubIndices()
|
||||||
|
|
||||||
|
# Phase 1: Setup source files
|
||||||
|
mediaFilePath = createMediaTestFile(mediaDescriptor=sourceMediaDescriptor, directory=self._testDirectory)
|
||||||
|
|
||||||
|
# Phase 2: Prepare database
|
||||||
|
|
||||||
|
# Phase 3: Run ffx
|
||||||
|
commandSequence = [sys.executable,
|
||||||
|
self._ffxExecutablePath,
|
||||||
|
'--no-prompt',
|
||||||
|
'convert',
|
||||||
|
mediaFilePath]
|
||||||
|
|
||||||
|
self._logger.debug(f"Scenario1.run(): sub={trackCombination.getIdentifier()} test sequence: {commandSequence}")
|
||||||
|
|
||||||
|
out, err, rc = executeProcess(commandSequence, directory = self._testDirectory)
|
||||||
|
|
||||||
|
self._logger.debug(f"Scenario1.run(): sub={trackCombination.getIdentifier()} process returned: {rc}")
|
||||||
|
|
||||||
|
# if out:
|
||||||
|
# self._logger.debug(f"Scenario1.run(): process output: {out}")
|
||||||
|
# if rc:
|
||||||
|
# self._logger.error(f"Scenario1.run(): process resultet in error {rc}: {err}")
|
||||||
|
|
||||||
|
# Phase 4: Evaluate results
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
|
if rc:
|
||||||
|
# Stuck with prompt: More than one default subtitle stream detected! Please select stream:
|
||||||
|
# TODO: Catch prompt is add option to fail at prompt
|
||||||
|
assert shouldFail, "ffmpeg run didn't fail"
|
||||||
|
else:
|
||||||
|
|
||||||
|
resultFile = os.path.join(self._testDirectory, 'media.webm')
|
||||||
|
|
||||||
|
assert os.path.isfile(resultFile), f"Result file 'media.webm' in path '{self._testDirectory}' wasn't created"
|
||||||
|
|
||||||
|
resultFileProperties = FileProperties(self._context, resultFile)
|
||||||
|
resultMediaDescriptor = resultFileProperties.getMediaDescriptor()
|
||||||
|
|
||||||
|
resultMediaTracks = resultMediaDescriptor.getAllTrackDescriptors()
|
||||||
|
|
||||||
|
assert len(resultMediaTracks) == len(trackDescriptors), f"Result file contains unexpected number of streams"
|
||||||
|
|
||||||
|
# assert resultMediaTracks[0].getType() == TrackType.VIDEO, f"Stream #0 is not of type video"
|
||||||
|
|
||||||
|
# assert resultMediaTracks[1].getType() == TrackType.AUDIO, f"Stream #1 is not of type audio"
|
||||||
|
|
||||||
|
# assert resultMediaTracks[2].getType() == TrackType.AUDIO, f"Stream #2 is not of type audio"
|
||||||
|
|
||||||
|
# assert dispositions
|
||||||
|
evaluateFunc(resultMediaTracks)
|
||||||
|
|
||||||
|
self._reportLogger.info('Scenario 1 test passed')
|
||||||
|
|
||||||
|
except AssertionError as ae:
|
||||||
|
|
||||||
|
self._reportLogger.error(f"Scenario 1 test failed ({ae})")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def job(self):
|
||||||
|
|
||||||
self._logger.info(f"Running {self.__class__.__name__}")
|
self._logger.info(f"Running {self.__class__.__name__}")
|
||||||
|
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
|
|||||||
27
bin/ffx/test/track_combination.py
Normal file
27
bin/ffx/test/track_combination.py
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
class TrackCombination():
|
||||||
|
|
||||||
|
def __init__(self, context = None):
|
||||||
|
self._context = context
|
||||||
|
self._logger = context['logger']
|
||||||
|
self._reportLogger = context['report_logger']
|
||||||
|
|
||||||
|
def getIdentifier(self):
|
||||||
|
return self._combinationIdentifier
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def list():
|
||||||
|
basePath = os.path.dirname(__file__)
|
||||||
|
return [os.path.basename(p)[18:-3]
|
||||||
|
for p
|
||||||
|
in glob.glob(f"{ basePath }/track_combination_*.py", recursive = True)
|
||||||
|
if p != __file__]
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def getClassReference(identifier):
|
||||||
|
importlib.import_module(f"ffx.test.track_combination_{ identifier }")
|
||||||
|
for name, obj in inspect.getmembers(sys.modules[f"ffx.test.track_combination_{ identifier }"]):
|
||||||
|
#HINT: Excluding DispositionCombination as it seems to be included by import (?)
|
||||||
|
if inspect.isclass(obj) and name != 'TrackCombination' and name.startswith('TrackCombination'):
|
||||||
|
return obj
|
||||||
36
bin/ffx/test/track_combination_0.py
Normal file
36
bin/ffx/test/track_combination_0.py
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
from ffx.track_descriptor import TrackDescriptor
|
||||||
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
from ffx.track_type import TrackType
|
||||||
|
|
||||||
|
from .track_combination import TrackCombination
|
||||||
|
|
||||||
|
|
||||||
|
class TrackCombination0(TrackCombination):
|
||||||
|
|
||||||
|
COMBINATION_IDENTIFIER = 'VA'
|
||||||
|
|
||||||
|
def __init__(self, context):
|
||||||
|
super().__init__(context)
|
||||||
|
self._combinationIdentifier = TrackCombination0.COMBINATION_IDENTIFIER
|
||||||
|
|
||||||
|
def getTrackVector(self):
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.VIDEO
|
||||||
|
# kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = set([TrackDisposition.DEFAULT])
|
||||||
|
trackDescriptor0 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.AUDIO
|
||||||
|
# kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = set([TrackDisposition.DEFAULT])
|
||||||
|
trackDescriptor1 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
return [trackDescriptor0,
|
||||||
|
trackDescriptor1]
|
||||||
|
|
||||||
|
def getSubcombinations(self):
|
||||||
|
return
|
||||||
42
bin/ffx/test/track_combination_1.py
Normal file
42
bin/ffx/test/track_combination_1.py
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
from ffx.track_descriptor import TrackDescriptor
|
||||||
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
from ffx.track_type import TrackType
|
||||||
|
|
||||||
|
from .track_combination import TrackCombination
|
||||||
|
|
||||||
|
|
||||||
|
class TrackCombination1(TrackCombination):
|
||||||
|
|
||||||
|
COMBINATION_IDENTIFIER = 'VAS'
|
||||||
|
|
||||||
|
def __init__(self, context):
|
||||||
|
super().__init__(context)
|
||||||
|
self._combinationIdentifier = TrackCombination1.COMBINATION_IDENTIFIER
|
||||||
|
|
||||||
|
def getTrackVector(self):
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.VIDEO
|
||||||
|
# kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = set([TrackDisposition.DEFAULT])
|
||||||
|
trackDescriptor0 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.AUDIO
|
||||||
|
# kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = set([TrackDisposition.DEFAULT])
|
||||||
|
trackDescriptor1 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.SUBTITLE
|
||||||
|
trackDescriptor2 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
return [trackDescriptor0,
|
||||||
|
trackDescriptor1,
|
||||||
|
trackDescriptor2]
|
||||||
|
|
||||||
|
def getSubcombinations(self):
|
||||||
|
return
|
||||||
48
bin/ffx/test/track_combination_2.py
Normal file
48
bin/ffx/test/track_combination_2.py
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
from ffx.track_descriptor import TrackDescriptor
|
||||||
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
from ffx.track_type import TrackType
|
||||||
|
|
||||||
|
from .track_combination import TrackCombination
|
||||||
|
|
||||||
|
|
||||||
|
class TrackCombination1(TrackCombination):
|
||||||
|
|
||||||
|
COMBINATION_IDENTIFIER = 'VASS'
|
||||||
|
|
||||||
|
def __init__(self, context):
|
||||||
|
super().__init__(context)
|
||||||
|
self._combinationIdentifier = TrackCombination1.COMBINATION_IDENTIFIER
|
||||||
|
|
||||||
|
def getTrackVector(self):
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.VIDEO
|
||||||
|
# kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = set([TrackDisposition.DEFAULT])
|
||||||
|
trackDescriptor0 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.AUDIO
|
||||||
|
# kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = set([TrackDisposition.DEFAULT])
|
||||||
|
trackDescriptor1 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.SUBTITLE
|
||||||
|
trackDescriptor2 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.SUBTITLE
|
||||||
|
trackDescriptor3 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
return [trackDescriptor0,
|
||||||
|
trackDescriptor1,
|
||||||
|
trackDescriptor2,
|
||||||
|
trackDescriptor3]
|
||||||
|
|
||||||
|
def getSubcombinations(self):
|
||||||
|
return
|
||||||
64
bin/ffx/test/track_combination_3.py
Normal file
64
bin/ffx/test/track_combination_3.py
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
from ffx.track_descriptor import TrackDescriptor
|
||||||
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
from ffx.track_type import TrackType
|
||||||
|
|
||||||
|
from .track_combination import TrackCombination
|
||||||
|
from .disposition_combination_3 import DispositionCombination3
|
||||||
|
|
||||||
|
|
||||||
|
class TrackCombination3(TrackCombination):
|
||||||
|
|
||||||
|
COMBINATION_IDENTIFIER = 'VASSS'
|
||||||
|
|
||||||
|
def __init__(self, context):
|
||||||
|
super().__init__(context)
|
||||||
|
self._combinationIdentifier = TrackCombination3.COMBINATION_IDENTIFIER
|
||||||
|
|
||||||
|
def getTrackDescriptors(self, dispositionTuple):
|
||||||
|
|
||||||
|
self._logger.debug(f"getTrackDescriptors(): dispositionTuple={dispositionTuple}")
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.VIDEO
|
||||||
|
trackDescriptor0 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.AUDIO
|
||||||
|
trackDescriptor1 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.SUBTITLE
|
||||||
|
kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = dispositionTuple[0]
|
||||||
|
trackDescriptor2 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.SUBTITLE
|
||||||
|
kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = dispositionTuple[1]
|
||||||
|
trackDescriptor3 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.SUBTITLE
|
||||||
|
kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = dispositionTuple[2]
|
||||||
|
trackDescriptor4 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
return [trackDescriptor0,
|
||||||
|
trackDescriptor1,
|
||||||
|
trackDescriptor2,
|
||||||
|
trackDescriptor3,
|
||||||
|
trackDescriptor4]
|
||||||
|
|
||||||
|
def getSubcombinations(self):
|
||||||
|
for dci in DispositionCombination3.list():
|
||||||
|
dispositionCombination = DispositionCombination3.getClassReference(dci)(self._context)
|
||||||
|
dispositionTuple = dispositionCombination.getDispositionTuple() # tuple of set of dispositions
|
||||||
|
trackDescriptors = self.getTrackDescriptors(dispositionTuple)
|
||||||
|
evaluateFunc = dispositionCombination.evaluateTrackDescriptors # assert function
|
||||||
|
shouldFail = dispositionCombination.shouldFail() # true if this combination should fail
|
||||||
|
yield (trackDescriptors, evaluateFunc, shouldFail)
|
||||||
42
bin/ffx/test/track_combination_4.py
Normal file
42
bin/ffx/test/track_combination_4.py
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
from ffx.track_descriptor import TrackDescriptor
|
||||||
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
from ffx.track_type import TrackType
|
||||||
|
|
||||||
|
from .track_combination import TrackCombination
|
||||||
|
|
||||||
|
|
||||||
|
class TrackCombination4(TrackCombination):
|
||||||
|
|
||||||
|
COMBINATION_IDENTIFIER = 'VAA'
|
||||||
|
|
||||||
|
def __init__(self, context):
|
||||||
|
super().__init__(context)
|
||||||
|
self._combinationIdentifier = TrackCombination4.COMBINATION_IDENTIFIER
|
||||||
|
|
||||||
|
def getTrackVector(self):
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.VIDEO
|
||||||
|
# kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = set([TrackDisposition.DEFAULT])
|
||||||
|
trackDescriptor0 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.AUDIO
|
||||||
|
# kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = set([TrackDisposition.DEFAULT])
|
||||||
|
trackDescriptor1 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.AUDIO
|
||||||
|
trackDescriptor2 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
return [trackDescriptor0,
|
||||||
|
trackDescriptor1,
|
||||||
|
trackDescriptor2]
|
||||||
|
|
||||||
|
def getSubcombinations(self):
|
||||||
|
return
|
||||||
48
bin/ffx/test/track_combination_5.py
Normal file
48
bin/ffx/test/track_combination_5.py
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
from ffx.track_descriptor import TrackDescriptor
|
||||||
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
from ffx.track_type import TrackType
|
||||||
|
|
||||||
|
from .track_combination import TrackCombination
|
||||||
|
|
||||||
|
|
||||||
|
class TrackCombination5(TrackCombination):
|
||||||
|
|
||||||
|
COMBINATION_IDENTIFIER = 'VAAS'
|
||||||
|
|
||||||
|
def __init__(self, context):
|
||||||
|
super().__init__(context)
|
||||||
|
self._combinationIdentifier = TrackCombination5.COMBINATION_IDENTIFIER
|
||||||
|
|
||||||
|
def getTrackVector(self):
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.VIDEO
|
||||||
|
# kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = set([TrackDisposition.DEFAULT])
|
||||||
|
trackDescriptor0 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.AUDIO
|
||||||
|
# kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = set([TrackDisposition.DEFAULT])
|
||||||
|
trackDescriptor1 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.AUDIO
|
||||||
|
trackDescriptor2 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.SUBTITLE
|
||||||
|
trackDescriptor3 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
return [trackDescriptor0,
|
||||||
|
trackDescriptor1,
|
||||||
|
trackDescriptor2,
|
||||||
|
trackDescriptor3]
|
||||||
|
|
||||||
|
def getSubcombinations(self):
|
||||||
|
return
|
||||||
54
bin/ffx/test/track_combination_6.py
Normal file
54
bin/ffx/test/track_combination_6.py
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
from ffx.track_descriptor import TrackDescriptor
|
||||||
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
from ffx.track_type import TrackType
|
||||||
|
|
||||||
|
from .track_combination import TrackCombination
|
||||||
|
|
||||||
|
|
||||||
|
class TrackCombination6(TrackCombination):
|
||||||
|
|
||||||
|
COMBINATION_IDENTIFIER = 'VAASS'
|
||||||
|
|
||||||
|
def __init__(self, context):
|
||||||
|
super().__init__(context)
|
||||||
|
self._combinationIdentifier = TrackCombination6.COMBINATION_IDENTIFIER
|
||||||
|
|
||||||
|
def getTrackVector(self):
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.VIDEO
|
||||||
|
# kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = set([TrackDisposition.DEFAULT])
|
||||||
|
trackDescriptor0 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.AUDIO
|
||||||
|
# kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = set([TrackDisposition.DEFAULT])
|
||||||
|
trackDescriptor1 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.AUDIO
|
||||||
|
trackDescriptor2 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.SUBTITLE
|
||||||
|
trackDescriptor3 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.SUBTITLE
|
||||||
|
trackDescriptor4 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
return [trackDescriptor0,
|
||||||
|
trackDescriptor1,
|
||||||
|
trackDescriptor2,
|
||||||
|
trackDescriptor3,
|
||||||
|
trackDescriptor4]
|
||||||
|
|
||||||
|
def getSubcombinations(self):
|
||||||
|
return
|
||||||
62
bin/ffx/test/track_combination_7.py
Normal file
62
bin/ffx/test/track_combination_7.py
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
import os, sys, importlib, glob, inspect
|
||||||
|
|
||||||
|
from ffx.track_descriptor import TrackDescriptor
|
||||||
|
from ffx.track_disposition import TrackDisposition
|
||||||
|
from ffx.track_type import TrackType
|
||||||
|
|
||||||
|
from .track_combination import TrackCombination
|
||||||
|
|
||||||
|
|
||||||
|
class TrackCombination7(TrackCombination):
|
||||||
|
"""VAASSS"""
|
||||||
|
|
||||||
|
COMBINATION_IDENTIFIER = 'VAASSS'
|
||||||
|
|
||||||
|
def __init__(self, context):
|
||||||
|
super().__init__(context)
|
||||||
|
self._combinationIdentifier = TrackCombination7.COMBINATION_IDENTIFIER
|
||||||
|
|
||||||
|
def getTrackVector(self):
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.VIDEO
|
||||||
|
# kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = set([TrackDisposition.DEFAULT])
|
||||||
|
trackDescriptor0 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.AUDIO
|
||||||
|
# kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = set([TrackDisposition.DEFAULT])
|
||||||
|
trackDescriptor1 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.AUDIO
|
||||||
|
# kwargs[TrackDescriptor.DISPOSITION_SET_KEY] = set([TrackDisposition.DEFAULT])
|
||||||
|
trackDescriptor2 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.SUBTITLE
|
||||||
|
trackDescriptor3 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.SUBTITLE
|
||||||
|
trackDescriptor4 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
kwargs = {}
|
||||||
|
kwargs[TrackDescriptor.CONTEXT_KEY] = self._context
|
||||||
|
kwargs[TrackDescriptor.TRACK_TYPE_KEY] = TrackType.SUBTITLE
|
||||||
|
trackDescriptor5 = TrackDescriptor(**kwargs)
|
||||||
|
|
||||||
|
return [trackDescriptor0,
|
||||||
|
trackDescriptor1,
|
||||||
|
trackDescriptor2,
|
||||||
|
trackDescriptor3,
|
||||||
|
trackDescriptor4,
|
||||||
|
trackDescriptor5]
|
||||||
|
|
||||||
|
def getSubcombinations(self):
|
||||||
|
return
|
||||||
@@ -50,7 +50,8 @@ def ffx(ctx, verbose, dry_run):
|
|||||||
ffxConsoleHandler = logging.StreamHandler()
|
ffxConsoleHandler = logging.StreamHandler()
|
||||||
ffxConsoleHandler.setLevel(consoleLogVerbosity)
|
ffxConsoleHandler.setLevel(consoleLogVerbosity)
|
||||||
|
|
||||||
os.unlink('ffx_test_report.log')
|
if os.path.isfile('ffx_test_report.log'):
|
||||||
|
os.unlink('ffx_test_report.log')
|
||||||
ffxTestReportFileHandler = logging.FileHandler('ffx_test_report.log')
|
ffxTestReportFileHandler = logging.FileHandler('ffx_test_report.log')
|
||||||
|
|
||||||
fileFormatter = logging.Formatter(
|
fileFormatter = logging.Formatter(
|
||||||
|
|||||||
Reference in New Issue
Block a user