@@ -10,8 +10,10 @@ import ReadiumShared
1010/// Represents an on-going LCP acquisition task.
1111///
1212/// You can cancel the on-going download with `acquisition.cancel()`.
13- public final class LCPAcquisition : Loggable , Cancellable {
13+ @available ( * , deprecated)
14+ public final class LCPAcquisition : Loggable {
1415 /// Informations about an acquired publication protected with LCP.
16+ @available ( * , unavailable, renamed: " LCPAcquiredPublication " )
1517 public struct Publication {
1618 /// Path to the downloaded publication.
1719 /// You must move this file to the user library's folder.
@@ -21,6 +23,7 @@ public final class LCPAcquisition: Loggable, Cancellable {
2123 public let suggestedFilename : String
2224 }
2325
26+ @available ( * , unavailable, renamed: " LCPProgress " )
2427 /// Percent-based progress of the acquisition.
2528 public enum Progress {
2629 /// Undetermined progress, a spinner should be shown to the user.
@@ -30,32 +33,6 @@ public final class LCPAcquisition: Loggable, Cancellable {
3033 }
3134
3235 /// Cancels the acquisition.
33- public func cancel( ) {
34- cancellable. cancel ( )
35- didComplete ( with: . cancelled)
36- }
37-
38- let onProgress : ( Progress ) -> Void
39- var cancellable = MediatorCancellable ( )
40-
41- private var isCompleted = false
42- private let completion : ( CancellableResult < Publication , LCPError > ) -> Void
43-
44- init ( onProgress: @escaping ( Progress ) -> Void , completion: @escaping ( CancellableResult < Publication , LCPError > ) -> Void ) {
45- self . onProgress = onProgress
46- self . completion = completion
47- }
48-
49- func didComplete( with result: CancellableResult < Publication , LCPError > ) {
50- guard !isCompleted else {
51- return
52- }
53- isCompleted = true
54-
55- completion ( result)
56-
57- if case let . success( publication) = result, ( try ? publication. localURL. exists ( ) ) == true {
58- log ( . warning, " The acquired LCP publication file was not moved in the completion closure. It will be removed from the file system. " )
59- }
60- }
36+ @available ( * , unavailable, message: " This is not needed with the new async variants " )
37+ public func cancel( ) { }
6138}
0 commit comments