Handle file not found when scanning track
This commit is contained in:
parent
2ce7f671ba
commit
3783996ba4
@ -132,7 +132,11 @@ def get_audio_metadata(filepath: str) -> Dict[str, str | int | float]:
|
|||||||
|
|
||||||
metadata: Dict[str, str | int | float] = {}
|
metadata: Dict[str, str | int | float] = {}
|
||||||
|
|
||||||
|
try:
|
||||||
metadata["mtime"] = os.path.getmtime(filepath)
|
metadata["mtime"] = os.path.getmtime(filepath)
|
||||||
|
except FileNotFoundError:
|
||||||
|
show_warning(None, "File not found", f"Filepath {filepath} not found")
|
||||||
|
return {}
|
||||||
|
|
||||||
# Set start_gap, fade_at and silence_at
|
# Set start_gap, fade_at and silence_at
|
||||||
audio = get_audio_segment(filepath)
|
audio = get_audio_segment(filepath)
|
||||||
@ -200,7 +204,10 @@ def get_tags(path: str) -> Dict[str, Any]:
|
|||||||
Return a dictionary of title, artist, duration-in-milliseconds and path.
|
Return a dictionary of title, artist, duration-in-milliseconds and path.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
try:
|
||||||
tag = TinyTag.get(path)
|
tag = TinyTag.get(path)
|
||||||
|
except FileNotFoundError:
|
||||||
|
return {}
|
||||||
|
|
||||||
return dict(
|
return dict(
|
||||||
title=tag.title,
|
title=tag.title,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user