mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 08:56:10 +00:00
notifications: Fix hash-named duplicate sound files in options.
Our hash-naming of production assets interacted badly with the "look at files in a directory" algorithm used to determine what sound options exist for the "notification sound" feature. For lack of a better solution, we fix this by excluding files with an extra `.` in their name.
This commit is contained in:
@@ -2853,6 +2853,10 @@ def get_available_notification_sounds() -> List[str]:
|
|||||||
|
|
||||||
for file_name in os.listdir(notification_sounds_path):
|
for file_name in os.listdir(notification_sounds_path):
|
||||||
root, ext = os.path.splitext(file_name)
|
root, ext = os.path.splitext(file_name)
|
||||||
|
if '.' in root: # nocoverage
|
||||||
|
# Exclude e.g. zulip.abcd1234.ogg (generated by production hash-naming)
|
||||||
|
# to avoid spurious duplicates.
|
||||||
|
continue
|
||||||
if ext == '.ogg':
|
if ext == '.ogg':
|
||||||
available_notification_sounds.append(root)
|
available_notification_sounds.append(root)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user