Skip to content

Commit

Permalink
1.1.4 - Update SDWebImage
Browse files Browse the repository at this point in the history
Only remove account if the account information
refresh fails with a 403 or 401 error.
  • Loading branch information
香風智乃 authored and 香風智乃 committed Jan 26, 2019
1 parent c0d4031 commit ef0bcee
Show file tree
Hide file tree
Showing 34 changed files with 587 additions and 361 deletions.
28 changes: 28 additions & 0 deletions Dependencies/SDWebImage-master/.github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- important
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.
If this is still an issue, please make sure it is up to date and if so,
add a comment that this is still an issue to keep it open.
Thank you for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
pulls:
daysUntilStale: 60
markComment: >
This pull request has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.
If this is still applicable, please make sure it is up to date and if so,
add a comment that this is still an issue to keep it open.
Thank you for your contributions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* This file is part of the SDWebImage package.
* (c) Olivier Poitrey <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

#import "SDWebImageCompat.h"

@interface UIImage (MemoryCacheCost)

/**
The memory cache cost for specify image used by image cache. The cost function is the pixles count held in memory.
If you set some associated object to `UIImage`, you can set the custom value to indicate the memory cost.
For `UIImage`, this method return the single frame pixles count when `image.images` is nil for static image. Retuen full frame pixels count when `image.images` is not nil for animated image.
For `NSImage`, this method return the single frame pixels count because `NSImage` does not store all frames in memory.
@note Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods.
*/
@property (assign, nonatomic) NSUInteger sd_memoryCost;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* This file is part of the SDWebImage package.
* (c) Olivier Poitrey <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

#import "UIImage+MemoryCacheCost.h"
#import "objc/runtime.h"

FOUNDATION_STATIC_INLINE NSUInteger SDMemoryCacheCostForImage(UIImage *image) {
#if SD_MAC
return image.size.height * image.size.width;
#elif SD_UIKIT || SD_WATCH
NSUInteger imageSize = image.size.height * image.size.width * image.scale * image.scale;
return image.images ? (imageSize * image.images.count) : imageSize;
#endif
}

@implementation UIImage (MemoryCacheCost)

- (NSUInteger)sd_memoryCost {
NSNumber *value = objc_getAssociatedObject(self, @selector(sd_memoryCost));
NSUInteger memoryCost;
if (value != nil) {
memoryCost = [value unsignedIntegerValue];
} else {
memoryCost = SDMemoryCacheCostForImage(self);
}
return memoryCost;
}

