Compare commits
2 Commits
20e65f4c69
...
27e42a4e97
| Author | SHA1 | Date | |
|---|---|---|---|
| 27e42a4e97 | |||
| 1b374b667e |
9
app.py
9
app.py
@ -24,6 +24,7 @@ import auth
|
|||||||
import analytics as a
|
import analytics as a
|
||||||
import folder_secret_config_editor as fsce
|
import folder_secret_config_editor as fsce
|
||||||
import helperfunctions as hf
|
import helperfunctions as hf
|
||||||
|
import fnmatch
|
||||||
|
|
||||||
app_config = auth.return_app_config()
|
app_config = auth.return_app_config()
|
||||||
BASE_DIR = os.path.realpath(app_config['BASE_DIR'])
|
BASE_DIR = os.path.realpath(app_config['BASE_DIR'])
|
||||||
@ -136,7 +137,7 @@ def list_directory_contents(directory, subpath):
|
|||||||
music_exts = ('.mp3',)
|
music_exts = ('.mp3',)
|
||||||
image_exts = ('.jpg', '.jpeg', '.png', '.gif', '.bmp')
|
image_exts = ('.jpg', '.jpeg', '.png', '.gif', '.bmp')
|
||||||
|
|
||||||
blocked_filenames = ['Thumbs.db']
|
blocked_filenames = ['Thumbs.db', '*.mrk']
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with os.scandir(directory) as it:
|
with os.scandir(directory) as it:
|
||||||
@ -146,12 +147,12 @@ def list_directory_contents(directory, subpath):
|
|||||||
if entry.name.startswith('.'):
|
if entry.name.startswith('.'):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Skip blocked_filenames
|
# Skip blocked_filenames using fnmatch for wildcards
|
||||||
if entry.name in blocked_filenames:
|
if any(fnmatch.fnmatch(entry.name, pattern) for pattern in blocked_filenames):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if entry.is_dir(follow_symlinks=False):
|
if entry.is_dir(follow_symlinks=False):
|
||||||
if entry.name in ["Transkription", "@eaDir"]:
|
if entry.name in ["Transkription", "@eaDir", ".ai"]:
|
||||||
continue
|
continue
|
||||||
rel_path = os.path.join(subpath, entry.name) if subpath else entry.name
|
rel_path = os.path.join(subpath, entry.name) if subpath else entry.name
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user