|
|
|
@ -740,16 +740,33 @@ def convert(ctx,
|
|
|
|
|
targetStreamDescriptor[STREAM_TYPE_SUBTITLE][streamIndex]['tags']['title'] = subtitleTitles[streamIndex]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
click.echo('\nTarget streams:')
|
|
|
|
|
for aStream in targetStreamDescriptor[STREAM_TYPE_AUDIO]:
|
|
|
|
|
click.echo(f"audio stream {aStream['sub_index']} lang={aStream['tags']['language']} title={aStream['tags']['title']} default={aStream['disposition']['default']} forced={aStream['disposition']['forced']}")
|
|
|
|
|
for sStream in targetStreamDescriptor[STREAM_TYPE_SUBTITLE]:
|
|
|
|
|
click.echo(f"subtitle stream {sStream['sub_index']} lang={sStream['tags']['language']} title={sStream['tags']['title']} default={sStream['disposition']['default']} forced={sStream['disposition']['forced']}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
audioStreamSourceOrder = list(range(len(sourceStreamDescriptor[STREAM_TYPE_AUDIO])))
|
|
|
|
|
subtitleStreamSourceOrder = list(range(len(sourceStreamDescriptor[STREAM_TYPE_SUBTITLE])))
|
|
|
|
|
|
|
|
|
|
if jellyfin:
|
|
|
|
|
|
|
|
|
|
defaultTargetAudioStreams = [a for a in targetStreamDescriptor[STREAM_TYPE_AUDIO] if a['disposition']['default'] == 1]
|
|
|
|
|
if defaultTargetAudioStreams:
|
|
|
|
|
audioStreamSourceOrder = getModifiedStreamOrder(len(sourceStreamDescriptor[STREAM_TYPE_AUDIO]), defaultTargetAudioStreams[0]['sub_index'])
|
|
|
|
|
|
|
|
|
|
defaultTargetSubtitleStreams = [a for a in targetStreamDescriptor[STREAM_TYPE_SUBTITLE] if a['disposition']['default'] == 1]
|
|
|
|
|
if defaultTargetSubtitleStreams:
|
|
|
|
|
subtitleStreamSourceOrder = getModifiedStreamOrder(len(sourceStreamDescriptor[STREAM_TYPE_SUBTITLE]), defaultTargetSubtitleStreams[0]['sub_index'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
click.echo(f"Audio stream source order {audioStreamSourceOrder}")
|
|
|
|
|
click.echo(f"Subtitle stream source order {subtitleStreamSourceOrder}")
|
|
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
commandTokens = COMMAND_TOKENS + ['-i', sourcePath]
|
|
|
|
|
|
|
|
|
|
subtitleFileTokens = []
|
|
|
|
|