def _meta_args(filename, artist, title, album): [year, month, day] = get_year_month_day(filename) args = [ '-id3v2_version', '3', '-write_id3v1', '1', '-metadata', 'artist=' + artist, '-metadata', 'title=' + title, '-metadata', 'album=' + album, '-metadata', 'genre=Speech'] if year: args += ['-metadata', 'date=' + year + '-' + month + '-' + day] args += ['-metadata', 'comment=' + year + '-' + month + '-' + day] return args
def test_get_year_month_day(self): filename = self.get_test_filename('2016-10-07 brmadhusudan.mp4') [year, month, day] = meta.get_year_month_day(filename) self.assertEqual('2016', year) self.assertEqual('10', month) self.assertEqual('07', day)
def meta_args_ru_stereo(filename): artist = get_artist_ru(filename) title = get_title_ru(filename) [year, month, day] = get_year_month_day(filename) return _meta_args(filename, artist, title, 'Гупта Говардхан ' + year)
def _meta_args_en(filename): artist = get_artist_en(filename) title = get_title_en(filename) [year, month, day] = get_year_month_day(filename) return _meta_args(filename, artist, title, album='Gupta Govardhan ' + year)