{"action":"created","issue":{"url":"https://api.github.com/repos/lingochamp/FileDownloader/issues/335","repository_url":"https://api.github.com/repos/lingochamp/FileDownloader","labels_url":"https://api.github.com/repos/lingochamp/FileDownloader/issues/335/labels{/name}","comments_url":"https://api.github.com/repos/lingochamp/FileDownloader/issues/335/comments","events_url":"https://api.github.com/repos/lingochamp/FileDownloader/issues/335/events","html_url":"https://github.com/lingochamp/FileDownloader/issues/335","id":179988512,"number":335,"title":"我快疯了，完全不知道怎么用您的框架放到我的服务里做下载","user":{"login":"qssq","id":14260426,"avatar_url":"https://avatars.githubusercontent.com/u/14260426?v=3","gravatar_id":"","url":"https://api.github.com/users/qssq","html_url":"https://github.com/qssq","followers_url":"https://api.github.com/users/qssq/followers","following_url":"https://api.github.com/users/qssq/following{/other_user}","gists_url":"https://api.github.com/users/qssq/gists{/gist_id}","starred_url":"https://api.github.com/users/qssq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qssq/subscriptions","organizations_url":"https://api.github.com/users/qssq/orgs","repos_url":"https://api.github.com/users/qssq/repos","events_url":"https://api.github.com/users/qssq/events{/privacy}","received_events_url":"https://api.github.com/users/qssq/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lingochamp/FileDownloader/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":23,"created_at":"2016-09-29T08:53:53Z","updated_at":"2016-09-29T14:44:42Z","closed_at":"2016-09-29T14:29:26Z","body":"请问多线程下载  暂停的方法是啥？\r\n继续的方法是啥 ？\r\n永久移除队列 也就是以后不继续下载了，彻底清除的方法是啥？\r\n多线程下载的方法是啥？\r\n根据id删除 id获取的方法是啥。"},"comment":{"url":"https://api.github.com/repos/lingochamp/FileDownloader/issues/comments/250487333","html_url":"https://github.com/lingochamp/FileDownloader/issues/335#issuecomment-250487333","issue_url":"https://api.github.com/repos/lingochamp/FileDownloader/issues/335","id":250487333,"user":{"login":"qssq","id":14260426,"avatar_url":"https://avatars.githubusercontent.com/u/14260426?v=3","gravatar_id":"","url":"https://api.github.com/users/qssq","html_url":"https://github.com/qssq","followers_url":"https://api.github.com/users/qssq/followers","following_url":"https://api.github.com/users/qssq/following{/other_user}","gists_url":"https://api.github.com/users/qssq/gists{/gist_id}","starred_url":"https://api.github.com/users/qssq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qssq/subscriptions","organizations_url":"https://api.github.com/users/qssq/orgs","repos_url":"https://api.github.com/users/qssq/repos","events_url":"https://api.github.com/users/qssq/events{/privacy}","received_events_url":"https://api.github.com/users/qssq/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T14:44:42Z","updated_at":"2016-09-29T14:44:42Z","body":"我现在是这样写的，还没有测试 ,ui那边绑定了服务之后调用者2个方法。 \r\n\r\n`\r\n  public boolean continueDownload(String url, IResultCallBack callBack) {\r\n            if (mDownloadMaps.get(url) != null) {\r\n                FileDownloader.getImpl().start(mDownloadMaps.get(url), false);\r\n                callBack.onSucc();\r\n                return true;\r\n            } else {\r\n                callBack.onFail(\"抱歉,下载队列中并没有存在此数据\");\r\n                return false;\r\n            }\r\n\r\n        }\r\n\r\n        @Override\r\n        public boolean startDownload(String url, IResultCallBack callBack) {\r\n            if (url == null) {\r\n                callBack.onFail(\"地址错误\");\r\n                return false;\r\n            }\r\n            FileDownloadListener fileDownloadListener = mDownloadMaps.get(url);\r\n /*           LocalMusicInfo info = dbUtils.queryByColumn(LocalMusicInfo.class, \"\", url);\r\n            if (info == null || isEmptyFiled(info.getLocalurl())) {\r\n                BaseDownloadTask baseDownloadTask = FileDownloader.getImpl().create(url);\r\n                taskDownloadListener\r\n                baseDownloadTask.addFinishListener(new)\r\n                //只有下载完成的才保存到数据库里面去？\r\n\r\n            }*/\r\n            if (fileDownloadListener == null) {\r\n\r\n                //创建数据\r\n                int id = urlToId(url);\r\n                LocalMusicInfo queryFromDb = dbUtils.queryByID(LocalMusicInfo.class, id);\r\n                if (queryFromDb == null) {\r\n                    queryFromDb = new LocalMusicInfo();\r\n                    queryFromDb.setNeturl(url);\r\n                    long insert = dbUtils.insert(queryFromDb);\r\n                    if (insert > 0) {\r\n                        if (mDownloadMaps.get(url) != null) {\r\n                            callBack.onFail(\"数据库不存在，但是下载队列已存在\");\r\n                            return false;\r\n                        }\r\n                        MyFileDownloadListener dListener = new MyFileDownloadListener();\r\n                        dListener.setInfo(queryFromDb);\r\n                        mDownloadMaps.put(url, dListener);\r\n                        FileDownloader.getImpl().create(url).setListener(dListener).start();\r\n                        Log.i(TAG, \"下载新数据\");\r\n//                    iNotify.onNotify(Pair.create(true, \"加入下载队列 成功\"));\r\n                    } else {\r\n                        callBack.onFail(\"抱歉,数据库出现错误\" + insert);\r\n                        return false;\r\n//                    dListener.setIdListener(null);\r\n                    }\r\n                }\r\n            } else {\r\n                callBack.onSucc();\r\n                Log.i(TAG, \"继续下载\");\r\n                FileDownloader.getImpl().start(fileDownloadListener, false);\r\n\r\n            }\r\n            return false;\r\n        }\r\n`"}}
{"actor":{"display_login":"qssq"}}