Giter Club home page Giter Club logo

zfdownload's Introduction

renzifeng

个人blog源码

zfdownload's People

Contributors

renzifeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zfdownload's Issues

ZFSessionModel优化及部分建议

看了一下代码,认为有可以优化的地方,具体如下:

  1. ZFSessionModel.h中,calculateFileSizeInUnitcalculateUnit两个方法改成类方法
  2. ZFSessionModel.m中,具体实现如下:
#define kZFGBSize  (1024 * 1024 * 1024)
#define kZFMBSize  (1024 * 1024)

+ (float)calculateFileSizeInUnit:(unsigned long long)contentLength
{
    if(contentLength >= kZFGBSize)       { return (float) (contentLength / (float)kZFGBSize); }
    else if (contentLength >= kZFMBSize) { return (float) (contentLength / (float)kZFMBSize); }
    else if (contentLength >= 1024)      { return (float) (contentLength / (float)1024); }
    else                                 { return (float) (contentLength); }
}

+ (NSString *)calculateUnit:(unsigned long long)contentLength
{
    if(contentLength >= kZFGBSize)      { return @"GB"; }
    else if(contentLength >= kZFMBSize) { return @"MB"; }
    else if(contentLength >= 1024)      { return @"KB"; }
    else                                { return @"B";  }
}

同时,个人认为DownloadState枚举最好更改为如下,以防止名称冲突:

typedef NS_ENUM(NSInteger, ZFDownloadState){
    ZFDownloadStateStart = 0,     /** 下载中 */
    ZFDownloadStateSuspended,     /** 下载暂停 */
    ZFDownloadStateCompleted,     /** 下载完成 */
    ZFDownloadStateFailed         /** 下载失败 */
};

下载显示的问题

下载时永远显示正在获取,但实际在下载(有网络请求,看截图),因为过段时间后会下载完成,且下载中/下载完成后总大小错误.........这是服务器的问题吗?但一直都有网络请求(下载你给的那些网址没问题)
2017-07-13 10 51 58
2017-07-13 10 57 18
2017-07-13 11 03 13

考虑下增加 下载的顺序 全部开始 可选从列表第一个 或者顺序下来

考虑下增加 下载的顺序 全部开始 可选从列表第一个 或者顺序下来
如最多一个下载:
正在下载的不是在第一个,其他的等待,下载完成一定是从列表最顶上可下载的开始下载
全部暂停 全部开始 从来都是 从第一个 开始,没有保存上一次的状态

退出程序 程序重新进入,全部状态都是暂停这个不错。

作者可以考虑下,顺序 以及 保存上次下载状态这个东西

控件刷新问题

连续暂停和下载切换时,暂停和下载图标切换有问题

大神,求更新AFN

项目中用到了另一个大神写的,用的系统的框架,结果出了不少问题,占用内存过大,而且不释放,用ZF测试了下发现没有这个问题,但是zf是ASI为基础,大神能不能出一个AFN的呢?

startLoad多次执行

请问作者,对startLoad没进行调用,自动执行多次,是什么原因呢?比如执行一次- (void)resumeRequest:(ZFHttpRequest *)request后,startLoad会执行两次.

为下载文件换一个文件名

把保存的文件的名字换成自定义的话,下载的方法的block就不走了.PS:我把文件名字添加在下载的方法函数中- (void)download:(NSString *)url progress:(ZFDownloadProgressBlock)progressBlock state:(ZFDownloadStateBlock)stateBlock fileName:(NSString *)name;

调用startLoad方法会出现此bug

Trapped uncaught exception 'NSGenericException', reason: '*** Collection <__NSArrayM: 0x60000044a860> was mutated while being enumerated.'
[
0 CoreFoundation 0x000000010df5ed4b __exceptionPreprocess + 171,
1 libobjc.A.dylib 0x0000000112cde21e objc_exception_throw + 48,
2 CoreFoundation 0x000000010dfc7f6c __NSFastEnumerationMutationHandler + 124,
3 WLMaster 0x000000010c46f6f5 -[ZFDownloadManager startLoad] + 1493,
4 WLMaster 0x000000010c46c895 -[ZFDownloadManager downFileUrl:filename:videoId:completeBlock:] + 2229,
5 WLMaster 0x000000010c563acd -[WLVideoCacheManager downloadWithData:completeBlock:] + 1325,
6 WLMaster 0x000000010c562fa5 __63-[WLVideoCacheManager addDownTaskToDispatchSemaphoreWithModle:]_block_invoke + 261,
7 libdispatch.dylib 0x000000011437f978 _dispatch_call_block_and_release + 12,
8 libdispatch.dylib 0x00000001143a90cd _dispatch_client_callout + 8,
9 libdispatch.dylib 0x0000000114388312 _dispatch_queue_override_invoke + 1426,
10 libdispatch.dylib 0x000000011438a385 _dispatch_root_queue_drain + 720,
11 libdispatch.dylib 0x000000011438a059 _dispatch_worker_thread3 + 123,
12 libsystem_pthread.dylib 0x0000000114758712 _pthread_wqthread + 1299,
13 libsystem_pthread.dylib 0x00000001147581ed start_wqthread + 13
]

pod(v1.0.1) 编译错误

使用pod(v1.0.1)时,出现如下错误:

-->
/xxx/Pods/ZFDownload/ZFDownload/ZFHttpRequest.h:25:9: Could not build module 'ASIHTTPRequest'

XCode version : 7.3.1
OSX : 10.11.6

Ps:仅仅使用ZFPlayer时 正常

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.