Skip to content

Commit

Permalink
Rename classes to better reflect purpose
Browse files Browse the repository at this point in the history
“Head” and “Get” HTTP methods are fully capitalized
  • Loading branch information
SoneeJohn committed Feb 19, 2020
1 parent 5577be3 commit f6aada7
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 37 deletions.
40 changes: 20 additions & 20 deletions XCDYouTubeKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
objects = {

/* Begin PBXBuildFile section */
017234C223FC223D00196707 /* XCDURLGetOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 017234C023FC223D00196707 /* XCDURLGetOperation.h */; };
017234C323FC223D00196707 /* XCDURLGetOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 017234C123FC223D00196707 /* XCDURLGetOperation.m */; };
017234C423FC223D00196707 /* XCDURLGetOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 017234C123FC223D00196707 /* XCDURLGetOperation.m */; };
017234C223FC223D00196707 /* XCDURLGETOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 017234C023FC223D00196707 /* XCDURLGETOperation.h */; };
017234C323FC223D00196707 /* XCDURLGETOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 017234C123FC223D00196707 /* XCDURLGETOperation.m */; };
017234C423FC223D00196707 /* XCDURLGETOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 017234C123FC223D00196707 /* XCDURLGETOperation.m */; };
0178E76D23F49BBC001C382E /* XCDYouTubeVideoQueryOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0178E76C23F49BBC001C382E /* XCDYouTubeVideoQueryOperation.m */; };
0178E76E23F4A023001C382E /* XCDYouTubeVideoQueryOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0178E76B23F49BBC001C382E /* XCDYouTubeVideoQueryOperation.h */; settings = {ATTRIBUTES = (Public, ); }; };
0178E76F23F4A02A001C382E /* XCDYouTubeVideoQueryOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0178E76C23F49BBC001C382E /* XCDYouTubeVideoQueryOperation.m */; };
0178E77023F4A049001C382E /* XCDYouTubeVideoQueryOperation.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 0178E76B23F49BBC001C382E /* XCDYouTubeVideoQueryOperation.h */; };
0178E77323F4A0D8001C382E /* XCDURLHeadOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0178E77123F4A0D8001C382E /* XCDURLHeadOperation.h */; };
0178E77423F4A0D8001C382E /* XCDURLHeadOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0178E77223F4A0D8001C382E /* XCDURLHeadOperation.m */; };
0178E77523F4A0D8001C382E /* XCDURLHeadOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0178E77223F4A0D8001C382E /* XCDURLHeadOperation.m */; };
0178E77323F4A0D8001C382E /* XCDURLHEADOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0178E77123F4A0D8001C382E /* XCDURLHEADOperation.h */; };
0178E77423F4A0D8001C382E /* XCDURLHEADOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0178E77223F4A0D8001C382E /* XCDURLHEADOperation.m */; };
0178E77523F4A0D8001C382E /* XCDURLHEADOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0178E77223F4A0D8001C382E /* XCDURLHEADOperation.m */; };
01D2370A1FA03AC100A13E5F /* XCDYouTubeDashManifestXML.m in Sources */ = {isa = PBXBuildFile; fileRef = 01D237091FA03AC100A13E5F /* XCDYouTubeDashManifestXML.m */; };
01D2370B1FA03ADE00A13E5F /* XCDYouTubeDashManifestXML.h in Headers */ = {isa = PBXBuildFile; fileRef = 01D237081FA03AC100A13E5F /* XCDYouTubeDashManifestXML.h */; };
01D2370C1FA03AF100A13E5F /* XCDYouTubeDashManifestXML.m in Sources */ = {isa = PBXBuildFile; fileRef = 01D237091FA03AC100A13E5F /* XCDYouTubeDashManifestXML.m */; };
Expand Down Expand Up @@ -110,12 +110,12 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
017234C023FC223D00196707 /* XCDURLGetOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XCDURLGetOperation.h; sourceTree = "<group>"; };
017234C123FC223D00196707 /* XCDURLGetOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XCDURLGetOperation.m; sourceTree = "<group>"; };
017234C023FC223D00196707 /* XCDURLGETOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XCDURLGETOperation.h; sourceTree = "<group>"; };
017234C123FC223D00196707 /* XCDURLGETOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XCDURLGETOperation.m; sourceTree = "<group>"; };
0178E76B23F49BBC001C382E /* XCDYouTubeVideoQueryOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XCDYouTubeVideoQueryOperation.h; sourceTree = "<group>"; };
0178E76C23F49BBC001C382E /* XCDYouTubeVideoQueryOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XCDYouTubeVideoQueryOperation.m; sourceTree = "<group>"; };
0178E77123F4A0D8001C382E /* XCDURLHeadOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XCDURLHeadOperation.h; sourceTree = "<group>"; };
0178E77223F4A0D8001C382E /* XCDURLHeadOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XCDURLHeadOperation.m; sourceTree = "<group>"; };
0178E77123F4A0D8001C382E /* XCDURLHEADOperation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XCDURLHEADOperation.h; sourceTree = "<group>"; };
0178E77223F4A0D8001C382E /* XCDURLHEADOperation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XCDURLHEADOperation.m; sourceTree = "<group>"; };
01D237081FA03AC100A13E5F /* XCDYouTubeDashManifestXML.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XCDYouTubeDashManifestXML.h; sourceTree = "<group>"; };
01D237091FA03AC100A13E5F /* XCDYouTubeDashManifestXML.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XCDYouTubeDashManifestXML.m; sourceTree = "<group>"; };
01EAD0DE23FACB0800F1E936 /* XCDYouTubeVideoQueryOperationTestCase.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XCDYouTubeVideoQueryOperationTestCase.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -249,10 +249,10 @@
C24C162D18E9A139005E92E9 /* XCDYouTubeVideoOperation.m */,
0178E76B23F49BBC001C382E /* XCDYouTubeVideoQueryOperation.h */,
0178E76C23F49BBC001C382E /* XCDYouTubeVideoQueryOperation.m */,
0178E77123F4A0D8001C382E /* XCDURLHeadOperation.h */,
0178E77223F4A0D8001C382E /* XCDURLHeadOperation.m */,
017234C023FC223D00196707 /* XCDURLGetOperation.h */,
017234C123FC223D00196707 /* XCDURLGetOperation.m */,
0178E77123F4A0D8001C382E /* XCDURLHEADOperation.h */,
0178E77223F4A0D8001C382E /* XCDURLHEADOperation.m */,
017234C023FC223D00196707 /* XCDURLGETOperation.h */,
017234C123FC223D00196707 /* XCDURLGETOperation.m */,
C2A3F2D517F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController.h */,
C2A3F2D717F4827800AC1C3B /* XCDYouTubeVideoPlayerViewController.m */,
C2386B1C1974036300646123 /* XCDYouTubeVideoWebpage.h */,
Expand Down Expand Up @@ -307,12 +307,12 @@
C257F7941C206D26006146D3 /* XCDYouTubeLogger.h in Headers */,
C257F7911C206B8F006146D3 /* XCDYouTubeLogger+Private.h in Headers */,
C2F0E5901944F83E00D8EBA8 /* XCDYouTubeOperation.h in Headers */,
0178E77323F4A0D8001C382E /* XCDURLHeadOperation.h in Headers */,
0178E77323F4A0D8001C382E /* XCDURLHEADOperation.h in Headers */,
C2F0E5931944F84700D8EBA8 /* XCDYouTubeVideo.h in Headers */,
C2F0E5941944F84A00D8EBA8 /* XCDYouTubeVideoOperation.h in Headers */,
C215BEB91BE2E5B500F9783B /* XCDYouTubeVideoWebpage.h in Headers */,
C2F0E5951944F85500D8EBA8 /* XCDYouTubeVideoPlayerViewController.h in Headers */,
017234C223FC223D00196707 /* XCDURLGetOperation.h in Headers */,
017234C223FC223D00196707 /* XCDURLGETOperation.h in Headers */,
C2F0E5921944F84400D8EBA8 /* XCDYouTubeVideo+Private.h in Headers */,
C2F0E5911944F84200D8EBA8 /* XCDYouTubePlayerScript.h in Headers */,
);
Expand Down Expand Up @@ -525,8 +525,8 @@
C25308C518D7392500132734 /* XCDYouTubeClient.m in Sources */,
0178E76D23F49BBC001C382E /* XCDYouTubeVideoQueryOperation.m in Sources */,
C24C162E18E9A139005E92E9 /* XCDYouTubeVideoOperation.m in Sources */,
017234C323FC223D00196707 /* XCDURLGetOperation.m in Sources */,
0178E77423F4A0D8001C382E /* XCDURLHeadOperation.m in Sources */,
017234C323FC223D00196707 /* XCDURLGETOperation.m in Sources */,
0178E77423F4A0D8001C382E /* XCDURLHEADOperation.m in Sources */,
01D2370A1FA03AC100A13E5F /* XCDYouTubeDashManifestXML.m in Sources */,
C25308C818D739EB00132734 /* XCDYouTubeVideo.m in Sources */,
C2597EA61B0CE6D80030E9F2 /* XCDYouTubeLogger.m in Sources */,
Expand All @@ -543,8 +543,8 @@
C2F0E59C1944F8CF00D8EBA8 /* XCDYouTubeVideoOperation.m in Sources */,
0178E76F23F4A02A001C382E /* XCDYouTubeVideoQueryOperation.m in Sources */,
C2F0E5991944F8C200D8EBA8 /* XCDYouTubeClient.m in Sources */,
017234C423FC223D00196707 /* XCDURLGetOperation.m in Sources */,
0178E77523F4A0D8001C382E /* XCDURLHeadOperation.m in Sources */,
017234C423FC223D00196707 /* XCDURLGETOperation.m in Sources */,
0178E77523F4A0D8001C382E /* XCDURLHEADOperation.m in Sources */,
01D2370C1FA03AF100A13E5F /* XCDYouTubeDashManifestXML.m in Sources */,
C2F0E59A1944F8C700D8EBA8 /* XCDYouTubePlayerScript.m in Sources */,
C2597EA71B0CE6D80030E9F2 /* XCDYouTubeLogger.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
NS_ASSUME_NONNULL_BEGIN

__attribute__((visibility("hidden")))
@interface XCDURLGetOperation : NSOperation
@interface XCDURLGETOperation : NSOperation

- (instancetype) initWithURL:(NSURL *)url info:(nullable NSDictionary *)info cookes:(nullable NSArray <NSHTTPCookie *> *)cookies;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
// Copyright © 2020 Cédric Luthi. All rights reserved.
//

#import "XCDURLGetOperation.h"
#import "XCDURLGETOperation.h"
#import "XCDYouTubeLogger+Private.h"

@interface XCDURLGetOperation() <NSURLSessionTaskDelegate, NSURLSessionDataDelegate>
@interface XCDURLGETOperation() <NSURLSessionTaskDelegate, NSURLSessionDataDelegate>
@property (atomic, assign) BOOL isExecuting;
@property (atomic, assign) BOOL isFinished;

Expand All @@ -23,7 +23,7 @@ @interface XCDURLGetOperation() <NSURLSessionTaskDelegate, NSURLSessionDataDeleg

@end

@implementation XCDURLGetOperation
@implementation XCDURLGETOperation

- (instancetype) initWithURL:(NSURL *)url info:(NSDictionary *)info cookes:(NSArray<NSHTTPCookie *> *)cookies
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
NS_ASSUME_NONNULL_BEGIN

__attribute__((visibility("hidden")))
@interface XCDURLHeadOperation : NSOperation
@interface XCDURLHEADOperation : NSOperation

- (instancetype)initWithURL:(NSURL *)url info:(nullable NSDictionary *)info cookes:(nullable NSArray <NSHTTPCookie *> *)cookies;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
// Copyright © 2020 Cédric Luthi. All rights reserved.
//

#import "XCDURLHeadOperation.h"
#import "XCDURLHEADOperation.h"
#import "XCDYouTubeLogger+Private.h"

@interface XCDURLHeadOperation ()
@interface XCDURLHEADOperation ()
@property (atomic, assign) BOOL isExecuting;
@property (atomic, assign) BOOL isFinished;

Expand All @@ -24,7 +24,7 @@ @interface XCDURLHeadOperation ()

@end

@implementation XCDURLHeadOperation
@implementation XCDURLHEADOperation

- (instancetype) initWithURL:(NSURL *)url info:(NSDictionary *)info cookes:(NSArray<NSHTTPCookie *> *)cookies
{
Expand Down
18 changes: 9 additions & 9 deletions XCDYouTubeKit/XCDYouTubeVideoQueryOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
//

#import "XCDYouTubeVideoQueryOperation.h"
#import "XCDURLHeadOperation.h"
#import "XCDURLHEADOperation.h"
#import "XCDYouTubeError.h"
#import "XCDURLGetOperation.h"
#import "XCDURLGETOperation.h"
#import "XCDYouTubeLogger+Private.h"

@interface XCDYouTubeVideoQueryOperation ()
Expand Down Expand Up @@ -103,13 +103,13 @@ - (void) startQuery
{
XCDYouTubeLogDebug(@"Starting query request for video: %@", self.video);

NSMutableArray <XCDURLHeadOperation *>*HEADOperations = [NSMutableArray new];
NSMutableArray <XCDURLHEADOperation *>*HEADOperations = [NSMutableArray new];
BOOL isHTTPLiveStream = self.video.streamURLs[XCDYouTubeVideoQualityHTTPLiveStreaming] != nil;

[self.video.streamURLs enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, NSURL * _Nonnull obj, BOOL * _Nonnull stop)
{

XCDURLHeadOperation *operation = [[XCDURLHeadOperation alloc]initWithURL:obj info:@{key : obj} cookes:self.cookies];
XCDURLHEADOperation *operation = [[XCDURLHEADOperation alloc]initWithURL:obj info:@{key : obj} cookes:self.cookies];
[HEADOperations addObject:operation];

}];
Expand All @@ -119,11 +119,11 @@ - (void) startQuery
if (self.isCancelled)
return;

NSMutableArray <XCDURLGetOperation *>*GETOperations = [NSMutableArray new];
NSMutableArray <XCDURLGETOperation *>*GETOperations = [NSMutableArray new];
NSMutableDictionary<id, NSError *> *streamErrors = [NSMutableDictionary new];
NSMutableDictionary *streamURLs = [NSMutableDictionary new];

for (XCDURLHeadOperation *HEADOperation in HEADOperations)
for (XCDURLHEADOperation *HEADOperation in HEADOperations)
{

if (HEADOperation.error != nil)
Expand All @@ -141,7 +141,7 @@ - (void) startQuery
}
else
{
[GETOperations addObject:[[XCDURLGetOperation alloc]initWithURL:HEADOperation.url info:HEADOperation.info cookes:HEADOperation.cookies]];
[GETOperations addObject:[[XCDURLGETOperation alloc]initWithURL:HEADOperation.url info:HEADOperation.info cookes:HEADOperation.cookies]];
}
}
}
Expand All @@ -159,13 +159,13 @@ - (void) startQuery
[self startGETOperations:GETOperations streamErrors:streamErrors];
}

- (void) startGETOperations:(NSArray <XCDURLGetOperation *>*)GETOperations streamErrors:(NSMutableDictionary <id, NSError *> *)streamErrors
- (void) startGETOperations:(NSArray <XCDURLGETOperation *>*)GETOperations streamErrors:(NSMutableDictionary <id, NSError *> *)streamErrors
{
[self.queryQueue addOperations:GETOperations waitUntilFinished:YES];

NSMutableDictionary *streamURLs = [NSMutableDictionary new];

for (XCDURLGetOperation *GETOperation in GETOperations)
for (XCDURLGETOperation *GETOperation in GETOperations)
{

if (GETOperation.error != nil)
Expand Down

0 comments on commit f6aada7

Please sign in to comment.