Пример #1
0
 def fix_title(path):
     # If we have no title in path we will format it
     # TODO : this is very hacky so make sure to fix it
     m = mutagen.File(path, easy=True)
     if u'title' not in m:
         new_title = unicode( mmp.no_extension_basename(path) )
         m[u'title'] = new_title
         m.save()
Пример #2
0
 def fix_title(path):
     # If we have no title in path we will format it
     # TODO : this is very hacky so make sure to fix it
     m = mutagen.File(path, easy=True)
     if u'title' not in m:
         new_title = unicode( mmp.no_extension_basename(path) )
         m[u'title'] = new_title
         m.save()
Пример #3
0
    def tr_title(k):
        #unicode_unknown = u"unknown"
        new_title = u""
        if is_airtime_recorded(k) or k['title'] != u"":
            new_title = k['title']
        else:
            default_title = no_extension_basename(k['path'])
            default_title = re.sub(r'__\d+\.',u'.', default_title)

            # format is: track_number-title-123kbps.mp3
            m = re.match(".+?-(?P<title>.+)-(\d+kbps|unknown)$", default_title)
            if m: new_title = m.group('title')
            else: new_title = re.sub(r'-\d+kbps$', u'', default_title)

        return new_title
Пример #4
0
    def tr_title(k):
        #unicode_unknown = u"unknown"
        new_title = u""
        if is_airtime_recorded(k) or k['title'] != u"":
            new_title = k['title']
        else:
            default_title = no_extension_basename(k['path'])
            default_title = re.sub(r'__\d+\.', u'.', default_title)

            # format is: track_number-title-123kbps.mp3
            m = re.match(".+?-(?P<title>.+)-(\d+kbps|unknown)$", default_title)
            if m: new_title = m.group('title')
            else: new_title = re.sub(r'-\d+kbps$', u'', default_title)

        return new_title