Run SwiftFormat.

This commit is contained in:
Doug
2026-05-27 14:38:50 +01:00
committed by Doug
parent 5138e05e47
commit fa67713726
573 changed files with 2426 additions and 2426 deletions
@@ -20,7 +20,7 @@ class VoiceMessageRecorder: VoiceMessageRecorderProtocol {
var actions: AnyPublisher<VoiceMessageRecorderAction, Never> {
actionsSubject.eraseToAnyPublisher()
}
private let mp4accMimeType = "audio/m4a"
var isRecording: Bool {
@@ -36,11 +36,11 @@ class VoiceMessageRecorder: VoiceMessageRecorderProtocol {
}
private var recordingCancelled = false
private(set) var previewAudioPlayerState: AudioPlayerState?
private(set) var previewAudioPlayer: AudioPlayerProtocol?
private var cancellables = Set<AnyCancellable>()
init(audioRecorder: AudioRecorderProtocol = AudioRecorder(),
mediaPlayerProvider: MediaPlayerProviderProtocol,
voiceMessageCache: VoiceMessageCacheProtocol = VoiceMessageCache()) {
@@ -86,7 +86,7 @@ class VoiceMessageRecorder: VoiceMessageRecorderProtocol {
previewAudioPlayer?.reset()
previewAudioPlayerState = nil
}
// MARK: - Preview
func startPlayback() async -> Result<Void, VoiceMessageRecorderError> {
@@ -158,13 +158,13 @@ class VoiceMessageRecorder: VoiceMessageRecorderProtocol {
// delete the temporary file
try? FileManager.default.removeItem(at: oggFile)
}
do {
try audioConverter.convertToOpusOgg(sourceURL: url, destinationURL: oggFile)
} catch {
return .failure(.failedSendingVoiceMessage)
}
// send it
let size: UInt64
do {
@@ -189,7 +189,7 @@ class VoiceMessageRecorder: VoiceMessageRecorderProtocol {
return .success(())
}
// MARK: - Private
private func addObservers() {
@@ -237,10 +237,10 @@ class VoiceMessageRecorder: VoiceMessageRecorderProtocol {
guard audioRecorder.audioFileURL != nil, audioRecorder.currentTime > 0 else {
return .failure(.previewNotAvailable)
}
// Build the preview audio player state
previewAudioPlayerState = await AudioPlayerState(id: .recorderPreview, title: L10n.commonVoiceMessage, duration: recordingDuration, waveform: EstimatedWaveform(data: []))
// Build the preview audio player
let audioPlayer = await mediaPlayerProvider.player
previewAudioPlayer = audioPlayer