Added headphones.MEDIA_FORMATS and referenced it in various places. M4A

had been left out in scanMusic. Should just have to change the literal
in the future.
This commit is contained in:
sbuser
2011-08-06 16:12:11 -05:00
parent 91a75a8012
commit b84b9b997e
3 changed files with 5 additions and 4 deletions

View File

@@ -99,6 +99,7 @@ NEWZBIN_PASSWORD = None
LASTFM_USERNAME = None
MEDIA_FORMATS = ["mp3", "flac", "aac", "ogg", "ape", "m4a"]
def CheckSection(sec):
""" Check if INI section exists, if not create it """

View File

@@ -24,7 +24,7 @@ def scanMusic(dir=None):
for r,d,f in os.walk(dir):
for files in f:
if any(files.endswith(x) for x in (".mp3", ".flac", ".aac", ".ogg", ".ape", ".m4a")):
if any(files.endswith('.' + x) for x in headphones.MEDIA_FORMATS):
results.append(os.path.join(r, files))
logger.info(u'%i music files found. Reading metadata....' % len(results))

View File

@@ -113,7 +113,7 @@ def verify(albumid, albumpath):
downloaded_track_list = []
for r,d,f in os.walk(albumpath):
for files in f:
if any(files.endswith(x) for x in (".mp3", ".flac", ".aac", ".ogg", ".ape", ".m4a")):
if any(files.endswith('.' + x) for x in headphones.MEDIA_FORMATS):
downloaded_track_list.append(os.path.join(r, files))
# test #1: metadata - usually works
@@ -240,7 +240,7 @@ def cleanupFiles(albumpath):
logger.info('Cleaning up files')
for r,d,f in os.walk(albumpath):
for files in f:
if not any(files.endswith(x) for x in (".mp3", ".flac", ".aac", ".ogg", ".ape", ".m4a")):
if not any(files.endswith('.' + x) for x in headphones.MEDIA_FORMATS):
logger.debug('Removing: %s' % files)
try:
os.remove(os.path.join(r, files))
@@ -393,7 +393,7 @@ def updateHave(albumpath):
for r,d,f in os.walk(albumpath):
for files in f:
if any(files.endswith(x) for x in (".mp3", ".flac", ".aac", ".ogg", ".ape")):
if any(files.endswith('.' + x) for x in headphones.MEDIA_FORMATS):
results.append(os.path.join(r, files))
if results: