Improved handling for paths and added tests for it

This commit is contained in:
Rudi Grinberg 2012-10-12 15:54:38 -04:00
parent cefc5c99d9
commit ff8969efb9
4 changed files with 15 additions and 6 deletions

View file

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from contextlib import contextmanager
from media.monitor.pure import truncate_to_length, toposort
from os.path import normpath
from media.monitor.log import Loggable
import mutagen
@ -139,7 +140,7 @@ def normalize_mutagen(path):
md['bitrate'] = getattr(m.info, 'bitrate', u'')
md['sample_rate'] = getattr(m.info, 'sample_rate', 0)
md['mime'] = m.mime[0] if len(m.mime) > 0 else u''
md['path'] = path
md['path'] = normpath(path)
if 'title' not in md: md['title'] = u''
return md