Skip to content

Commit

Permalink
pod 准备发版 2.0.0-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
onezens committed Sep 14, 2018
1 parent ba2a3e1 commit 216221f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,15 @@ YCDownloadTask *task = [[YCDownloader downloader] downloadWithUrl:@"download_url
1. 单文件下载测试
![单文件下载测试](http: //src.onezen.cc/demo/download/1.gif)
![单文件下载测试](http://src.onezen.cc/demo/download/1.gif)
2. 多视频下载测试
![多视频下载测试](http:// src.onezen.cc/demo/download/2.gif)
![多视频下载测试](http://src.onezen.cc/demo/download/2.gif)
3. 下载通知
![下载通知](http:// src.onezen.cc/demo/download/4.png)
![下载通知](http://src.onezen.cc/demo/download/4.png)
## TODO
Expand Down
2 changes: 1 addition & 1 deletion YCDownloadSession.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Pod::Spec.new do |s|
s.license = "MIT"
s.author = { "onezens" => "[email protected]" }
s.platform = :ios, "8.0"
s.source = { :git => "https://github.com/onezens/YCDownloadSession.git", :branch => "master" }
s.source = { :git => "https://github.com/onezens/YCDownloadSession.git", :tag => "#{s.version}" }
s.requires_arc = true

s.subspec 'Core' do |c|
Expand Down
2 changes: 1 addition & 1 deletion YCDownloadSession/YCDownloadItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ - (YCProgressHandler)progressHandler {
if(weakSelf.downloadStatus == YCDownloadStatusWaiting){
[weakSelf downloadStatusChanged:YCDownloadStatusDownloading downloadTask:nil];
}
[weakSelf downloadProgress:task downloadedSize:progress.completedUnitCount fileSize:progress.totalUnitCount];
[weakSelf downloadProgress:task downloadedSize:(NSUInteger)progress.completedUnitCount fileSize:(NSUInteger)progress.totalUnitCount];
};
}

Expand Down
6 changes: 3 additions & 3 deletions YCDownloadSession/core/YCDownloadTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ + (instancetype)taskWithRequest:(NSURLRequest *)request progress:(YCProgressHand
#pragma mark - public

- (void)updateTask {
_fileSize = [_downloadTask.response expectedContentLength];
_fileSize = (NSUInteger)[_downloadTask.response expectedContentLength];
}

#pragma mark - setter
Expand Down Expand Up @@ -212,7 +212,7 @@ + (NSData *)correctRequestData:(NSData *)data
NSMutableDictionary *dic = arr[1];
id obj = [dic objectForKey:[NSString stringWithFormat:@"__nsurlrequest_proto_prop_obj_%ld",(long)i]];
if (obj) {
[dic setValue:obj forKey:[NSString stringWithFormat:@"$%zd",i+k]];
[dic setValue:obj forKey:[NSString stringWithFormat:@"$%ld",i+k]];
[dic removeObjectForKey:[NSString stringWithFormat:@"__nsurlrequest_proto_prop_obj_%ld",(long)i]];
[arr replaceObjectAtIndex:1 withObject:dic];
archive[@"$objects"] = arr;
Expand All @@ -224,7 +224,7 @@ + (NSData *)correctRequestData:(NSData *)data
NSMutableDictionary *dic = arr[1];
id obj = [dic objectForKey:@"__nsurlrequest_proto_props"];
if (obj) {
[dic setValue:obj forKey:[NSString stringWithFormat:@"$%zd",i+k]];
[dic setValue:obj forKey:[NSString stringWithFormat:@"$%ld",i+k]];
[dic removeObjectForKey:@"__nsurlrequest_proto_props"];
[arr replaceObjectAtIndex:1 withObject:dic];
archive[@"$objects"] = arr;
Expand Down
6 changes: 3 additions & 3 deletions YCDownloadSession/core/YCDownloadUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ + (YCDownloadItem *)itemWithDict:(NSDictionary *)dict {
+ (NSArray <YCDownloadItem *> *)fetchAllDownloadedItemWithUid:(NSString *)uid {
__block NSMutableArray *results = [NSMutableArray array];
[self performBlock:^BOOL{
NSString *sql = [NSString stringWithFormat:@"select * from downloadItem where downloadStatus == %ld and uid == '%@' ORDER BY createTime", YCDownloadStatusFinished, uid];
NSString *sql = [NSString stringWithFormat:@"select * from downloadItem where downloadStatus == %lu and uid == '%@' ORDER BY createTime", YCDownloadStatusFinished, uid];
NSArray *rel = [self selectSql:sql];
[rel enumerateObjectsUsingBlock:^(NSDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
YCDownloadItem *item = [self itemWithDict:obj];
Expand All @@ -351,7 +351,7 @@ + (YCDownloadItem *)itemWithDict:(NSDictionary *)dict {
+ (NSArray <YCDownloadItem *> *)fetchAllDownloadingItemWithUid:(NSString *)uid {
__block NSMutableArray *results = [NSMutableArray array];
[self performBlock:^BOOL{
NSString *sql = [NSString stringWithFormat:@"select * from downloadItem where downloadStatus != %ld and uid == '%@' ORDER BY createTime",YCDownloadStatusFinished, uid];
NSString *sql = [NSString stringWithFormat:@"select * from downloadItem where downloadStatus != %lu and uid == '%@' ORDER BY createTime",YCDownloadStatusFinished, uid];
NSArray *rel = [self selectSql:sql];
[rel enumerateObjectsUsingBlock:^(NSDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
YCDownloadItem *item = [self itemWithDict:obj];
Expand Down Expand Up @@ -545,7 +545,7 @@ + (YCDownloadTask *)taskWithTid:(NSString *)tid {
+ (NSArray *)taskWithStid:(NSInteger)stid {
NSMutableArray *tasks = [NSMutableArray array];
[self performBlock:^BOOL{
NSString *sql = [NSString stringWithFormat:@"select * from downloadTask where stid == %zd", stid];
NSString *sql = [NSString stringWithFormat:@"select * from downloadTask where stid == %ld", stid];
NSArray *rel = [self selectSql:sql];
[rel enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
YCDownloadTask *task = [self taskWithDict:rel.firstObject];
Expand Down
2 changes: 1 addition & 1 deletion YCDownloadSession/core/YCDownloader.m
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ - (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTas
NSUInteger fileSize = [YCDownloadUtils fileSizeWithPath:localPath];
NSError *error = nil;
if (fileSize>0 && fileSize != task.fileSize) {
NSString *errStr = [NSString stringWithFormat:@"[YCDownloader didFinishDownloadingToURL] fileSize Error, task fileSize: %zd tmp fileSize: %zd", task.fileSize, fileSize];
NSString *errStr = [NSString stringWithFormat:@"[YCDownloader didFinishDownloadingToURL] fileSize Error, task fileSize: %lu tmp fileSize: %lu", (unsigned long)task.fileSize, fileSize];
NSLog(@"%@",errStr);
error = [NSError errorWithDomain:errStr code:10001 userInfo:nil];
localPath = nil;
Expand Down

0 comments on commit 216221f

Please sign in to comment.