mirror of https://github.com/zulip/zulip.git
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:
parent
0f3125582b
commit
970c7d1ddf
|
@ -2853,6 +2853,10 @@ def get_available_notification_sounds() -> List[str]:
|
|||
|
||||
for file_name in os.listdir(notification_sounds_path):
|
||||
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':
|
||||
available_notification_sounds.append(root)
|
||||
|
||||
|
|
Loading…
Reference in New Issue