Skip to content

Commit 958fbef

Browse files
znedwmueslo
authored andcommitted
Add director/s to tags for better grouping. Add support for AC3 format tag 0x2000. Add support for MP42 AKA Microsoft MPEG-4 v2 (pre-standard); see http://doc.gnu-darwin.org/mplayer/encoding.html
1 parent e0bf618 commit 958fbef

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

pythonbits/__main__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ def n_to_p(x): return "--" + x.replace('_', '-')
7474
'help': "Number of screenshots"},
7575
'num_cast': {'type': int, 'default': 10,
7676
'help': "Number of actors to use in tags"},
77+
'num_directors': {'type': int, 'default': 2,
78+
'help': "Number of directors to use in tags"},
7779
'data_method': {'type': str, 'default': 'auto',
7880
'choices': ['hard', 'sym', 'copy', 'move'],
7981
'help': "Data method to use for placing media files"}

pythonbits/bb.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,11 @@ def _render_tags(self):
283283
# todo: get episode-specific actors (from imdb?)
284284

285285
n = self['options']['num_cast']
286+
d = self['options']['num_directors']
286287
tags = list(self['summary']['genres'])
288+
tags += [a['name']
289+
for a in self['summary']['directors'][:d]
290+
if a['name']]
287291
tags += [a['name']
288292
for a in self['summary']['cast'][:n]
289293
if a['name']]
@@ -450,6 +454,8 @@ def _render_video_codec(self):
450454
return 'VP9'
451455
elif video_track['codec_id'] == 'XVID':
452456
return 'XVid'
457+
elif video_track['codec_id'] == 'MP42':
458+
return 'DivX'
453459
elif video_track['format'] == 'MPEG Video':
454460
return 'MPEG-2'
455461
else:
@@ -475,11 +481,12 @@ def _render_audio_codec(self):
475481
if audio_track['codec_id'].startswith('A_'):
476482
audio_track['codec_id'] = audio_track['codec_id'][2:]
477483
audio_codecs = ('AC3', 'EAC3', 'DTS', 'FLAC', 'AAC', 'MP3', 'TRUEHD',
478-
'PCM')
484+
'PCM', '2000')
479485
for c in audio_codecs:
480486
if audio_track['codec_id'].startswith(c):
481487
c = c.replace('EAC3', 'AC-3') \
482488
.replace('AC3', 'AC-3') \
489+
.replace('2000', 'AC-3') \
483490
.replace('TRUEHD', 'True-HD')
484491
return c
485492

0 commit comments

Comments
 (0)