Skip to content
This repository was archived by the owner on Jun 19, 2020. It is now read-only.

Commit 2e7d451

Browse files
committed
Updated dependencies, moved hash to info.plist
1 parent d8c1832 commit 2e7d451

File tree

649 files changed

+386423
-91
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

649 files changed

+386423
-91
lines changed

Apple Events.xcodeproj/project.pbxproj

Lines changed: 220 additions & 31 deletions
Large diffs are not rendered by default.

Apple Events/EVTChromecastViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Copyright © 2016 Guilherme Rambo. All rights reserved.
77
//
88

9-
#import "EVTChromeCastViewController.h"
9+
#import "EVTChromecastViewController.h"
1010

1111
@import EventsUI;
1212
@import ChromeCastCore;

Apple Events/EVTEnvironment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Copyright © 2016 Guilherme Rambo. All rights reserved.
77
//
88

9-
#import <Foundation/Foundation.h>
9+
@import Cocoa;
1010

1111
@interface EVTEnvironment : NSObject
1212

Apple Events/EVTEnvironment.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ + (instancetype)productionEnvironment
5151
static dispatch_once_t onceToken;
5252
dispatch_once(&onceToken, ^{
5353
prodEnv = [[EVTEnvironment alloc] init];
54-
prodEnv.baseURL = [NSURL URLWithString:@"https://itunesevents.apple.com/2216a55d7a4ed438cb6642049ae23cfff369ae9b/data/"];
54+
55+
NSString *eventHash = [NSBundle mainBundle].infoDictionary[@"EVTCurrentEventHash"];
56+
NSString *urlString = [NSString stringWithFormat:@"https://itunesevents.apple.com/%@/data/", eventHash];
57+
58+
prodEnv.baseURL = [NSURL URLWithString:urlString];
59+
5560
prodEnv.stateCheckInterval = 60.0;
5661
});
5762

Apple Events/EVTEventStateProvider.m

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ @interface EVTEventStateProvider ()
1515
@property (nonatomic, strong) EVTEnvironment *environment;
1616
@property (nonatomic, strong) NSURLSession *session;
1717
@property (nonatomic, strong) NSTimer *timer;
18+
@property (nonatomic, assign) EVTEventState state;
1819

1920
@end
2021

2122
@implementation EVTEventStateProvider
22-
{
23-
EVTEventState _state;
24-
}
2523

2624
- (instancetype)initWithEnvironment:(EVTEnvironment *)environment
2725
{
@@ -70,22 +68,25 @@ - (void)__startMonitoring
7068

7169
- (void)__stateCheck:(NSTimer *)sender
7270
{
71+
__weak typeof(self) weakSelf = self;
72+
7373
[self __fetchStateWithCompletionHandler:^(NSString *stateName) {
7474
#ifdef DEBUG
7575
NSLog(@"STATE = %@", stateName);
7676
#endif
7777
[self willChangeValueForKey:@"state"];
7878
if ([stateName isEqualToString:@"PRE"]) {
79-
_state = EVTEventStatePre;
79+
weakSelf.state = EVTEventStatePre;
8080
} else if ([stateName isEqualToString:@"LIVE"]) {
81-
_state = EVTEventStateLive;
81+
weakSelf.state = EVTEventStateLive;
8282
} else if ([stateName isEqualToString:@"INTERIM"]) {
83-
_state = EVTEventStateInterim;
83+
weakSelf.state = EVTEventStateInterim;
8484
} else if ([stateName isEqualToString:@"POST"]) {
85-
_state = EVTEventStatePost;
85+
weakSelf.state = EVTEventStatePost;
8686
} else {
8787
NSLog(@"Unknown event state: %@", stateName);
8888
}
89+
8990
[self didChangeValueForKey:@"state"];
9091
}];
9192
}

Apple Events/EVTEventsViewController.m

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,6 @@ - (void)__populateEventsWith:(NSArray <EVTEvent *> *)events
177177

178178
- (void)__showError:(NSError *)error
179179
{
180-
NSDictionary *errorDebugInfo = @{
181-
@"lang": [[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode],
182-
@"zone": [NSTimeZone systemTimeZone].name
183-
};
184-
185180
[[NSAlert alertWithError:error] beginSheetModalForWindow:self.view.window completionHandler:^(NSModalResponse returnCode) { }];
186181
}
187182

Apple Events/EVTPlayerViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#import "EVTEventsViewController.h"
1212
#import "EVTEvent.h"
1313

14-
#import "EVTChromeCastViewController.h"
14+
#import "EVTChromecastViewController.h"
1515

1616
@import AVFoundation;
1717
@import AVKit;

Apple Events/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<string>1.0</string>
2121
<key>CFBundleVersion</key>
2222
<string>18</string>
23+
<key>EVTCurrentEventHash</key>
24+
<string>c7c808b8426b5211088e00be67754024e0c3d171</string>
2325
<key>LSMinimumSystemVersion</key>
2426
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
2527
<key>NSAppTransportSecurity</key>

AppleEventsDock/EVTDockTilePlugIn.m

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ @interface EVTDockTilePlugIn ()
2424

2525
@property (nonatomic, strong) NSTimer *updateTimer;
2626

27+
@property (nonatomic, strong) NSDockTile *dockTile;
28+
2729
@end
2830

2931
@implementation EVTDockTilePlugIn
30-
{
31-
NSDockTile *_dockTile;
32-
}
3332

3433
- (instancetype)init
3534
{
@@ -64,9 +63,11 @@ - (void)setDockTile:(NSDockTile *)dockTile
6463
- (void)updateIconWithEventImageNamed:(NSString *)imageName
6564
{
6665
[[NSUserDefaults standardUserDefaults] setObject:imageName forKey:@"__EVT_currentIdentifier"];
66+
67+
__weak typeof(self) weakSelf = self;
6768
[self.imageFetcher fetchImageNamed:imageName completionHandler:^(NSImage *image) {
6869
self.iconView.eventImage = image;
69-
[_dockTile display];
70+
[weakSelf.dockTile display];
7071
}];
7172
}
7273

@@ -81,7 +82,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
8182
{
8283
if ([keyPath isEqualToString:@"state"]) {
8384
self.iconView.isLive = (self.stateProvider.state == EVTEventStateLive);
84-
[_dockTile display];
85+
[self.dockTile display];
8586
} else {
8687
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
8788
}

0 commit comments

Comments
 (0)