Skip to content

Commit

Permalink
Typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SoneeJohn committed Feb 23, 2016
1 parent b124f37 commit db6d538
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions YTVimeoExtractor/YTVimeoExtractor.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ -(void)fetchVideoWithIdentifier:(NSString *)videoIdentifier withReferer:(NSStrin

if (videoIdentifier.length == 0) {

NSError *invalidIDError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorInvalidVideoIdentifier userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish sucessfully.", NSLocalizedFailureReasonErrorKey: @"The video identifier is invalid."}];
NSError *invalidIDError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorInvalidVideoIdentifier userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish successfully.", NSLocalizedFailureReasonErrorKey: @"The video identifier is invalid."}];

completionHandler(nil, invalidIDError);

Expand Down Expand Up @@ -86,7 +86,7 @@ -(void)fetchVideoWithVimeoURL:(NSString *)videoURL withReferer:(NSString *)refer

if (videoURL.length == 0) {

NSError *invalidIDError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorInvalidVideoIdentifier userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish sucessfully.", NSLocalizedFailureReasonErrorKey: @"The video identifier is invalid."}];
NSError *invalidIDError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorInvalidVideoIdentifier userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish successfully.", NSLocalizedFailureReasonErrorKey: @"The video identifier is invalid."}];

completionHandler(nil, invalidIDError);

Expand All @@ -98,7 +98,7 @@ -(void)fetchVideoWithVimeoURL:(NSString *)videoURL withReferer:(NSString *)refer

if (isValidURL == NO) {

NSError *invalidIDError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorInvalidVideoIdentifier userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish sucessfully.", NSLocalizedFailureReasonErrorKey: @"The video identifier is invalid."}];
NSError *invalidIDError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorInvalidVideoIdentifier userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish successfully.", NSLocalizedFailureReasonErrorKey: @"The video identifier is invalid."}];

completionHandler(nil, invalidIDError);

Expand Down
2 changes: 1 addition & 1 deletion YTVimeoExtractor/YTVimeoExtractorOperation.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
*/

/**
* Returns a `YTVimeoVideo` object if the operation finished sucessfully. Otherwise, will be `nil`.
* Returns a `YTVimeoVideo` object if the operation finished successfully. Otherwise, will be `nil`.
*/
@property (nonatomic, readonly) YTVimeoVideo *operationVideo;
/**
Expand Down
12 changes: 6 additions & 6 deletions YTVimeoExtractor/YTVimeoExtractorOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,18 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)data

if (httpResponse.statusCode == 404) {

NSError *deletedError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorRemovedVideo userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish sucessfully.", NSLocalizedFailureReasonErrorKey: @"The requested Vimeo video was deleted."}];
NSError *deletedError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorRemovedVideo userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish successfully.", NSLocalizedFailureReasonErrorKey: @"The requested Vimeo video was deleted."}];
[self finishOperationWithError:deletedError];

}else if (httpResponse.statusCode == 403){

NSError *privateError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorRestrictedPlayback userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish sucessfully.", NSLocalizedFailureReasonErrorKey: @"The requested Vimeo video is private."}];
NSError *privateError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorRestrictedPlayback userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish successfully.", NSLocalizedFailureReasonErrorKey: @"The requested Vimeo video is private."}];
[self finishOperationWithError:privateError];

}else{
NSString *response = [NSHTTPURLResponse localizedStringForStatusCode:httpResponse.statusCode];

NSError *unknownError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorUnknown userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish sucessfully.", NSLocalizedFailureReasonErrorKey:[NSString stringWithFormat:@"The requested Vimeo video out this reponse: %@",response]}];
NSError *unknownError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorUnknown userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish successfully.", NSLocalizedFailureReasonErrorKey:[NSString stringWithFormat:@"The requested Vimeo video out this reponse: %@",response]}];

[self finishOperationWithError:unknownError];
}
Expand Down Expand Up @@ -191,12 +191,12 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didComp
//However, this is just here to be on the safe side.
if ([error.domain isEqualToString:NSURLErrorDomain]) {

NSError *networkError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorNetwork userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish sucessfully.", NSLocalizedFailureReasonErrorKey:error.localizedDescription}];
NSError *networkError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorNetwork userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish successfully.", NSLocalizedFailureReasonErrorKey:error.localizedDescription}];
[self finishOperationWithError:networkError];

}else{

NSError *someOtherError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorUnknown userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish sucessfully.", NSLocalizedFailureReasonErrorKey:error.localizedDescription}];
NSError *someOtherError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorUnknown userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish successfully.", NSLocalizedFailureReasonErrorKey:error.localizedDescription}];

[self finishOperationWithError:someOtherError];
}
Expand All @@ -208,7 +208,7 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didComp
NSError *jsonError;
NSDictionary *jsonData = [NSJSONSerialization JSONObjectWithData:self.buffer options:NSJSONReadingAllowFragments error:&jsonError];
if (!jsonData) {
NSError *invalidIDError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorInvalidVideoIdentifier userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish sucessfully.", NSLocalizedFailureReasonErrorKey: @"The video identifier is invalid"}];
NSError *invalidIDError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorInvalidVideoIdentifier userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish successfully.", NSLocalizedFailureReasonErrorKey: @"The video identifier is invalid"}];
[self finishOperationWithError:invalidIDError];
return;
}
Expand Down
4 changes: 2 additions & 2 deletions YTVimeoExtractor/YTVimeoVideo.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ - (void)extractVideoInfoWithCompletionHandler:(void (^)(NSError *error))completi
if (thumbnailsInfo.count == 0 || thumbnailsInfo == nil) {
//Private video
//This could also be a deleted video. However, the `YTVimeoExtractorOperation`class will catch deleted videos.
NSError *privateError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorRestrictedPlayback userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish sucessfully.", NSLocalizedFailureReasonErrorKey: @"The requested Vimeo video is private."}];
NSError *privateError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorRestrictedPlayback userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish successfully.", NSLocalizedFailureReasonErrorKey: @"The requested Vimeo video is private."}];
completionHandler(privateError);
return;
}
Expand Down Expand Up @@ -84,7 +84,7 @@ - (void)extractVideoInfoWithCompletionHandler:(void (^)(NSError *error))completi

if (streamURLs.count == 0 || streamURLs == nil) {

NSError *unsuitableError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorNoSuitableStreamAvailable userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish sucessfully.", NSLocalizedFailureReasonErrorKey: @"The requested Vimeo video does not have a suitable stream. The file cannot natively play on iOS or OS X."}];
NSError *unsuitableError = [NSError errorWithDomain:YTVimeoVideoErrorDomain code:YTVimeoErrorNoSuitableStreamAvailable userInfo:@{NSLocalizedDescriptionKey:@"The operation was unable to finish successfully.", NSLocalizedFailureReasonErrorKey: @"The requested Vimeo video does not have a suitable stream. The file cannot natively play on iOS or OS X."}];

completionHandler(unsuitableError);
return;
Expand Down

0 comments on commit db6d538

Please sign in to comment.