refactor: Simplify sound file path retrieval by consolidating stream sound handling
This commit is contained in:
@@ -276,21 +276,13 @@ class MusicPlayerService:
|
||||
def _get_sound_file_path(self, sound: Sound) -> Optional[str]:
|
||||
"""Get the file path for a sound, preferring normalized version."""
|
||||
try:
|
||||
if sound.type == "STR":
|
||||
# Stream sounds
|
||||
base_path = "sounds/stream"
|
||||
elif sound.type == "SAY":
|
||||
# Say sounds
|
||||
base_path = "sounds/say"
|
||||
else:
|
||||
# Soundboard sounds
|
||||
base_path = "sounds/soundboard"
|
||||
base_path = "sounds/stream"
|
||||
base_normalized_path = "sounds/normalized/stream"
|
||||
|
||||
# Check for normalized version first
|
||||
if sound.is_normalized and sound.normalized_filename:
|
||||
normalized_path = os.path.join(
|
||||
"sounds/normalized",
|
||||
sound.type.lower(),
|
||||
base_normalized_path,
|
||||
sound.normalized_filename,
|
||||
)
|
||||
if os.path.exists(normalized_path):
|
||||
|
||||
Reference in New Issue
Block a user