- (void)setSd_memoryCost:(NSUInteger)sd_memoryCost {
objc_setAssociatedObject(self, @selector(sd_memoryCost), @(sd_memoryCost), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

@end
4 changes: 2 additions & 2 deletions Dependencies/SDWebImage-master/WebImage/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.4.2</string>
<string>4.4.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>4.4.2</string>
<string>4.4.3</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
Expand Down
1 change: 1 addition & 0 deletions Dependencies/SDWebImage-master/WebImage/SDWebImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ FOUNDATION_EXPORT const unsigned char WebImageVersionString[];
#import <SDWebImage/SDWebImagePrefetcher.h>
#import <SDWebImage/UIView+WebCacheOperation.h>
#import <SDWebImage/UIImage+MultiFormat.h>
#import <SDWebImage/UIImage+MemoryCacheCost.h>
#import <SDWebImage/SDWebImageOperation.h>
#import <SDWebImage/SDWebImageDownloader.h>
#import <SDWebImage/SDWebImageTransition.h>
Expand Down
34 changes: 17 additions & 17 deletions Shukofukurou-IOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@
5962422721556514001995AD /* SearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5962420D21556510001995AD /* SearchViewController.m */; };
5962422821556514001995AD /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5962421021556512001995AD /* ViewController.m */; };
5962422C2155653D001995AD /* Hiyoko.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 5962422A2155653D001995AD /* Hiyoko.xcdatamodeld */; };
59624230215565C7001995AD /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 596240F721556317001995AD /* SDWebImage.framework */; };
59624231215565C7001995AD /* SDWebImage.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 596240F721556317001995AD /* SDWebImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
59624235215565CC001995AD /* SAMKeychain.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 596241092155631F001995AD /* SAMKeychain.framework */; };
59624236215565CC001995AD /* SAMKeychain.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 596241092155631F001995AD /* SAMKeychain.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
59624239215565D2001995AD /* CoreActionSheetPicker.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5962411C21556329001995AD /* CoreActionSheetPicker.framework */; };
Expand Down Expand Up @@ -118,6 +116,8 @@
59AEEA082156CFBD005D99D5 /* ThirdParty.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 59AEEA072156CFBD005D99D5 /* ThirdParty.rtf */; };
59AEEA0B2156D2CB005D99D5 /* ThirdPartyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 59AEEA0A2156D2CB005D99D5 /* ThirdPartyViewController.m */; };
59D9159F2162C1B800B5A61B /* UILabel+Copyable.m in Sources */ = {isa = PBXBuildFile; fileRef = 59D9159D2162C1B800B5A61B /* UILabel+Copyable.m */; };
59E7718621FBD81C007EB353 /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 596240F721556317001995AD /* SDWebImage.framework */; };
59E7718721FBD81C007EB353 /* SDWebImage.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 596240F721556317001995AD /* SDWebImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
59FE3E3A219B287E0035E2E5 /* AiringNotifySettingsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 59FE3E39219B287E0035E2E5 /* AiringNotifySettingsTableViewController.m */; };
59FE3E4F219B39C50035E2E5 /* AiringNotificationServiceSelector.m in Sources */ = {isa = PBXBuildFile; fileRef = 59FE3E4E219B39C50035E2E5 /* AiringNotificationServiceSelector.m */; };
59FE3E52219B65990035E2E5 /* NotifyingTitlesTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 59FE3E51219B65990035E2E5 /* NotifyingTitlesTableViewController.m */; };
Expand Down Expand Up @@ -300,13 +300,6 @@
remoteGlobalIDString = C63EE56B1BBA07ED008F46BB;
remoteInfo = MGSwipeTableCell;
};
59624232215565C7001995AD /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 596240E921556317001995AD /* SDWebImage.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 4A2CADFE1AB4BB5300B6BC39;
remoteInfo = "SDWebImage iOS";
};
59624237215565CC001995AD /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 596240FE2155631F001995AD /* SAMKeychain.xcodeproj */;
Expand Down Expand Up @@ -342,6 +335,13 @@
remoteGlobalIDString = C63EE56A1BBA07ED008F46BB;
remoteInfo = MGSwipeTableCell;
};
59E7718821FBD81C007EB353 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 596240E921556317001995AD /* SDWebImage.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 4A2CADFE1AB4BB5300B6BC39;
remoteInfo = "SDWebImage iOS";
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -355,8 +355,8 @@
5962423A215565D2001995AD /* CoreActionSheetPicker.framework in Embed Frameworks */,
5962423E215565D7001995AD /* AFNetworking.framework in Embed Frameworks */,
59624236215565CC001995AD /* SAMKeychain.framework in Embed Frameworks */,
59E7718721FBD81C007EB353 /* SDWebImage.framework in Embed Frameworks */,
59624246215565E3001995AD /* LGSideMenuController.framework in Embed Frameworks */,
59624231215565C7001995AD /* SDWebImage.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -579,8 +579,8 @@
59624239215565D2001995AD /* CoreActionSheetPicker.framework in Frameworks */,
5962423D215565D7001995AD /* AFNetworking.framework in Frameworks */,
59624235215565CC001995AD /* SAMKeychain.framework in Frameworks */,
59E7718621FBD81C007EB353 /* SDWebImage.framework in Frameworks */,
59624245215565E3001995AD /* LGSideMenuController.framework in Frameworks */,
59624230215565C7001995AD /* SDWebImage.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1060,12 +1060,12 @@
buildRules = (
);
dependencies = (
59624233215565C7001995AD /* PBXTargetDependency */,
59624238215565CC001995AD /* PBXTargetDependency */,
5962423C215565D2001995AD /* PBXTargetDependency */,
59624240215565D7001995AD /* PBXTargetDependency */,
59624248215565E3001995AD /* PBXTargetDependency */,
5962424C215565E9001995AD /* PBXTargetDependency */,
59E7718921FBD81C007EB353 /* PBXTargetDependency */,
);
name = "Shukofukurou-IOS";
productName = "Shukofukurou-IOS";
Expand Down Expand Up @@ -1475,11 +1475,6 @@
target = 596240A42155622E001995AD /* Shukofukurou-IOS */;
targetProxy = 596240C12155622F001995AD /* PBXContainerItemProxy */;
};
59624233215565C7001995AD /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "SDWebImage iOS";
targetProxy = 59624232215565C7001995AD /* PBXContainerItemProxy */;
};
59624238215565CC001995AD /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "SAMKeychain-iOS";
Expand All @@ -1505,6 +1500,11 @@
name = MGSwipeTableCell;
targetProxy = 5962424B215565E9001995AD /* PBXContainerItemProxy */;
};
59E7718921FBD81C007EB353 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "SDWebImage iOS";
targetProxy = 59E7718821FBD81C007EB353 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
Expand Down
6 changes: 4 additions & 2 deletions Shukofukurou-IOS/Backend/AniList.m
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,10 @@ + (void)saveuserinfoforcurrenttoken {
}
}
else {
// Remove Account
[self removeAccount];
if ([[error.userInfo valueForKey:@"NSLocalizedDescription"] isEqualToString:@"Request failed: unauthorized (401)"] || [[error.userInfo valueForKey:@"NSLocalizedDescription"] isEqualToString:@"Request failed: forbidden (403)"]) {
// Remove Account
[self removeAccount];
}
}
}
@end
6 changes: 4 additions & 2 deletions Shukofukurou-IOS/Backend/Kitsu.m
Original file line number Diff line number Diff line change
Expand Up @@ -770,8 +770,10 @@ + (void)saveuserinfoforcurrenttoken {
}
}
else {
// Remove Account
[self removeAccount];
if ([[error.userInfo valueForKey:@"NSLocalizedDescription"] isEqualToString:@"Request failed: unauthorized (401)"] || [[error.userInfo valueForKey:@"NSLocalizedDescription"] isEqualToString:@"Request failed: forbidden (403)"]) {
// Remove Account
[self removeAccount];
}
}
}
@end
2 changes: 1 addition & 1 deletion Shukofukurou-IOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.3</string>
<string>1.1.4</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CoreActionSheetPicker.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>15</integer>
<integer>9</integer>
</dict>
</dict>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>MGSwipeTableCell.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>16</integer>
<integer>10</integer>
</dict>
</dict>
</dict>
Expand Down
Empty file modified dependencies/SDWebImage-master/.gitattributes
100755 → 100644
Empty file.
Empty file modified dependencies/SDWebImage-master/.github/CONTRIBUTING.md
100755 → 100644
Empty file.
Empty file modified dependencies/SDWebImage-master/.github/ISSUE_TEMPLATE.md
100755 → 100644
Empty file.
Empty file modified dependencies/SDWebImage-master/.github/PULL_REQUEST_TEMPLATE.md
100755 → 100644
Empty file.
Empty file modified dependencies/SDWebImage-master/.gitignore
100755 → 100644
Empty file.
Empty file modified dependencies/SDWebImage-master/.gitmodules
100755 → 100644
Empty file.
Empty file modified dependencies/SDWebImage-master/.travis.yml
100755 → 100644
Empty file.
Loading

0 comments on commit ef0bcee

Please sign in to comment.