diff --git a/Sparkle/SUAppcastItem.m b/Sparkle/SUAppcastItem.m index 241f2edf..d58efc76 100644 --- a/Sparkle/SUAppcastItem.m +++ b/Sparkle/SUAppcastItem.m @@ -84,7 +84,7 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT _versionString = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastItemVersionStringKey] copy]; _osString = [(NSString *)[decoder decodeObjectOfClass:[NSString class] forKey:SUAppcastAttributeOsType] copy]; _propertiesDictionary = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSDictionary class], [NSString class], [NSDate class], [NSArray class]]] forKey:SUAppcastItemPropertiesKey]; - _phasedRolloutInterval = [decoder decodeObjectOfClass:[NSNumber class] forKey:SUAppcastAttributePhasedRolloutInterval]; + _phasedRolloutInterval = [decoder decodeObjectOfClass:[NSNumber class] forKey:SUAppcastElementPhasedRolloutInterval]; } return self; @@ -155,7 +155,7 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT } if (self.phasedRolloutInterval != nil) { - [encoder encodeObject:self.phasedRolloutInterval forKey:SUAppcastAttributePhasedRolloutInterval]; + [encoder encodeObject:self.phasedRolloutInterval forKey:SUAppcastElementPhasedRolloutInterval]; } } @@ -294,6 +294,11 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT _minimumSystemVersion = [(NSString *)[dict objectForKey:SUAppcastElementMinimumSystemVersion] copy]; _maximumSystemVersion = [(NSString *)[dict objectForKey:SUAppcastElementMaximumSystemVersion] copy]; _minimumAutoupdateVersion = [(NSString *)[dict objectForKey:SUAppcastElementMinimumAutoupdateVersion] copy]; + + NSString* rolloutIntervalString = [(NSString *)[dict objectForKey:SUAppcastElementPhasedRolloutInterval] copy]; + if (rolloutIntervalString != nil) { + _phasedRolloutInterval = @(rolloutIntervalString.integerValue); + } NSString *shortVersionString = [enclosure objectForKey:SUAppcastAttributeShortVersionString]; if (nil == shortVersionString) { @@ -317,11 +322,6 @@ static NSString *SUAppcastItemInstallationTypeKey = @"SUAppcastItemInstallationT } else if ([_installationType isEqualToString:SPUInstallationTypeInteractivePackage]) { SULog(SULogLevelDefault, @"warning: '%@' for %@ is deprecated. Use '%@' instead.", SPUInstallationTypeInteractivePackage, SUAppcastAttributeInstallationType, SPUInstallationTypeGuidedPackage); } - - NSString* enclosureRolloutIntervalString = [enclosure objectForKey:SUAppcastAttributePhasedRolloutInterval]; - if (enclosureRolloutIntervalString != nil) { - _phasedRolloutInterval = @(enclosureRolloutIntervalString.integerValue); - } // Find the appropriate release notes URL. NSString *releaseNotesString = [dict objectForKey:SUAppcastElementReleaseNotesLink]; diff --git a/Sparkle/SUConstants.h b/Sparkle/SUConstants.h index 1a5f398e..7f5b8246 100644 --- a/Sparkle/SUConstants.h +++ b/Sparkle/SUConstants.h @@ -82,7 +82,7 @@ extern NSString *const SUAppcastElementMinimumSystemVersion; extern NSString *const SUAppcastElementMaximumSystemVersion; extern NSString *const SUAppcastElementReleaseNotesLink; extern NSString *const SUAppcastElementTags; -extern NSString *const SUAppcastAttributePhasedRolloutInterval; +extern NSString *const SUAppcastElementPhasedRolloutInterval; extern NSString *const SURSSAttributeURL; extern NSString *const SURSSAttributeLength; diff --git a/Sparkle/SUConstants.m b/Sparkle/SUConstants.m index 23624c3f..990244f1 100644 --- a/Sparkle/SUConstants.m +++ b/Sparkle/SUConstants.m @@ -75,7 +75,7 @@ NSString *const SUAppcastElementMinimumSystemVersion = @"sparkle:minimumSystemVe NSString *const SUAppcastElementMaximumSystemVersion = @"sparkle:maximumSystemVersion"; NSString *const SUAppcastElementReleaseNotesLink = @"sparkle:releaseNotesLink"; NSString *const SUAppcastElementTags = @"sparkle:tags"; -NSString *const SUAppcastAttributePhasedRolloutInterval = @"sparkle:phasedRolloutInterval"; +NSString *const SUAppcastElementPhasedRolloutInterval = @"sparkle:phasedRolloutInterval"; NSString *const SURSSAttributeURL = @"url"; NSString *const SURSSAttributeLength = @"length"; diff --git a/Tests/Resources/testappcast.xml b/Tests/Resources/testappcast.xml index ba3ff109..d602ba7b 100644 --- a/Tests/Resources/testappcast.xml +++ b/Tests/Resources/testappcast.xml @@ -12,7 +12,8 @@ Version 3.0 - + 86400 +