diff --git a/AutoCat.xcodeproj/project.pbxproj b/AutoCat.xcodeproj/project.pbxproj index 8c4485f..8566875 100644 --- a/AutoCat.xcodeproj/project.pbxproj +++ b/AutoCat.xcodeproj/project.pbxproj @@ -1721,7 +1721,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 170; + CURRENT_PROJECT_VERSION = 171; DEVELOPMENT_TEAM = 46DTTB8X4S; INFOPLIST_FILE = AutoCat/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = AutoCat; @@ -1750,7 +1750,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 170; + CURRENT_PROJECT_VERSION = 171; DEVELOPMENT_TEAM = 46DTTB8X4S; INFOPLIST_FILE = AutoCat/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = AutoCat; diff --git a/AutoCatCore/Services/VehicleRecordService/VehicleRecordService.swift b/AutoCatCore/Services/VehicleRecordService/VehicleRecordService.swift index d7028b3..cf3d5f6 100644 --- a/AutoCatCore/Services/VehicleRecordService/VehicleRecordService.swift +++ b/AutoCatCore/Services/VehicleRecordService/VehicleRecordService.swift @@ -114,6 +114,12 @@ extension VehicleRecordService: VehicleRecordServiceProtocol { throw VehicleRecordError.emptyUrl } + locationTask?.cancel() + locationTask = nil + self.url = nil + let location = self.location + self.location = nil + await recordService.stopRecording() async let recognitionTask = recordService.recognizeText(from: url) @@ -121,10 +127,6 @@ extension VehicleRecordService: VehicleRecordServiceProtocol { let (text, duration) = await (recognitionTask, try? durationTask) - locationTask?.cancel() - locationTask = nil - self.url = nil - let record = AudioRecordDto( path: url.lastPathComponent, number: await getPlateNumber(from: text),