Added logging e outputs
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import logging
|
||||
import os
|
||||
from typing import Any
|
||||
|
||||
import magic
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def scan_folder(src: str):
|
||||
for (root, dirs, files) in os.walk(top=src):
|
||||
@@ -12,4 +15,5 @@ def scan_folder(src: str):
|
||||
|
||||
def accepted_file_type(file: Any) -> bool:
|
||||
mime = magic.from_file(file, mime=True)
|
||||
logger.info(f"MIME {mime} for file {file}")
|
||||
return mime in ('audio/mpeg', 'audio/mp3')
|
||||
|
||||
Reference in New Issue
Block a user