diff --git a/piwigo.xcodeproj/project.pbxproj b/piwigo.xcodeproj/project.pbxproj index 2e15c61fa..8c3eb2865 100644 --- a/piwigo.xcodeproj/project.pbxproj +++ b/piwigo.xcodeproj/project.pbxproj @@ -65,12 +65,12 @@ AD2058972B77DF8400CF7E0B /* AVKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2058962B77DF8400CF7E0B /* AVKit.framework */; }; AD2058992B77DFB700CF7E0B /* LinkPresentation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2058982B77DFB700CF7E0B /* LinkPresentation.framework */; }; AD20589B2B77DFD600CF7E0B /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD20589A2B77DFD600CF7E0B /* AVFoundation.framework */; }; - AD20589D2B77E03F00CF7E0B /* UniformTypeIdentifiers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD20589C2B77E03F00CF7E0B /* UniformTypeIdentifiers.framework */; }; + AD20589D2B77E03F00CF7E0B /* UniformTypeIdentifiers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD20589C2B77E03F00CF7E0B /* UniformTypeIdentifiers.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; AD20589E2B77E0D200CF7E0B /* Intents.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2913B32669440000403026 /* Intents.framework */; }; AD2058A02B77E15700CF7E0B /* LocalAuthentication.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD20589F2B77E15700CF7E0B /* LocalAuthentication.framework */; }; AD2058A22B77E1B700CF7E0B /* CoreHaptics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2058A12B77E1B600CF7E0B /* CoreHaptics.framework */; }; AD2058A42B77E1EF00CF7E0B /* Vision.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2058A32B77E1EF00CF7E0B /* Vision.framework */; }; - AD2058A62B77E22000CF7E0B /* BackgroundTasks.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2058A52B77E22000CF7E0B /* BackgroundTasks.framework */; }; + AD2058A62B77E22000CF7E0B /* BackgroundTasks.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2058A52B77E22000CF7E0B /* BackgroundTasks.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; AD2058A72B77E27700CF7E0B /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD20588A2B77DDEA00CF7E0B /* CoreData.framework */; }; AD2058A82B77E28000CF7E0B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD20588C2B77DE0B00CF7E0B /* Foundation.framework */; }; AD2058A92B77E29D00CF7E0B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD20588C2B77DE0B00CF7E0B /* Foundation.framework */; }; @@ -79,13 +79,13 @@ AD2058AC2B77E2CA00CF7E0B /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2058942B77DF6A00CF7E0B /* MobileCoreServices.framework */; }; AD2058AD2B77E2E900CF7E0B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2058882B779BC500CF7E0B /* UIKit.framework */; }; AD2058AE2B77E31200CF7E0B /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD20589A2B77DFD600CF7E0B /* AVFoundation.framework */; }; - AD2058AF2B77E32500CF7E0B /* BackgroundTasks.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2058A52B77E22000CF7E0B /* BackgroundTasks.framework */; }; + AD2058AF2B77E32500CF7E0B /* BackgroundTasks.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2058A52B77E22000CF7E0B /* BackgroundTasks.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; AD2058B02B77E34A00CF7E0B /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2058922B77DF5C00CF7E0B /* ImageIO.framework */; }; AD2058B12B77E36F00CF7E0B /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD20588A2B77DDEA00CF7E0B /* CoreData.framework */; }; AD2058B22B77E37600CF7E0B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD20588C2B77DE0B00CF7E0B /* Foundation.framework */; }; AD2058B32B77E3E700CF7E0B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2058882B779BC500CF7E0B /* UIKit.framework */; }; AD2058B42B77E40900CF7E0B /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2058942B77DF6A00CF7E0B /* MobileCoreServices.framework */; }; - AD2058B52B77E41400CF7E0B /* UniformTypeIdentifiers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD20589C2B77E03F00CF7E0B /* UniformTypeIdentifiers.framework */; }; + AD2058B52B77E41400CF7E0B /* UniformTypeIdentifiers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD20589C2B77E03F00CF7E0B /* UniformTypeIdentifiers.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; AD2058B62B77E43B00CF7E0B /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2058902B77DED300CF7E0B /* CoreMedia.framework */; }; AD2058B82B77E45900CF7E0B /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2058B72B77E45800CF7E0B /* CoreLocation.framework */; }; AD2058B92B77E47E00CF7E0B /* Photos.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD2058822B779AF500CF7E0B /* Photos.framework */; }; @@ -175,6 +175,7 @@ AD3DB4112773957A00017542 /* ImageViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AD3DB4102773957A00017542 /* ImageViewController.storyboard */; }; AD3DB4132773958200017542 /* ImageDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD3DB4122773958200017542 /* ImageDetailViewController.swift */; }; AD3DB4152773958A00017542 /* ImageDescriptionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD3DB4142773958A00017542 /* ImageDescriptionView.swift */; }; + AD3EE6012B811349002B5CDB /* pwg.image.rotate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD3EE6002B811349002B5CDB /* pwg.image.rotate.swift */; }; AD3FF5F42682908000D2F52A /* UIImage+AppTools.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADCC996425B452670034CB4A /* UIImage+AppTools.swift */; }; AD41530F27C6D35D00DE01CB /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD41530E27C6D35D00DE01CB /* LoginViewController.swift */; }; AD41531527C6D37D00DE01CB /* LoginNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD41531427C6D37C00DE01CB /* LoginNavigationController.swift */; }; @@ -748,6 +749,7 @@ AD3DB4102773957A00017542 /* ImageViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = ImageViewController.storyboard; sourceTree = ""; }; AD3DB4122773958200017542 /* ImageDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageDetailViewController.swift; sourceTree = ""; }; AD3DB4142773958A00017542 /* ImageDescriptionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageDescriptionView.swift; sourceTree = ""; }; + AD3EE6002B811349002B5CDB /* pwg.image.rotate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = pwg.image.rotate.swift; sourceTree = ""; }; AD3FDDE81F2E23F700F71C81 /* da */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Localizable.strings; sourceTree = ""; }; AD3FDDE91F2E23F700F71C81 /* da */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/About.strings; sourceTree = ""; }; AD3FDDEA1F2E23F700F71C81 /* da */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/ReleaseNotes.strings; sourceTree = ""; }; @@ -1489,6 +1491,7 @@ AD211A7B27BAD844005D5E4F /* reflection */, ADF2329C26D40619002ACEC9 /* pwg */, AD5A31652847F85F00948FEE /* pwg.categories */, + AD3EE5FF2B811154002B5CDB /* pwg.image */, AD9A1BE424E03AC700D22C86 /* pwg.images */, ADD485BE2B139EB900C7E30E /* pwg.history */, AD211A8427BAFD51005D5E4F /* pwg.session */, @@ -1543,6 +1546,14 @@ path = community; sourceTree = ""; }; + AD3EE5FF2B811154002B5CDB /* pwg.image */ = { + isa = PBXGroup; + children = ( + AD3EE6002B811349002B5CDB /* pwg.image.rotate.swift */, + ); + path = pwg.image; + sourceTree = ""; + }; AD41BEC8223E9BB200A5DEE3 /* Location Data */ = { isa = PBXGroup; children = ( @@ -2245,9 +2256,9 @@ children = ( ADEA269F285F962800B6C9A0 /* ImageViewController+Menus.swift */, ADEA26A3285FA0E800B6C9A0 /* ImageViewController+Buttons.swift */, - ADEA269D285F909F00B6C9A0 /* ImageViewController+Edit.swift */, ADEA26A1285F9E2400B6C9A0 /* ImageViewController+CopyMove.swift */, ADEA26A7285FA2C300B6C9A0 /* ImageViewController+AlbumThumnail.swift */, + ADEA269D285F909F00B6C9A0 /* ImageViewController+Edit.swift */, ADEA26A5285FA1EB00B6C9A0 /* ImageViewController+Delete.swift */, ADEA2699285F8D5F00B6C9A0 /* ImageViewController+Share.swift */, ADEA269B285F8F2E00B6C9A0 /* ImageViewController+Favorites.swift */, @@ -3066,6 +3077,7 @@ ADF72E9D2670D73E0027E2CC /* pwg.images.uploadAsync.swift in Sources */, ADFA2BD227411E8200CC60BF /* pwg.images.uploadCompleted.swift in Sources */, AD807F0A26E530ED00008162 /* pwg.images.delete.swift in Sources */, + AD3EE6012B811349002B5CDB /* pwg.image.rotate.swift in Sources */, AD673C1C2A4B81C60080BC0B /* PwgSession+Images.swift in Sources */, AD211A8927BAFE2E005D5E4F /* pwg.session.login.swift in Sources */, AD98DEB427C2375C00FAC983 /* pwg.session.getStatus.swift in Sources */, @@ -4283,7 +4295,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development: Eddy Lelievre-Berna (QWTTGCZPSN)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = "$(CURRENT_PROJECT_VERSION)"; + CURRENT_PROJECT_VERSION = 558; DEAD_CODE_STRIPPING = YES; "DEBUG_INFORMATION_FORMAT[sdk=*]" = "dwarf-with-dsym"; "DEBUG_INFORMATION_FORMAT[sdk=iphonesimulator*]" = dwarf; @@ -4305,7 +4317,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = "$(MARKETING_VERSION)"; + MARKETING_VERSION = 3.1.4; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; OTHER_LDFLAGS = ( "$(inherited)", @@ -4356,7 +4368,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Distribution: Pierrick Le Gall (ZU5THW8T5W)"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = "$(CURRENT_PROJECT_VERSION)"; + CURRENT_PROJECT_VERSION = 558; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = ZU5THW8T5W; @@ -4375,7 +4387,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = "$(MARKETING_VERSION)"; + MARKETING_VERSION = 3.1.4; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++20"; OTHER_LDFLAGS = ( "$(inherited)", diff --git a/piwigo.xcodeproj/xcshareddata/xcschemes/piwigo.xcscheme b/piwigo.xcodeproj/xcshareddata/xcschemes/piwigo.xcscheme index 3cabed87d..e0d59e11a 100644 --- a/piwigo.xcodeproj/xcshareddata/xcschemes/piwigo.xcscheme +++ b/piwigo.xcodeproj/xcshareddata/xcschemes/piwigo.xcscheme @@ -76,28 +76,6 @@ isEnabled = "YES"> - - - - - - - - - - diff --git a/piwigo/Image/Download/ImageSession.swift b/piwigo/Image/Download/ImageSession.swift index b772c7370..b1da43173 100644 --- a/piwigo/Image/Download/ImageSession.swift +++ b/piwigo/Image/Download/ImageSession.swift @@ -10,7 +10,10 @@ import AVFoundation import MobileCoreServices import Foundation import piwigoKit -import UniformTypeIdentifiers + +#if canImport(UniformTypeIdentifiers) +import UniformTypeIdentifiers // Requires iOS 14 +#endif class ImageSession: NSObject { @@ -83,7 +86,7 @@ class ImageSession: NSObject { // MARK: - Asynchronous Methods func getImage(withID imageID: Int64?, ofSize imageSize: pwgImageSize, atURL imageURL: URL?, - fromServer serverID: String?, fileSize: Int64 = .zero, + fromServer serverID: String?, fileSize: Int64 = NSURLSessionTransferSizeUnknown, placeHolder: UIImage, progress: ((Float) -> Void)? = nil, completion: @escaping (URL) -> Void, failure: @escaping (Error) -> Void) { // Check arguments @@ -102,7 +105,7 @@ class ImageSession: NSObject { // Create Download instance let download = ImageDownload(imageID: imageID, ofSize: imageSize, atURL: imageURL, - fromServer: serverID, placeHolder: placeHolder, + fromServer: serverID, fileSize: fileSize, placeHolder: placeHolder, progress: progress, completion: completion, failure: failure) // Do we already have this image or video in cache? @@ -129,8 +132,7 @@ class ImageSession: NSObject { // debugPrint("••> Launch download of image: \(imageURL)") download.task = self.dataSession.downloadTask(with: request) download.task?.countOfBytesClientExpectsToSend = Int64((request.allHTTPHeaderFields ?? [:]).count) - let expectedSize: Int64 = fileSize == .zero ? NSURLSessionTransferSizeUnknown : fileSize - download.task?.countOfBytesClientExpectsToReceive = expectedSize + download.task?.countOfBytesClientExpectsToReceive = download.fileSize download.task?.resume() self.activeDownloads[imageURL] = download return @@ -288,7 +290,6 @@ extension ImageSession: URLSessionTaskDelegate { } } else { // Return cached image with completionHandler -// debugPrint("••> Did complete task #\(task.taskIdentifier)") if let completion = download.completionHandler, let fileURL = download.fileURL { completion(fileURL) @@ -300,15 +301,15 @@ extension ImageSession: URLSessionTaskDelegate { } -// MARK: Session Download Delegate +// MARK: - Session Download Delegate extension ImageSession: URLSessionDownloadDelegate { func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didWriteData bytesWritten: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64) { // Retrieve the original URL of this task -// debugPrint("••> Progress task #\(downloadTask.taskIdentifier) -> \(String(describing: downloadTask.currentRequest?.url))") -// debugPrint(" amongst \(activeDownloads.count) active downloads.") +// debugPrint("••> Progress task #\(downloadTask.taskIdentifier) i.e. \(String(describing: downloadTask.originalRequest?.url ?? downloadTask.currentRequest?.url))") +// activeDownloads.forEach { (key, _) in debugPrint(" Key: \(key)") } guard let imageURL = downloadTask.originalRequest?.url ?? downloadTask.currentRequest?.url, let download = activeDownloads[imageURL] else { return @@ -317,7 +318,7 @@ extension ImageSession: URLSessionDownloadDelegate { // Update progress bar if any if let progressHandler = download.progressHandler { download.progress = Float(totalBytesWritten) / Float(totalBytesExpectedToWrite) -// debugPrint("••> Progress task #\(downloadTask.taskIdentifier) -> \(download.progress)") +// debugPrint("••> Progress task #\(downloadTask.taskIdentifier) -> written: \(bytesWritten), totalWritten: \(totalBytesWritten), expected: \(totalBytesExpectedToWrite), progress: \(download.progress)") progressHandler(download.progress) } } @@ -325,7 +326,7 @@ extension ImageSession: URLSessionDownloadDelegate { func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) { // Retrieve the URL of this task -// debugPrint("••> Task #\(downloadTask.taskIdentifier) did finish downloading.") +// debugPrint("••> Task #\(downloadTask.taskIdentifier) did finish downloading to \(location)") guard let imageURL = downloadTask.originalRequest?.url ?? downloadTask.currentRequest?.url, let download = activeDownloads[imageURL], let fileURL = download.fileURL else { @@ -344,10 +345,10 @@ extension ImageSession: URLSessionDownloadDelegate { // Delete existing file if it exists (incomplete previous attempt?) try? fm.removeItem(at: fileURL) - + // Store image try fm.copyItem(at: location, to: fileURL) -// debugPrint("••> Image \(fileURL.lastPathComponent) stored in cache (downloaded at \(String(describing: download.imageURL)))") +// debugPrint("••> Image \(fileURL.lastPathComponent) stored in cache (URL: \(imageURL)") } catch { // Return error with failureHandler if let failure = download.failureHandler { diff --git a/piwigo/Image/ImageDetailViewController.swift b/piwigo/Image/ImageDetailViewController.swift index da64fd58e..3090f0244 100644 --- a/piwigo/Image/ImageDetailViewController.swift +++ b/piwigo/Image/ImageDetailViewController.swift @@ -25,7 +25,7 @@ class ImageDetailViewController: UIViewController @IBOutlet weak var progressView: PieProgressView! // Variable used to remember the position of the image on the screen - private var imagePosition = CGPoint(x: 0.5, y: 0.5) +// private var imagePosition = CGPoint(x: 0.5, y: 0.5) // Variable used to dismiss the view when the scale is reduced // from less than 1.1 x miminumZoomScale to less than 0.9 x miminumZoomScale @@ -213,7 +213,7 @@ class ImageDetailViewController: UIViewController // Calc zoom scale change var zoomFactor = 1.0 - if scrollView.minimumZoomScale != 0 { + if scrollView.minimumZoomScale > 1e-6 { zoomFactor = scrollView.zoomScale / scrollView.minimumZoomScale } @@ -239,7 +239,7 @@ class ImageDetailViewController: UIViewController imageSize.width != 0, imageSize.height != 0, scrollView.zoomScale != 0 else { - imagePosition = CGPoint.zero +// imagePosition = CGPoint.zero return } diff --git a/piwigo/Resources/ar.lproj/ReleaseNotes.strings b/piwigo/Resources/ar.lproj/ReleaseNotes.strings index b721eca90..714ae85c2 100644 --- a/piwigo/Resources/ar.lproj/ReleaseNotes.strings +++ b/piwigo/Resources/ar.lproj/ReleaseNotes.strings @@ -6,7 +6,9 @@ Copyright © 2017 Piwigo.org. All rights reserved. */ -"v3.1.3_text" = "Version 3.1.3\n\n• Bug fixes"; +"v3.1.4_text" = "Version 3.1.4\n\n• Fixes a crash occurring on iOS 12"; + +"v3.1.3_text" = "Version 3.1.3\nFebruary 11, 2024\n\n• Bug fixes"; "v3.1.2_text" = "الإصدار 3.1.2\n\n• طلبات تحديث خادم Piwigo إذا لزم الأمر\n• إصلاحات الشوائب"; diff --git a/piwigo/Resources/da.lproj/ReleaseNotes.strings b/piwigo/Resources/da.lproj/ReleaseNotes.strings index 0b1fbcc19..5011c2cb6 100644 --- a/piwigo/Resources/da.lproj/ReleaseNotes.strings +++ b/piwigo/Resources/da.lproj/ReleaseNotes.strings @@ -6,9 +6,11 @@ Copyright © 2017 Piwigo.org. All rights reserved. */ -"v3.1.3_text" = "Version 3.1.3\n\n• Fejlrettelser"; +"v3.1.4_text" = "Version 3.1.4\n\n• Retter et nedbrud på iOS 12"; -"v3.1.2_text" = "Version 3.1.2\n1 februar 2024\n\n• Anmodninger om opdatering af Piwigo server om nødvendigt\n• Fejlrettelser"; +"v3.1.3_text" = "Version 3.1.3\n11 februar 2024\n\n• Fejlrettelser"; + +"v3.1.2_text" = "Version 3.1.2\n1 februar 2024\n\n• Anmoder om opdatering af Piwigo server om nødvendigt\n• Fejlrettelser"; "v3.1.1_text" = "Version 3.1.1\n1 december 2023\n\n• Opdaterer serverstatistikker (kræver Piwigo 14)\n• Fejlrettelser"; diff --git a/piwigo/Resources/de.lproj/About.strings b/piwigo/Resources/de.lproj/About.strings index d26960d2e..006bffdb9 100644 --- a/piwigo/Resources/de.lproj/About.strings +++ b/piwigo/Resources/de.lproj/About.strings @@ -6,7 +6,7 @@ Copyright (c) 2015 bakercrew. All rights reserved. */ -"authors1" = "Von Spencer Baker, Olaf Greck "; +"authors1" = "Von Spencer Baker, Olaf Greck"; "authors2" = "und Eddy Lelièvre-Berna"; "version" = "Version:"; diff --git a/piwigo/Resources/de.lproj/Localizable.strings b/piwigo/Resources/de.lproj/Localizable.strings index 7ab4667f4..3566aacfe 100644 --- a/piwigo/Resources/de.lproj/Localizable.strings +++ b/piwigo/Resources/de.lproj/Localizable.strings @@ -161,7 +161,7 @@ "categoryDiscoverVisits_title" = "Am häufigsten angesehen"; "categoryDiscoverVisits_legend" = "Aufrufe"; "categoryDiscoverBest_title" = "Am besten bewertet"; -"categoryDiscoverRecent_title" = "Neueste "; +"categoryDiscoverRecent_title" = "Neueste Fotos"; "categoryDiscoverFavorites_title" = "Ihre Favoriten"; // Albums sort @@ -181,7 +181,7 @@ "categorySort_random" = "Zufällige Reihenfolge"; "categorySort_videosOnly" = "Nur Videos"; -"categorySort_imagesOnly" = "Nur "; +"categorySort_imagesOnly" = "Nur Fotos"; // Album selection "categorySelection_title" = "Album"; @@ -283,7 +283,7 @@ "categorySelection_setThumbnail" = "Bitte wählen Sie das Album aus, das das Foto \"%@\" als Vorschaubild verwendet."; "categorySelection_current" = "Wähle das aktuelle Album für dieses Foto"; "categorySelection_one" = "Wähle ein Album in dem dieses Foto vorkommt"; -"categorySelection_other" = "oder wähle ein anderes Album für dieses Foto"; +"categorySelection_other" = "Oder wähle ein anderes Album für dieses Foto"; "categoryImageSet_title" = "Album-Miniaturfoto"; "categoryImageSet_message" = "Sind Sie sicher, dass Sie dieses Foto auf das Album \"%@ \" anwenden möchten?"; "categoryImageSetHUD_updating" = "Album Miniaturfoto wird aktualisiert…"; @@ -320,7 +320,7 @@ "sortBy" = "Sortieren nach"; "imageSortTitle" = "Fotos sortieren"; "imageSortMessage" = "Bitte wählen Sie, wie Sie Fotos sortieren möchten"; -"imageSortingHUD" = "Fotos sortieren"; +"imageSortingHUD" = "Fotos sortieren…"; "imageSelectingHUD" = "Fotos werden ausgewählt…"; "imageDeselectingHUD" = "Abwählen von Fotos…"; @@ -425,7 +425,7 @@ // Image delete — Errors "deleteImageFail_title" = "Löschen fehlgeschlagen"; -"deleteImageFail_message" = "Fotos konnten nicht gelöscht werden\n%@"; +"deleteImageFail_message" = "Fotos konnte nicht gelöscht werden."; // Image download "downloadSingleImage_title" = "Foto herunterladen"; @@ -598,7 +598,7 @@ // Local albums — Access not Authorized "localAlbums_photosNotAuthorized_title" = "Kein Zugriff"; -"localAlbums_photosNiltitle" = "Problem beim Lesen der "; +"localAlbums_photosNiltitle" = "Problem beim Lesen der Fotos"; "localAlbums_photosNnil_msg" = "Es gibt ein Problem beim Lesen der lokalen Foto Bibliothek."; // Local albums — Tell user to change settings, how diff --git a/piwigo/Resources/de.lproj/ReleaseNotes.strings b/piwigo/Resources/de.lproj/ReleaseNotes.strings index ed2a07af4..de4797fad 100644 --- a/piwigo/Resources/de.lproj/ReleaseNotes.strings +++ b/piwigo/Resources/de.lproj/ReleaseNotes.strings @@ -6,7 +6,9 @@ Copyright © 2017 Piwigo.org. All rights reserved. */ -"v3.1.3_text" = "Version 3.1.3\n\n• Fehlerbehebungen"; +"v3.1.4_text" = "Version 3.1.4\n\n• Behebt einen Absturz, der unter iOS 12 auftrat"; + +"v3.1.3_text" = "Version 3.1.3\n11. Februar 2024\n\n• Fehlerbehebungen"; "v3.1.2_text" = "Version 3.1.2\n1. Februar 2024\n\n• Erfordert das Piwigo Server Update falls erforderlich\n• Fehlerbehebungen"; @@ -158,10 +160,10 @@ "v2.0.3_text" = "Version 2.0.3\nMai 26, 2017\n\n• Option in den Einstellungen hinzugefügt um GPS-Metadaten zu löschen\n• Cache-Nutzung in den Einstellungen ersichtlich\n• Fehlerbehebung Cache Einstellungen wurden manchmal gelöscht/Reset\n• Fehlerbehebung Foto hochladen Einstellungen wurden manchmal gelöscht/Reset"; -"v2.0.2_text" = "Version 2.0.2\n8. Mai 2017\n\n• Sortierkriterien sind jetzt identisch zur Piwigo Web App\n• Fehlerbehebung von Sortierungsfehlern\n• Fehlerbehebung Absturz beim Hinzufügen von Schlagwörtern zu einem Foto vor dem Hochladen\n• Fehlerbehebung für Situationen bei denen das Löschen ausgewählter Fotos nicht funktionierte\n• Fehlerbehebung für Situationen bei denen ein Album nach dem Verschieben nicht angezeigt wurde\n• Fehlerbehebung von Kompatibilitätsproblem mit iOS 10 — veralteter Code\n________________________________________\n\n"; +"v2.0.2_text" = "Version 2.0.2\n8. Mai 2017\n\n• Sortierkriterien sind jetzt identisch zur Piwigo Web App\n• Fehlerbehebung von Sortierungsfehlern\n• Fehlerbehebung Absturz beim Hinzufügen von Schlagwörtern zu einem Foto vor dem Hochladen\n• Fehlerbehebung für Situationen bei denen das Löschen ausgewählter Fotos nicht funktionierte\n• Fehlerbehebung für Situationen bei denen ein Album nach dem Verschieben nicht angezeigt wurde\n• Fehlerbehebung von Kompatibilitätsproblem mit iOS 10 — veralteter Code\n________________________________________"; -"v2.0.1_text" = "Version 2.0.1\n26. Juni 2015\n\nNeue Einstellungen:\n- Option, um die Größe von Fotos während des Hochladens zu ändern\n + Fotoqualität zwischen 50-98% auswählbar\n- Möglichkeit um eine Standard Miniaturfotogröße festzulegen\nFehlerbehebungen\n________________________________________\n\n"; +"v2.0.1_text" = "Version 2.0.1\n26. Juni 2015\n\nNeue Einstellungen:\n- Option, um die Größe von Fotos während des Hochladens zu ändern\n + Fotoqualität zwischen 50-98% auswählbar\n- Möglichkeit um eine Standard Miniaturfotogröße festzulegen\nFehlerbehebungen\n________________________________________"; -"v2.0.0_text" = "Version 2.0\n24. April 2015\n\nNeue native App mit den Funktionen:\n- Alben - Verwaltung\n- Fotos ansehen\n- Hochladen von mehreren Fotos\n- Video hochladen und Wiedergabe (VideoJS Erweiterung muss auf dem Piwigo-Server installiert sein)\n________________________________________\n\n"; +"v2.0.0_text" = "Version 2.0\n24. April 2015\n\nNeue native App mit den Funktionen:\n- Alben - Verwaltung\n- Fotos ansehen\n- Hochladen von mehreren Fotos\n- Video hochladen und Wiedergabe (VideoJS Erweiterung muss auf dem Piwigo-Server installiert sein)\n________________________________________"; "v1.0.0_text" = "Version 1.0\n17. Oktober 2011"; diff --git a/piwigo/Resources/en.lproj/ReleaseNotes.strings b/piwigo/Resources/en.lproj/ReleaseNotes.strings index c1f83cd28..c20d131e8 100644 --- a/piwigo/Resources/en.lproj/ReleaseNotes.strings +++ b/piwigo/Resources/en.lproj/ReleaseNotes.strings @@ -6,7 +6,9 @@ Copyright © 2017 Piwigo.org. All rights reserved. */ -"v3.1.3_text" = "Version 3.1.3\n\n• Bug fixes"; +"v3.1.4_text" = "Version 3.1.4\n\n• Fixes a crash occurring on iOS 12"; + +"v3.1.3_text" = "Version 3.1.3\nFebruary 11, 2024\n\n• Bug fixes"; "v3.1.2_text" = "Version 3.1.2\nFebruary 1, 2024\n\n• Requests Piwigo server update if necessary\n• Bug fixes"; diff --git a/piwigo/Resources/es.lproj/ReleaseNotes.strings b/piwigo/Resources/es.lproj/ReleaseNotes.strings index 92d2d8bb9..2972c85a6 100644 --- a/piwigo/Resources/es.lproj/ReleaseNotes.strings +++ b/piwigo/Resources/es.lproj/ReleaseNotes.strings @@ -6,7 +6,9 @@ Copyright © 2017 Piwigo.org. All rights reserved. */ -"v3.1.3_text" = "Versión 3.1.3\n\n• Corrección de errores"; +"v3.1.4_text" = "Versión 3.1.4\n\n• Corrige un fallo que se produce en iOS 12"; + +"v3.1.3_text" = "Versión 3.1.3\n11 de febrero de 2024\n\n• Corrección de errores"; "v3.1.2_text" = "Versión 3.1.2\n1 de febrero de 2024\n\n• Solicita la actualización del servidor Piwigo si es necesario\n• Corrección de errores"; diff --git a/piwigo/Resources/fr.lproj/ReleaseNotes.strings b/piwigo/Resources/fr.lproj/ReleaseNotes.strings index be7067219..ea1664464 100644 --- a/piwigo/Resources/fr.lproj/ReleaseNotes.strings +++ b/piwigo/Resources/fr.lproj/ReleaseNotes.strings @@ -6,7 +6,9 @@ Copyright © 2017 Piwigo.org. All rights reserved. */ -"v3.1.3_text" = "Version 3.1.3\n\n• Correction de bugs"; +"v3.1.4_text" = "Version 3.1.4\n\n• Corrige un plantage survenant sur iOS 12"; + +"v3.1.3_text" = "Version 3.1.3\n11 février 2024\n\n• Correction de bugs"; "v3.1.2_text" = "Version 3.1.2\n1 février 2024\n\n• Demande la mise à jour du serveur Piwigo si nécessaire\n• Corrections de bugs"; diff --git a/piwigo/Resources/hu.lproj/ReleaseNotes.strings b/piwigo/Resources/hu.lproj/ReleaseNotes.strings index d712aa928..372164e69 100644 --- a/piwigo/Resources/hu.lproj/ReleaseNotes.strings +++ b/piwigo/Resources/hu.lproj/ReleaseNotes.strings @@ -6,7 +6,9 @@ Copyright © 2017 Piwigo.org. All rights reserved. */ -"v3.1.3_text" = "3.1.3-es verzió\n\n• Hibajavítások"; +"v3.1.4_text" = "3.1.4 verzió\n\n• Kijavítja az iOS 12 rendszeren előforduló összeomlást"; + +"v3.1.3_text" = "3.1.3-es verzió\n2024 Február 11\n\n• Hibajavítások"; "v3.1.2_text" = "3.1.2 verzió\n2024 Február 1\n\n• Szükség esetén kéri a Piwigo szerver frissítését\n• Hibajavítások"; diff --git a/piwigo/Resources/id.lproj/ReleaseNotes.strings b/piwigo/Resources/id.lproj/ReleaseNotes.strings index 6b075aa39..6f6079cd0 100644 --- a/piwigo/Resources/id.lproj/ReleaseNotes.strings +++ b/piwigo/Resources/id.lproj/ReleaseNotes.strings @@ -6,6 +6,8 @@ Copyright © 2017 Piwigo.org. All rights reserved. */ +"v3.1.4_text" = "Version 3.1.4\n\n• Fixes a crash occurring on iOS 12"; + "v3.1.3_text" = "Versi 3.1.3\n\n• Perbaikan bug"; "v3.1.2_text" = "Version 3.1.2\nFebruary 1, 2024\n\n• Requests Piwigo server update if necessary\n• Bug fixes"; diff --git a/piwigo/Resources/it.lproj/ReleaseNotes.strings b/piwigo/Resources/it.lproj/ReleaseNotes.strings index 3407f6679..9bb620d75 100644 --- a/piwigo/Resources/it.lproj/ReleaseNotes.strings +++ b/piwigo/Resources/it.lproj/ReleaseNotes.strings @@ -6,7 +6,9 @@ Copyright © 2017 Piwigo.org. All rights reserved. */ -"v3.1.3_text" = "Versione 3.1.3\n\n• Correzioni di bug"; +"v3.1.4_text" = "Versione 3.1.4\n\n• Risolve un arresto anomalo che si verificava su iOS 12"; + +"v3.1.3_text" = "Versione 3.1.3\n11 febbraio 2024\n\n• Correzioni di bug"; "v3.1.2_text" = "Versione 3.1.2\n1 febbraio 2024\n\n• Richiede l'aggiornamento del server Piwigo se necessario\n• Correzioni di bug"; diff --git a/piwigo/Resources/ja.lproj/ReleaseNotes.strings b/piwigo/Resources/ja.lproj/ReleaseNotes.strings index e372a088c..1d399d821 100644 --- a/piwigo/Resources/ja.lproj/ReleaseNotes.strings +++ b/piwigo/Resources/ja.lproj/ReleaseNotes.strings @@ -6,7 +6,9 @@ Copyright © 2017 Piwigo.org. All rights reserved. */ -"v3.1.3_text" = "バージョン 3.1.3\n\n• バグの修正"; +"v3.1.4_text" = "バージョン 3.1.4\n\n• iOS 12で発生するクラッシュを修正"; + +"v3.1.3_text" = "バージョン 3.1.3\n2024年2月11日\n\n• バグの修正"; "v3.1.2_text" = "バージョン 3.1.2\n2024年2月1日\n\n• 必要に応じて Piwigo サーバーの更新を要求します\n• バグの修正"; diff --git a/piwigo/Resources/nl.lproj/ReleaseNotes.strings b/piwigo/Resources/nl.lproj/ReleaseNotes.strings index 8262015ba..258415ba1 100644 --- a/piwigo/Resources/nl.lproj/ReleaseNotes.strings +++ b/piwigo/Resources/nl.lproj/ReleaseNotes.strings @@ -6,7 +6,9 @@ Copyright © 2017 Piwigo.org. All rights reserved. */ -"v3.1.3_text" = "Versie 3.1.3\n\n• Foutjes verbeterd"; +"v3.1.4_text" = "Versie 3.1.4\n\n• Oplossing voor een crash die zich voordeed op iOS 12"; + +"v3.1.3_text" = "Versie 3.1.3\n11 februari 2024\n\n• Foutjes verbeterd"; "v3.1.2_text" = "Versie 3.1.2\n1 februari 2024\n\n• Verzoeken Piwigo server update indien nodig\n• Foutjes verbeterd"; diff --git a/piwigo/Resources/pl.lproj/ReleaseNotes.strings b/piwigo/Resources/pl.lproj/ReleaseNotes.strings index bc70891c8..57f95c962 100644 --- a/piwigo/Resources/pl.lproj/ReleaseNotes.strings +++ b/piwigo/Resources/pl.lproj/ReleaseNotes.strings @@ -6,7 +6,9 @@ Copyright © 2017 Piwigo.org. All rights reserved. */ -"v3.1.3_text" = "Wersja 3.1.3\n\n• Poprawki błędów"; +"v3.1.4_text" = "Wersja 3.1.4\n\n• Naprawia awarię występującą w systemie iOS 12"; + +"v3.1.3_text" = "Wersja 3.1.3\n11 lutego 2024\n\n• Poprawki błędów"; "v3.1.2_text" = "Wersja 3.1.2\n1 lutego 2024\n\n• Żądanie aktualizacji serwera Piwigo w razie potrzeby\n• Poprawki błędów"; diff --git a/piwigo/Resources/ru.lproj/ReleaseNotes.strings b/piwigo/Resources/ru.lproj/ReleaseNotes.strings index b0409cdc0..27583cd1b 100644 --- a/piwigo/Resources/ru.lproj/ReleaseNotes.strings +++ b/piwigo/Resources/ru.lproj/ReleaseNotes.strings @@ -6,7 +6,9 @@ Copyright © 2017 Piwigo.org. All rights reserved. */ -"v3.1.3_text" = "Версия 3.1.3\n\n• Исправления ошибок"; +"v3.1.4_text" = "Версия 3.1.4\n\n• Исправлен сбой в iOS 12"; + +"v3.1.3_text" = "Версия 3.1.3\n11 февраля 2024\n\n• Исправления ошибок"; "v3.1.2_text" = "Версия 3.1.2\n1 февраля 2024\n\n• Запрос обновления Piwigo сервера при необходимости\n• Исправления ошибок"; diff --git a/piwigo/Resources/sv.lproj/ReleaseNotes.strings b/piwigo/Resources/sv.lproj/ReleaseNotes.strings index bf2513925..66a424fa6 100644 --- a/piwigo/Resources/sv.lproj/ReleaseNotes.strings +++ b/piwigo/Resources/sv.lproj/ReleaseNotes.strings @@ -6,7 +6,9 @@ Copyright © 2017 Piwigo.org. All rights reserved. */ -"v3.1.3_text" = "Version 3.1.3\n\n• Buggfixar"; +"v3.1.4_text" = "Version 3.1.4\n\n• Åtgärdar en krasch som inträffar på iOS 12"; + +"v3.1.3_text" = "Version 3.1.3\n11 februari 2024\n\n• Buggfixar"; "v3.1.2_text" = "Version 3.1.2\n1 februari 2024\n\n• Begär Piwigo server uppdatering om det behövs\n• Felrättelser"; diff --git a/piwigo/Resources/zh-Hans.lproj/ReleaseNotes.strings b/piwigo/Resources/zh-Hans.lproj/ReleaseNotes.strings index b34c664d4..dceca6566 100644 --- a/piwigo/Resources/zh-Hans.lproj/ReleaseNotes.strings +++ b/piwigo/Resources/zh-Hans.lproj/ReleaseNotes.strings @@ -6,7 +6,9 @@ Copyright © 2017 Piwigo.org. All rights reserved. */ -"v3.1.3_text" = "版本 3.1.3\n\n• 错误修复"; +"v3.1.4_text" = "版本 3.1.4\n\n• 修复在 iOS 12 上发生的崩溃问题"; + +"v3.1.3_text" = "版本 3.1.3\n2024年2月11日\n\n• 错误修复"; "v3.1.2_text" = "版本 3.1.2\n2024年2月1日\n\n• 如有必要,请求 Piwigo 服务器更新\n• Bug修复"; diff --git a/piwigo/Resources/zh-Hant.lproj/ReleaseNotes.strings b/piwigo/Resources/zh-Hant.lproj/ReleaseNotes.strings index 180a29013..9a2c295c0 100644 --- a/piwigo/Resources/zh-Hant.lproj/ReleaseNotes.strings +++ b/piwigo/Resources/zh-Hant.lproj/ReleaseNotes.strings @@ -6,7 +6,9 @@ Copyright © 2017 Piwigo.org. All rights reserved. */ -"v3.1.3_text" = "版本 3.1.3\n\n• 錯誤修正"; +"v3.1.4_text" = "版本3.1.4\n\n• 修正了 iOS 12 上發生的崩潰"; + +"v3.1.3_text" = "版本 3.1.3\n2024年2月11日\n\n• 錯誤修正"; "v3.1.2_text" = "版本 3.1.2\n2024年2月1日\n\n• 如有必要,提示需要更新 Piwigo 伺服器\n• Bug修復"; diff --git a/piwigo/Settings.bundle/de.lproj/About.strings b/piwigo/Settings.bundle/de.lproj/About.strings index d26960d2e..006bffdb9 100644 --- a/piwigo/Settings.bundle/de.lproj/About.strings +++ b/piwigo/Settings.bundle/de.lproj/About.strings @@ -6,7 +6,7 @@ Copyright (c) 2015 bakercrew. All rights reserved. */ -"authors1" = "Von Spencer Baker, Olaf Greck "; +"authors1" = "Von Spencer Baker, Olaf Greck"; "authors2" = "und Eddy Lelièvre-Berna"; "version" = "Version:"; diff --git a/piwigo/Settings/Information/ReleaseNotesViewController.swift b/piwigo/Settings/Information/ReleaseNotesViewController.swift index 06c4d81b0..61d6cbcc3 100644 --- a/piwigo/Settings/Information/ReleaseNotesViewController.swift +++ b/piwigo/Settings/Information/ReleaseNotesViewController.swift @@ -156,6 +156,7 @@ class ReleaseNotesViewController: UIViewController { let notesAttributedString = NSMutableAttributedString(string: "") // Release 3.1.x — Bundle string + notesAttributedString.append(releaseNotes("v3.1.4_text", comment: "v3.1.4 Release Notes text")) notesAttributedString.append(releaseNotes("v3.1.3_text", comment: "v3.1.3 Release Notes text")) notesAttributedString.append(releaseNotes("v3.1.2_text", comment: "v3.1.2 Release Notes text")) notesAttributedString.append(releaseNotes("v3.1.1_text", comment: "v3.1.1 Release Notes text")) diff --git a/piwigo/Supporting Files/AppDelegate.swift b/piwigo/Supporting Files/AppDelegate.swift index b2b9d7eb1..f32d707ad 100644 --- a/piwigo/Supporting Files/AppDelegate.swift +++ b/piwigo/Supporting Files/AppDelegate.swift @@ -7,7 +7,6 @@ // import AVFoundation -import BackgroundTasks import CoreData import CoreHaptics import Foundation @@ -15,6 +14,10 @@ import Intents import LocalAuthentication import UIKit +#if canImport(BackgroundTasks) +import BackgroundTasks // Requires iOS 13 +#endif + import piwigoKit import uploadKit diff --git a/piwigo/Supporting Files/SceneDelegate.swift b/piwigo/Supporting Files/SceneDelegate.swift index d96081ef8..272029de2 100644 --- a/piwigo/Supporting Files/SceneDelegate.swift +++ b/piwigo/Supporting Files/SceneDelegate.swift @@ -7,11 +7,14 @@ // import AVFoundation -import BackgroundTasks import CoreData import LocalAuthentication import UIKit +#if canImport(BackgroundTasks) +import BackgroundTasks // Requires iOS 13 +#endif + import piwigoKit import uploadKit diff --git a/piwigoKit/Data Cache/Image Data/Image+CoreDataClass.swift b/piwigoKit/Data Cache/Image Data/Image+CoreDataClass.swift index 90686cc59..2bf04d60f 100644 --- a/piwigoKit/Data Cache/Image Data/Image+CoreDataClass.swift +++ b/piwigoKit/Data Cache/Image Data/Image+CoreDataClass.swift @@ -10,7 +10,10 @@ import CoreData import Foundation import MobileCoreServices -import UniformTypeIdentifiers + +#if canImport(UniformTypeIdentifiers) +import UniformTypeIdentifiers // Requires iOS 14 +#endif /* Image instances represent photos and videos of a Piwigo server. - Each instance belongs to a Server. @@ -284,6 +287,10 @@ public class Image: NSManagedObject { public override func prepareForDeletion() { super.prepareForDeletion() + self.deleteCachedFiles() + } + + public func deleteCachedFiles() { // Delete cached image files in background queue let ID = String(self.pwgID) let IDopt = ID + CacheVars.shared.optImage diff --git a/piwigoKit/Info.plist b/piwigoKit/Info.plist index d2e457e17..c267c4491 100644 --- a/piwigoKit/Info.plist +++ b/piwigoKit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 3.0.2 + 3.0.3 CFBundleVersion 558 diff --git a/piwigoKit/Network/pwg.image/pwg.image.rotate.swift b/piwigoKit/Network/pwg.image/pwg.image.rotate.swift new file mode 100644 index 000000000..491b91ca5 --- /dev/null +++ b/piwigoKit/Network/pwg.image/pwg.image.rotate.swift @@ -0,0 +1,64 @@ +// +// pwg.image.rotate.swift +// piwigoKit +// +// Created by Eddy Lelièvre-Berna on 17/02/2024. +// Copyright © 2024 Piwigo.org. All rights reserved. +// + +import Foundation + +public let pwgImageRotate = "format=json&method=pwg.image.rotate" + +// MARK: Piwigo JSON Structures +public struct ImageRotateJSON: Decodable { + + public var status: String? + public var result = false + public var errorCode = 0 + public var errorMessage = "" + + private enum RootCodingKeys: String, CodingKey { + case status = "stat" + case result + case errorCode = "err" + case errorMessage = "message" + } + + private enum ErrorCodingKeys: String, CodingKey { + case code = "code" + case message = "msg" + } + + public init(from decoder: Decoder) throws + { + // Root container keyed by RootCodingKeys + let rootContainer = try decoder.container(keyedBy: RootCodingKeys.self) + + // Status returned by Piwigo + status = try rootContainer.decodeIfPresent(String.self, forKey: .status) + if status == "ok" + { + result = try rootContainer.decode(Bool.self, forKey: .result) + } + else if status == "fail" + { + do { + // Retrieve Piwigo server error + errorCode = try rootContainer.decode(Int.self, forKey: .errorCode) + errorMessage = try rootContainer.decode(String.self, forKey: .errorMessage) + } + catch { + // Error container keyed by ErrorCodingKeys ("format=json" forgotten in call) + let errorContainer = try rootContainer.nestedContainer(keyedBy: ErrorCodingKeys.self, forKey: .errorCode) + errorCode = Int(try errorContainer.decode(String.self, forKey: .code)) ?? NSNotFound + errorMessage = try errorContainer.decode(String.self, forKey: .message) + } + } + else { + // Unexpected Piwigo server error + errorCode = -1 + errorMessage = NSLocalizedString("serverUnknownError_message", comment: "Unexpected error encountered while calling server method with provided parameters.") + } + } +} diff --git a/uploadKit/Extensions/UploadManager+Transfer.swift b/uploadKit/Extensions/UploadManager+Transfer.swift index efd29379b..39d2ffac7 100644 --- a/uploadKit/Extensions/UploadManager+Transfer.swift +++ b/uploadKit/Extensions/UploadManager+Transfer.swift @@ -6,10 +6,13 @@ // Copyright © 2020 Piwigo.org. All rights reserved. // -import BackgroundTasks import CoreData import piwigoKit +#if canImport(BackgroundTasks) +import BackgroundTasks // Requires iOS 13 +#endif + extension UploadManager { // MARK: - Transfer Image if Necessary diff --git a/uploadKit/Info.plist b/uploadKit/Info.plist index a7c6a45db..06632c904 100644 --- a/uploadKit/Info.plist +++ b/uploadKit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.0.6 + 1.0.7 CFBundleVersion 378