Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
ITV: Force use of alternate indexing (no quick caching)
Browse files Browse the repository at this point in the history
ITV quick caching has been dead for months, and there is no point in
using the slow get_iplayer plugin for local indexing when alternate
works as well or better, and can perform incremental updates.
  • Loading branch information
dinkypumpkin committed Jan 7, 2017
1 parent 8980aaf commit f7e4259
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
12 changes: 4 additions & 8 deletions AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ - (id)init {
defaultValues[@"ShowITV"] = @YES;
defaultValues[@"TestProxy"] = @YES;
defaultValues[@"ShowDownloadedInSearch"] = @YES;
defaultValues[@"AltCacheITV_TV"] = @NO;
defaultValues[@"AltCacheITV_TV"] = @YES;
defaultValues[@"AudioDescribedNew"] = @NO;
defaultValues[@"SignedNew"] = @NO;

Expand Down Expand Up @@ -503,9 +503,7 @@ - (void)updateCache:(id)sender proxyDict:(NSDictionary *)proxyDict
proxy = proxyDict[@"proxy"];
}

BOOL altITV = [[[NSUserDefaults standardUserDefaults] valueForKey:@"AltCacheITV_TV"] isEqualTo:@YES];

if ( altITV && [[[NSUserDefaults standardUserDefaults] valueForKey:@"CacheITV_TV"] isEqualTo:@YES] )
if ( [[[NSUserDefaults standardUserDefaults] valueForKey:@"CacheITV_TV"] isEqualTo:@YES] )
{
updatingITVIndex = true;
[[self itvProgressIndicator] startAnimation:self];
Expand All @@ -532,7 +530,7 @@ - (void)updateCache:(id)sender proxyDict:(NSDictionary *)proxyDict
cacheExpiryArg = [[NSString alloc] initWithFormat:@"-e%d", ([[[NSUserDefaults standardUserDefaults] objectForKey:@"CacheExpiryTime"] intValue]*3600)];
}

NSString *typeArgument = [[GetiPlayerArguments sharedController] typeArgumentForCacheUpdate:YES andIncludeITV:!altITV];
NSString *typeArgument = [[GetiPlayerArguments sharedController] typeArgumentForCacheUpdate:YES andIncludeITV:NO];

if (![typeArgument isEqualToString:@"--type"]) {

Expand Down Expand Up @@ -586,12 +584,10 @@ - (void)updateCache:(id)sender proxyDict:(NSDictionary *)proxyDict
{
typesToCache = [[NSMutableArray alloc] initWithCapacity:4];
if ([[defaults objectForKey:@"CacheBBC_TV"] boolValue]) [typesToCache addObject:@"tv"];
if (!altITV && [[defaults objectForKey:@"CacheITV_TV"] boolValue]) [typesToCache addObject:@"itv"];
if ([[defaults objectForKey:@"CacheBBC_Radio"] boolValue]) [typesToCache addObject:@"radio"];

NSArray *urlKeys = @[@"tv",@"itv",@"radio"];
NSArray *urlKeys = @[@"tv",@"radio"];
NSArray *urlObjects = @[@"http://tom-tech.com/get_iplayer/cache/tv.cache",
@"http://tom-tech.com/get_iplayer/cache/itv.cache",
@"http://tom-tech.com/get_iplayer/cache/radio.cache"];
updateURLDic = [[NSDictionary alloc] initWithObjects:urlObjects forKeys:urlKeys];

Expand Down
32 changes: 16 additions & 16 deletions English.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -1842,26 +1842,15 @@
<binding destination="668" name="value" keyPath="values.SignedNew" id="klz-kq-uMx"/>
</connections>
</button>
<textField verticalHuggingPriority="750" id="1479">
<rect key="frame" x="14" y="76" width="100" height="17"/>
<textField verticalHuggingPriority="750" misplaced="YES" id="1479">
<rect key="frame" x="14" y="76" width="166" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Quick Caching:" id="1480">
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Quick Caching (BBC Only):" id="1480">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button id="1481">
<rect key="frame" x="117" y="75" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="1482">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="668" name="value" keyPath="values.QuickCache" id="1483"/>
</connections>
</button>
<textField verticalHuggingPriority="750" id="1484">
<rect key="frame" x="14" y="51" width="291" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
Expand Down Expand Up @@ -1905,6 +1894,17 @@
<binding destination="668" name="value" keyPath="values.CacheITV_TV" id="jRb-OC-Zbd"/>
</connections>
</button>
<button misplaced="YES" id="1481">
<rect key="frame" x="183" y="74" width="22" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="1482">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="668" name="value" keyPath="values.QuickCache" id="1483"/>
</connections>
</button>
</subviews>
</view>
</tabViewItem>
Expand Down Expand Up @@ -2571,10 +2571,10 @@
<binding destination="668" name="value" keyPath="values.TestProxy" id="1538"/>
</connections>
</button>
<button misplaced="YES" id="Ub7-bz-5JJ">
<button hidden="YES" misplaced="YES" id="Ub7-bz-5JJ">
<rect key="frame" x="15" y="436" width="225" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Use Alternate ITV Cache Refresh:" bezelStyle="regularSquare" imagePosition="right" alignment="left" inset="2" id="Q4c-MN-xPg" userLabel="Use Alternate ITV Cache Refresh:">
<buttonCell key="cell" type="check" title="Use Alternate ITV Cache Refresh:" bezelStyle="regularSquare" imagePosition="right" alignment="left" state="on" inset="2" id="Q4c-MN-xPg" userLabel="Use Alternate ITV Cache Refresh:">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
Expand Down

0 comments on commit f7e4259

Please sign in to comment.