{"action":"created","comment":{"url":"https://api.github.com/repos/novoda/download-manager/pulls/comments/33021188","id":33021188,"diff_hunk":"@@ -40,6 +41,7 @@ protected void onCreate(Bundle savedInstanceState) {\n \n     private void setupDownloadingExample() {\n         Uri uri = Uri.parse(BIG_FILE);\n+        final DownloadBatch batch = new DownloadBatch(\"Title woo\", \"Description lols\", BBC_COMEDY_IMAGE);","path":"demo_serial/src/main/java/com/novoda/downloadmanager/demo/serial/MainActivity.java","position":21,"original_position":21,"commit_id":"b4c32f67794880e227ec3ba82c11cb989abadab7","original_commit_id":"b4c32f67794880e227ec3ba82c11cb989abadab7","user":{"login":"Electryc","id":913571,"avatar_url":"https://avatars.githubusercontent.com/u/913571?v=3","gravatar_id":"","url":"https://api.github.com/users/Electryc","html_url":"https://github.com/Electryc","followers_url":"https://api.github.com/users/Electryc/followers","following_url":"https://api.github.com/users/Electryc/following{/other_user}","gists_url":"https://api.github.com/users/Electryc/gists{/gist_id}","starred_url":"https://api.github.com/users/Electryc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Electryc/subscriptions","organizations_url":"https://api.github.com/users/Electryc/orgs","repos_url":"https://api.github.com/users/Electryc/repos","events_url":"https://api.github.com/users/Electryc/events{/privacy}","received_events_url":"https://api.github.com/users/Electryc/received_events","type":"User","site_admin":false},"body":"These were just for testing, but yes, you're right. \r\nDo you think we should make a separate demo app when all this feature is implemented? ","created_at":"2015-06-23T08:51:00Z","updated_at":"2015-06-23T08:51:00Z","html_url":"https://github.com/novoda/download-manager/pull/35#discussion_r33021188","pull_request_url":"https://api.github.com/repos/novoda/download-manager/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/novoda/download-manager/pulls/comments/33021188"},"html":{"href":"https://github.com/novoda/download-manager/pull/35#discussion_r33021188"},"pull_request":{"href":"https://api.github.com/repos/novoda/download-manager/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/novoda/download-manager/pulls/35","id":38246367,"html_url":"https://github.com/novoda/download-manager/pull/35","diff_url":"https://github.com/novoda/download-manager/pull/35.diff","patch_url":"https://github.com/novoda/download-manager/pull/35.patch","issue_url":"https://api.github.com/repos/novoda/download-manager/issues/35","number":35,"state":"open","locked":false,"title":"Batch requests","user":{"login":"Electryc","id":913571,"avatar_url":"https://avatars.githubusercontent.com/u/913571?v=3","gravatar_id":"","url":"https://api.github.com/users/Electryc","html_url":"https://github.com/Electryc","followers_url":"https://api.github.com/users/Electryc/followers","following_url":"https://api.github.com/users/Electryc/following{/other_user}","gists_url":"https://api.github.com/users/Electryc/gists{/gist_id}","starred_url":"https://api.github.com/users/Electryc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Electryc/subscriptions","organizations_url":"https://api.github.com/users/Electryc/orgs","repos_url":"https://api.github.com/users/Electryc/repos","events_url":"https://api.github.com/users/Electryc/events{/privacy}","received_events_url":"https://api.github.com/users/Electryc/received_events","type":"User","site_admin":false},"body":"**This is currently work in progress towards enabling the download manager to handle batched downloads and to progress with the implementation of the feature hence this is opened against a feature branch.**\r\n\r\nFor now, each `Request` needs a `batchId` in order to be mapped to a specific batch. *This will be changed in a following PR where the download manager will handle only batches, but not individual requests*. \r\n\r\nThis particular PR focuses more on the notification side of the download manager, which now displays only one notification per batch. In order to display the correct progress of the entire batch we had to fetch the total size of the batch by doing a HEAD call for each request in the batch to get the `Content-Length` header value.\r\n\r\nOn the SQL side, a `batch` table is created alongside with a new `batch_id` column for the `request` table. ","created_at":"2015-06-22T15:50:54Z","updated_at":"2015-06-23T08:51:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be4f2c82e1586781fbafc3e0f07cc39c5cd77245","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/novoda/download-manager/pulls/35/commits","review_comments_url":"https://api.github.com/repos/novoda/download-manager/pulls/35/comments","review_comment_url":"https://api.github.com/repos/novoda/download-manager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/novoda/download-manager/issues/35/comments","statuses_url":"https://api.github.com/repos/novoda/download-manager/statuses/b4c32f67794880e227ec3ba82c11cb989abadab7","head":{"label":"novoda:batch_requests","ref":"batch_requests","sha":"b4c32f67794880e227ec3ba82c11cb989abadab7","user":{"login":"novoda","id":74874,"avatar_url":"https://avatars.githubusercontent.com/u/74874?v=3","gravatar_id":"","url":"https://api.github.com/users/novoda","html_url":"https://github.com/novoda","followers_url":"https://api.github.com/users/novoda/followers","following_url":"https://api.github.com/users/novoda/following{/other_user}","gists_url":"https://api.github.com/users/novoda/gists{/gist_id}","starred_url":"https://api.github.com/users/novoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novoda/subscriptions","organizations_url":"https://api.github.com/users/novoda/orgs","repos_url":"https://api.github.com/users/novoda/repos","events_url":"https://api.github.com/users/novoda/events{/privacy}","received_events_url":"https://api.github.com/users/novoda/received_events","type":"Organization","site_admin":false},"repo":{"id":35211795,"name":"download-manager","full_name":"novoda/download-manager","owner":{"login":"novoda","id":74874,"avatar_url":"https://avatars.githubusercontent.com/u/74874?v=3","gravatar_id":"","url":"https://api.github.com/users/novoda","html_url":"https://github.com/novoda","followers_url":"https://api.github.com/users/novoda/followers","following_url":"https://api.github.com/users/novoda/following{/other_user}","gists_url":"https://api.github.com/users/novoda/gists{/gist_id}","starred_url":"https://api.github.com/users/novoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novoda/subscriptions","organizations_url":"https://api.github.com/users/novoda/orgs","repos_url":"https://api.github.com/users/novoda/repos","events_url":"https://api.github.com/users/novoda/events{/privacy}","received_events_url":"https://api.github.com/users/novoda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/novoda/download-manager","description":"Download manager based on AOSP DM but allowing downloading to internal private storage","fork":false,"url":"https://api.github.com/repos/novoda/download-manager","forks_url":"https://api.github.com/repos/novoda/download-manager/forks","keys_url":"https://api.github.com/repos/novoda/download-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/novoda/download-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/novoda/download-manager/teams","hooks_url":"https://api.github.com/repos/novoda/download-manager/hooks","issue_events_url":"https://api.github.com/repos/novoda/download-manager/issues/events{/number}","events_url":"https://api.github.com/repos/novoda/download-manager/events","assignees_url":"https://api.github.com/repos/novoda/download-manager/assignees{/user}","branches_url":"https://api.github.com/repos/novoda/download-manager/branches{/branch}","tags_url":"https://api.github.com/repos/novoda/download-manager/tags","blobs_url":"https://api.github.com/repos/novoda/download-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/novoda/download-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/novoda/download-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/novoda/download-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/novoda/download-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/novoda/download-manager/languages","stargazers_url":"https://api.github.com/repos/novoda/download-manager/stargazers","contributors_url":"https://api.github.com/repos/novoda/download-manager/contributors","subscribers_url":"https://api.github.com/repos/novoda/download-manager/subscribers","subscription_url":"https://api.github.com/repos/novoda/download-manager/subscription","commits_url":"https://api.github.com/repos/novoda/download-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/novoda/download-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/novoda/download-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/novoda/download-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/novoda/download-manager/contents/{+path}","compare_url":"https://api.github.com/repos/novoda/download-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/novoda/download-manager/merges","archive_url":"https://api.github.com/repos/novoda/download-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/novoda/download-manager/downloads","issues_url":"https://api.github.com/repos/novoda/download-manager/issues{/number}","pulls_url":"https://api.github.com/repos/novoda/download-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/novoda/download-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/novoda/download-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/novoda/download-manager/labels{/name}","releases_url":"https://api.github.com/repos/novoda/download-manager/releases{/id}","created_at":"2015-05-07T09:41:52Z","updated_at":"2015-06-19T04:07:50Z","pushed_at":"2015-06-23T08:25:50Z","git_url":"git://github.com/novoda/download-manager.git","ssh_url":"git@github.com:novoda/download-manager.git","clone_url":"https://github.com/novoda/download-manager.git","svn_url":"https://github.com/novoda/download-manager","homepage":"","size":1442,"stargazers_count":39,"watchers_count":39,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":8,"forks":3,"open_issues":8,"watchers":39,"default_branch":"master"}},"base":{"label":"novoda:batch_feature_branch","ref":"batch_feature_branch","sha":"2cd8be7d2a3fdf8e4d8117a3716971be78cdfea3","user":{"login":"novoda","id":74874,"avatar_url":"https://avatars.githubusercontent.com/u/74874?v=3","gravatar_id":"","url":"https://api.github.com/users/novoda","html_url":"https://github.com/novoda","followers_url":"https://api.github.com/users/novoda/followers","following_url":"https://api.github.com/users/novoda/following{/other_user}","gists_url":"https://api.github.com/users/novoda/gists{/gist_id}","starred_url":"https://api.github.com/users/novoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novoda/subscriptions","organizations_url":"https://api.github.com/users/novoda/orgs","repos_url":"https://api.github.com/users/novoda/repos","events_url":"https://api.github.com/users/novoda/events{/privacy}","received_events_url":"https://api.github.com/users/novoda/received_events","type":"Organization","site_admin":false},"repo":{"id":35211795,"name":"download-manager","full_name":"novoda/download-manager","owner":{"login":"novoda","id":74874,"avatar_url":"https://avatars.githubusercontent.com/u/74874?v=3","gravatar_id":"","url":"https://api.github.com/users/novoda","html_url":"https://github.com/novoda","followers_url":"https://api.github.com/users/novoda/followers","following_url":"https://api.github.com/users/novoda/following{/other_user}","gists_url":"https://api.github.com/users/novoda/gists{/gist_id}","starred_url":"https://api.github.com/users/novoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novoda/subscriptions","organizations_url":"https://api.github.com/users/novoda/orgs","repos_url":"https://api.github.com/users/novoda/repos","events_url":"https://api.github.com/users/novoda/events{/privacy}","received_events_url":"https://api.github.com/users/novoda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/novoda/download-manager","description":"Download manager based on AOSP DM but allowing downloading to internal private storage","fork":false,"url":"https://api.github.com/repos/novoda/download-manager","forks_url":"https://api.github.com/repos/novoda/download-manager/forks","keys_url":"https://api.github.com/repos/novoda/download-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/novoda/download-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/novoda/download-manager/teams","hooks_url":"https://api.github.com/repos/novoda/download-manager/hooks","issue_events_url":"https://api.github.com/repos/novoda/download-manager/issues/events{/number}","events_url":"https://api.github.com/repos/novoda/download-manager/events","assignees_url":"https://api.github.com/repos/novoda/download-manager/assignees{/user}","branches_url":"https://api.github.com/repos/novoda/download-manager/branches{/branch}","tags_url":"https://api.github.com/repos/novoda/download-manager/tags","blobs_url":"https://api.github.com/repos/novoda/download-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/novoda/download-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/novoda/download-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/novoda/download-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/novoda/download-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/novoda/download-manager/languages","stargazers_url":"https://api.github.com/repos/novoda/download-manager/stargazers","contributors_url":"https://api.github.com/repos/novoda/download-manager/contributors","subscribers_url":"https://api.github.com/repos/novoda/download-manager/subscribers","subscription_url":"https://api.github.com/repos/novoda/download-manager/subscription","commits_url":"https://api.github.com/repos/novoda/download-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/novoda/download-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/novoda/download-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/novoda/download-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/novoda/download-manager/contents/{+path}","compare_url":"https://api.github.com/repos/novoda/download-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/novoda/download-manager/merges","archive_url":"https://api.github.com/repos/novoda/download-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/novoda/download-manager/downloads","issues_url":"https://api.github.com/repos/novoda/download-manager/issues{/number}","pulls_url":"https://api.github.com/repos/novoda/download-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/novoda/download-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/novoda/download-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/novoda/download-manager/labels{/name}","releases_url":"https://api.github.com/repos/novoda/download-manager/releases{/id}","created_at":"2015-05-07T09:41:52Z","updated_at":"2015-06-19T04:07:50Z","pushed_at":"2015-06-23T08:25:50Z","git_url":"git://github.com/novoda/download-manager.git","ssh_url":"git@github.com:novoda/download-manager.git","clone_url":"https://github.com/novoda/download-manager.git","svn_url":"https://github.com/novoda/download-manager","homepage":"","size":1442,"stargazers_count":39,"watchers_count":39,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":8,"forks":3,"open_issues":8,"watchers":39,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/novoda/download-manager/pulls/35"},"html":{"href":"https://github.com/novoda/download-manager/pull/35"},"issue":{"href":"https://api.github.com/repos/novoda/download-manager/issues/35"},"comments":{"href":"https://api.github.com/repos/novoda/download-manager/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/novoda/download-manager/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/novoda/download-manager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/novoda/download-manager/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/novoda/download-manager/statuses/b4c32f67794880e227ec3ba82c11cb989abadab7"}}}}