mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-21 11:05:32 +01:00
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:
@@ -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 """
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user