Skip to content
Snippets Groups Projects
Commit 422ad54a authored by ale's avatar ale
Browse files

return file counts

parent a20f1d85
No related branches found
No related tags found
No related merge requests found
......@@ -2,17 +2,23 @@ import os
def recursive_scan(basedir, queue):
n = 0
for root, dirs, files in os.walk(basedir):
for filename in files:
if filename.lower().endswith('.mp3'):
path = os.path.join(root, filename)
queue.put(path)
n += 1
return n
def directory_scan(directory, queue):
n = 0
for filename in os.listdir(directory):
if filename.lower().endswith('.mp3'):
path = os.path.join(directory, filename)
if os.path.isfile(path):
queue.put(path)
n += 1
return n
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment