Skip to content

Commit

Permalink
Merge pull request #508 from venomousZealot/master
Browse files Browse the repository at this point in the history
Use jellyfin's DisplayTitle for audio and subtitle streams
  • Loading branch information
mcarlton00 authored May 1, 2021
2 parents 6f9334f + 97a4498 commit f64b250
Showing 1 changed file with 2 additions and 36 deletions.
38 changes: 2 additions & 36 deletions jellyfin_kodi/helper/playutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,23 +557,6 @@ def download_external_subs(cls, src, filename):

return path

def get_commercial_codec_name(self, codec, profile):
NAMES = {
'ac3': 'Dolby Digital',
'eac3': 'Dolby Digital+',
'truehd': 'Dolby TrueHD',
'dts': 'DTS'
}

if profile == 'DTS-HD MA':
return 'DTS-HD Master Audio'
if profile == 'DTS-HD HRA':
return 'DTS-HD High Resolution Audio'
if codec in NAMES:
return NAMES[codec]

return codec.upper()

def get_audio_subs(self, source, audio=None, subtitle=None):

''' For transcoding only
Expand All @@ -597,14 +580,7 @@ def get_audio_subs(self, source, audio=None, subtitle=None):

if stream_type == 'Audio':

profile = stream['Profile'] if 'Profile' in stream else None
codec = self.get_commercial_codec_name(stream['Codec'], profile)
channel = stream.get('ChannelLayout', "").capitalize()

if 'Language' in stream:
track = "%s - %s %s" % (stream['Language'].capitalize(), codec, channel)
else:
track = "%s %s" % (codec, channel)
track = stream['DisplayTitle']

audio_streams[track] = index

Expand All @@ -617,17 +593,7 @@ def get_audio_subs(self, source, audio=None, subtitle=None):
if not avail_for_extraction and not allow_burned_subs:
continue

codec = self.get_commercial_codec_name(stream['Codec'], None)

if 'Language' in stream:
track = "%s - %s" % (stream['Language'].capitalize(), codec)
else:
track = "%s" % codec

if stream['IsDefault']:
track = "%s - Default" % track
if stream['IsForced']:
track = "%s - Forced" % track
track = stream['DisplayTitle']

subs_streams[track] = index

Expand Down

0 comments on commit f64b250

Please sign in to comment.