Skip to content

Commit

Permalink
DirectUpload.Success -> DirectUpload.SuccessDetails
Browse files Browse the repository at this point in the history
To distinguish from DirectUploadResult.success
  • Loading branch information
andrewjl-mux committed Jul 31, 2023
1 parent 02e2222 commit a256147
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Sources/MuxUploadSDK/InternalUtilities/UploadInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct UploadInput {
case awaitingUploadConfirmation(UploadInfo)
case uploadInProgress(UploadInfo, DirectUpload.TransportStatus)
case uploadPaused(UploadInfo, DirectUpload.TransportStatus)
case uploadSucceeded(UploadInfo, DirectUpload.Success)
case uploadSucceeded(UploadInfo, DirectUpload.SuccessDetails)
case uploadFailed(UploadInfo, DirectUploadError)
}

Expand Down Expand Up @@ -135,7 +135,7 @@ extension UploadInput {
transportStatus: DirectUpload.TransportStatus
) {
if case UploadInput.Status.uploadInProgress(let info, _) = status {
status = .uploadSucceeded(info, DirectUpload.Success(finalState: transportStatus))
status = .uploadSucceeded(info, DirectUpload.SuccessDetails(finalState: transportStatus))
} else {
return
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/MuxUploadSDK/PublicAPI/DirectUpload.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import AVFoundation
import Foundation

public typealias DirectUploadResult = Result<DirectUpload.Success, DirectUploadError>
public typealias DirectUploadResult = Result<DirectUpload.SuccessDetails, DirectUploadError>

///
/// Uploads a media asset to Mux using a previously-created
Expand Down Expand Up @@ -341,7 +341,7 @@ public final class DirectUpload {
*/
public var progressHandler: StateHandler?

public struct Success : Sendable, Hashable {
public struct SuccessDetails : Sendable, Hashable {
public let finalState: TransportStatus
}

Expand Down Expand Up @@ -667,9 +667,9 @@ public final class DirectUpload {
startTime: result.startTime,
isPaused: false
)
let successDetails = DirectUpload.Success(finalState: transportStatus)
let successDetails = DirectUpload.SuccessDetails(finalState: transportStatus)
input.processUploadSuccess(transportStatus: transportStatus)
resultHandler?(Result<Success, DirectUploadError>.success(successDetails))
resultHandler?(Result<SuccessDetails, DirectUploadError>.success(successDetails))
fileWorker?.removeDelegate(withToken: id)
fileWorker = nil
}
Expand Down

0 comments on commit a256147

Please sign in to comment.