|
|
|
|
@ -217,9 +217,9 @@ enum Sound: Int, CaseIterable, Identifiable, Localized { |
|
|
|
|
static func computeSoundDurationsIfNecessary() { |
|
|
|
|
Task { |
|
|
|
|
for sound in Sound.allCases { |
|
|
|
|
if Preferences.soundDurations[sound.rawValue] == nil { |
|
|
|
|
if Preferences.soundDurations[sound.fileName] == nil { |
|
|
|
|
if let duration = try? await sound.duration() { |
|
|
|
|
Preferences.soundDurations[sound.rawValue] = duration |
|
|
|
|
Preferences.soundDurations[sound.fileName] = duration |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -227,7 +227,7 @@ enum Sound: Int, CaseIterable, Identifiable, Localized { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var formattedDuration: String { |
|
|
|
|
if let duration = Preferences.soundDurations[self.rawValue] { |
|
|
|
|
if let duration = Preferences.soundDurations[self.fileName] { |
|
|
|
|
return duration.minuteSecond |
|
|
|
|
} else { |
|
|
|
|
return "" |
|
|
|
|
|