From 5d907c468efd3f58b439898d3896fff2a55edab8 Mon Sep 17 00:00:00 2001 From: Tonyo Francis Date: Fri, 8 Jun 2018 15:25:23 -0400 Subject: [PATCH] Added missing field on Downloader.Request class --- CHANGELOG | 3 +++ README.md | 14 +++++++------- .../downloader/SequentialFileDownloaderImpl.kt | 3 ++- .../java/com/tonyodev/fetch2/util/FetchUtils.kt | 3 ++- .../java/com/tonyodev/fetch2core/Downloader.kt | 5 ++++- versions.gradle | 6 +++--- 6 files changed, 21 insertions(+), 13 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 3b2b88a0..0ad8d342 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 2.1.0-RC2 +- Added missing identifier field on Downloader.Request class. + Version 2.1.0-RC1 This version of Fetch contains many fixes and breaking changes. Note: Uses will not lose downloads migrating to this version once the same namespace is set. diff --git a/README.md b/README.md index da4ad120..3a53789d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![Build Status](https://travis-ci.org/tonyofrancis/Fetch.svg?branch=v2)](https://travis-ci.org/tonyofrancis/Fetch) -[ ![Download](https://api.bintray.com/packages/tonyofrancis/maven/fetch2/images/download.svg?version=2.1.0-RC1) ](https://bintray.com/tonyofrancis/maven/fetch2/2.1.0-RC1/link) +[ ![Download](https://api.bintray.com/packages/tonyofrancis/maven/fetch2/images/download.svg?version=2.1.0-RC2) ](https://bintray.com/tonyofrancis/maven/fetch2/2.1.0-RC2/link) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Android%20Networking-blue.svg?style=flat)](https://android-arsenal.com/details/1/5196) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/tonyofrancis/Fetch/blob/master/LICENSE) @@ -47,7 +47,7 @@ How to use Fetch Using Fetch is easy! Just add the Gradle dependency to your application's build.gradle file. ```java -implementation "com.tonyodev.fetch2:fetch2:2.1.0-RC1" +implementation "com.tonyodev.fetch2:fetch2:2.1.0-RC2" ``` Next, get an instance of Fetch and request a download. @@ -213,7 +213,7 @@ to use the OkHttp Downloader instead. You can create your own custom downloaders if necessary. See the Java docs for details. ```java -implementation "com.tonyodev.fetch2okhttp:fetch2okhttp:2.1.0-RC1" +implementation "com.tonyodev.fetch2okhttp:fetch2okhttp:2.1.0-RC2" ``` Set the OkHttp Downloader for Fetch to use. ```java @@ -234,7 +234,7 @@ If you would like to take advantage of RxJava2 features when using Fetch, add the following gradle dependency to your application's build.gradle file. ```java -implementation "com.tonyodev.fetch2rx:fetch2rx:2.1.0-RC1" +implementation "com.tonyodev.fetch2rx:fetch2rx:2.1.0-RC2" ``` RxFetch makes it super easy to enqueue download requests and query downloads using rxJava2 functional methods. @@ -270,7 +270,7 @@ added in the coming days. Start using FetchFileServer by adding the gradle dependency to your application's build.gradle file. ```java -implementation "com.tonyodev.fetch2fileserver:fetch2fileserver:2.1.0-RC1" +implementation "com.tonyodev.fetch2fileserver:fetch2fileserver:2.1.0-RC2" ``` Start a FetchFileServer instance and add resource files that it can server to connected clients. @@ -308,7 +308,7 @@ public class TestActivity extends AppCompatActivity { Download a file from a FetchFileServer using the Fetch. Add the FetchFileServerDownloader dependency to you app's build.gradle file. ```java -implementation "com.tonyodev.fetch2downloaders:fetch2downloaders:2.1.0-RC1" +implementation "com.tonyodev.fetch2downloaders:fetch2downloaders:2.1.0-RC2" ``` Then create an instance of Fetch and enqueue the download. @@ -462,7 +462,7 @@ Fetch1 Migration Migrate downloads from Fetch1 to Fetch2 using the migration assistant. Add the following gradle dependency to your application's build.gradle file. ```java -implementation "com.tonyodev.fetchmigrator:fetchmigrator:2.1.0-RC1" +implementation "com.tonyodev.fetchmigrator:fetchmigrator:2.1.0-RC2" ``` Then run the Migrator. diff --git a/fetch2/src/main/java/com/tonyodev/fetch2/downloader/SequentialFileDownloaderImpl.kt b/fetch2/src/main/java/com/tonyodev/fetch2/downloader/SequentialFileDownloaderImpl.kt index ad094c21..7ceeb970 100644 --- a/fetch2/src/main/java/com/tonyodev/fetch2/downloader/SequentialFileDownloaderImpl.kt +++ b/fetch2/src/main/java/com/tonyodev/fetch2/downloader/SequentialFileDownloaderImpl.kt @@ -278,7 +278,8 @@ class SequentialFileDownloaderImpl(private val initialDownload: Download, url = initialDownload.url, headers = headers, file = initialDownload.file, - tag = initialDownload.tag) + tag = initialDownload.tag, + identifier = initialDownload.identifier) } private fun getAverageDownloadedBytesPerSecond(): Long { diff --git a/fetch2/src/main/java/com/tonyodev/fetch2/util/FetchUtils.kt b/fetch2/src/main/java/com/tonyodev/fetch2/util/FetchUtils.kt index 86544c1e..c178f96d 100644 --- a/fetch2/src/main/java/com/tonyodev/fetch2/util/FetchUtils.kt +++ b/fetch2/src/main/java/com/tonyodev/fetch2/util/FetchUtils.kt @@ -53,7 +53,8 @@ fun getRequestForDownload(download: Download, url = download.url, headers = headers, file = download.file, - tag = download.tag) + tag = download.tag, + identifier = download.identifier) } fun deleteRequestTempFiles(fileTempDir: String, diff --git a/fetch2core/src/main/java/com/tonyodev/fetch2core/Downloader.kt b/fetch2core/src/main/java/com/tonyodev/fetch2core/Downloader.kt index 98d0a06f..d3144d18 100644 --- a/fetch2core/src/main/java/com/tonyodev/fetch2core/Downloader.kt +++ b/fetch2core/src/main/java/com/tonyodev/fetch2core/Downloader.kt @@ -131,7 +131,10 @@ interface Downloader : Closeable { val file: String, /** The tag associated with this request.*/ - val tag: String?) + val tag: String?, + + /** The identifier associated with this request*/ + val identifier: Long) /** * A class that contains the server response information used by Fetch diff --git a/versions.gradle b/versions.gradle index ed14ed0c..8c410f19 100644 --- a/versions.gradle +++ b/versions.gradle @@ -11,11 +11,11 @@ ext { library_compile_version = 27 library_target_version = 27 library_build_tools_version = "27.0.3" - gradle_tools_version = "3.1.2" + gradle_tools_version = "3.1.3" rxJava2_version = "2.1.14" rxAndroid2_version = "2.0.2" timber_version = "4.7.0" novoda_bintray_version = "0.8.0" - library_version = "2.1.0-RC1" - library_version_code = 24 + library_version = "2.1.0-RC2" + library_version_code = 25 } \ No newline at end of file