From 73b415bcad7db801448cc5a956ee8bbf85cd6e76 Mon Sep 17 00:00:00 2001 From: Andrey Reznik Date: Mon, 1 Oct 2018 16:04:48 +0300 Subject: [PATCH 1/2] rc debug config --- Nynja.xcodeproj/project.pbxproj | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Nynja.xcodeproj/project.pbxproj b/Nynja.xcodeproj/project.pbxproj index a41803610..d1be3162d 100644 --- a/Nynja.xcodeproj/project.pbxproj +++ b/Nynja.xcodeproj/project.pbxproj @@ -15938,8 +15938,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIconRC; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Nynja/Resources/Nynja.entitlements; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; @@ -15951,9 +15951,9 @@ MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "$(BundleIdentifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "45a1afcf-be11-4391-825d-7cf40979bc47"; - PROVISIONING_PROFILE_SPECIFIER = NynjaRC_adhoc; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = RELEASE; + PROVISIONING_PROFILE = "dbc772f0-84af-41c2-8843-c273c4b018f9"; + PROVISIONING_PROFILE_SPECIFIER = NynjaRC_dev; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OBJC_BRIDGING_HEADER = "Nynja-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; @@ -15970,8 +15970,8 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = "Nynja-Share/Resources/Nynja-Share.entitlements"; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Manual; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 9GKQ5AMF2B; @@ -15983,10 +15983,10 @@ OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" -DSHARE_EXTENSION"; PRODUCT_BUNDLE_IDENTIFIER = "$(ExtensionBundleIdentifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "9b8a591a-4b46-4454-a314-16a54e890933"; - PROVISIONING_PROFILE_SPECIFIER = NynjaRC_adhocExt; + PROVISIONING_PROFILE = "3abc34a3-4327-4bb2-9ad6-7d0e723ae1b8"; + PROVISIONING_PROFILE_SPECIFIER = NynjaRC_devExt; SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = RELEASE; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; -- GitLab From 1e3281f517afab26e614ccce3048ed238027a6df Mon Sep 17 00:00:00 2001 From: Andrey Reznik Date: Tue, 2 Oct 2018 02:09:07 +0300 Subject: [PATCH 2/2] [NY-4010] All voice message isn't transcribed - fixed --- .../Response/TranscribeLongOperationResponseData.swift | 6 +----- .../Response/TranscribeShortResponseData.swift | 9 +++++++++ .../AudioLongTranscribeProccessingOperation.swift | 7 +++++-- .../Operations /AudioShortTranscribeOperation.swift | 5 +++-- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Nynja/Services/REST/TranscribeNetworkService/Response/TranscribeLongOperationResponseData.swift b/Nynja/Services/REST/TranscribeNetworkService/Response/TranscribeLongOperationResponseData.swift index 83f4ae513..13d4ecccc 100644 --- a/Nynja/Services/REST/TranscribeNetworkService/Response/TranscribeLongOperationResponseData.swift +++ b/Nynja/Services/REST/TranscribeNetworkService/Response/TranscribeLongOperationResponseData.swift @@ -13,15 +13,11 @@ struct TranscribeLongOperationResponseData: Codable { var name: String? var metadata: Metadata? var done: Bool? - var response: Response? + var response: TranscribeShortResponseData? struct Metadata: Codable { var progressPercent: Int? var startTime: String? var lastUpdateTime: String? } - - struct Response: Codable { - var results: [TranscribeShortResponseData.TranscribeResult]? - } } diff --git a/Nynja/Services/REST/TranscribeNetworkService/Response/TranscribeShortResponseData.swift b/Nynja/Services/REST/TranscribeNetworkService/Response/TranscribeShortResponseData.swift index 14263e594..e20c5abd2 100644 --- a/Nynja/Services/REST/TranscribeNetworkService/Response/TranscribeShortResponseData.swift +++ b/Nynja/Services/REST/TranscribeNetworkService/Response/TranscribeShortResponseData.swift @@ -11,6 +11,15 @@ import Foundation struct TranscribeShortResponseData: Codable { var results: [TranscribeResult]? + var fullTranscription: String? { + guard let results = results, !results.isEmpty else { + return nil + } + return results.compactMap({ result -> String? in + return result.alternatives?.max(by: { ($0.confidence ?? 0) < ($1.confidence ?? 0) })?.transcript + }).joined(separator: " ") + } + struct TranscribeResult: Codable { var alternatives: [TranscribeAlternative]? diff --git a/Nynja/Services/TranscribeService/Operations /AudioLongTranscribeProccessingOperation.swift b/Nynja/Services/TranscribeService/Operations /AudioLongTranscribeProccessingOperation.swift index d833a14d2..cd8b26224 100644 --- a/Nynja/Services/TranscribeService/Operations /AudioLongTranscribeProccessingOperation.swift +++ b/Nynja/Services/TranscribeService/Operations /AudioLongTranscribeProccessingOperation.swift @@ -56,7 +56,10 @@ final class AudioLongTranscribeProccessingOperation: TranscribeOperation, Initia } private func transcribeLongOperation(with name: String) { - let processingTask = networkService.loadTranscriptionProcessingResult(name: name){ result in + let processingTask = networkService.loadTranscriptionProcessingResult(name: name) { [weak self] result in + guard let `self` = self else { + return + } switch result { case .failure(let error): self.completion?(.failure(.networkClient(error))) @@ -68,7 +71,7 @@ final class AudioLongTranscribeProccessingOperation: TranscribeOperation, Initia self.operationGroup?.leave() self.state = .finished } - guard let transcription = response.response?.results?.first?.alternatives?.first?.transcript else { + guard let transcription = response.response?.fullTranscription else { self.dataWrapper.processingResult = nil self.completion?(.failure(.emptyResponse(self.language))) return diff --git a/Nynja/Services/TranscribeService/Operations /AudioShortTranscribeOperation.swift b/Nynja/Services/TranscribeService/Operations /AudioShortTranscribeOperation.swift index 45f918882..8a416a249 100644 --- a/Nynja/Services/TranscribeService/Operations /AudioShortTranscribeOperation.swift +++ b/Nynja/Services/TranscribeService/Operations /AudioShortTranscribeOperation.swift @@ -52,11 +52,12 @@ final class AudioShortTranscribeOperation: TranscribeOperation, InitializeInject case .failure(let error): self.completion?(.failure(.networkClient(error))) case .success(let response): - guard let transcription = response.results?.first?.alternatives?.first?.transcript else { + guard let transcription = response.fullTranscription else { self.completion?(.failure(.emptyResponse(self.language))) self.state = .finished return } + self.dataWrapper.processingResult = transcription self.completion?(.success(transcription)) } self.state = .finished @@ -64,6 +65,6 @@ final class AudioShortTranscribeOperation: TranscribeOperation, InitializeInject task = transcribeTask - completion?(.updateProccess(self, .transcribing)) + completion?(.updateProccess(self, .transcribingShort)) } } -- GitLab