From aafddde6bbd8354a069644f90d66eb8fb1d245dc Mon Sep 17 00:00:00 2001 From: zarzet Date: Tue, 25 Aug 2026 01:24:30 +0700 Subject: [PATCH] fix(ios): handle library scan count output --- ios/Runner/AppDelegate.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index e839a6cd..e98d830f 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -1084,12 +1084,21 @@ import Gobackend else { throw invalidArgumentsError(call.method) } - let count = GobackendScanLibraryFolderToNDJSONFileJSON( + var count = 0 + let succeeded = GobackendScanLibraryFolderToNDJSONFileJSON( folderPath, outputPath, + &count, &error ) if let error = error { throw error } + if !succeeded { + throw NSError( + domain: "SpotiFLAC", + code: -1, + userInfo: [NSLocalizedDescriptionKey: "Library scan failed"] + ) + } return ["path": outputPath, "count": count] case "scanLibraryFolderIncremental":