Skip to content

Commit

Permalink
version update
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyofrancis committed Apr 26, 2019
1 parent ef5705b commit 826088b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 8 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
Version 3.0.5
This release only adds a new Feature that allows Fetch to auto retry failed downloads for any reason. Set the number of times Fetch will auto retry a download when it fails.
This feature if off by default.
1. New fields added on Download: autoRetryMaxAttempts and autoRetryAttempts. See Java docs.
2. New field added on RequestInfo: autoRetryMaxAttempts. See Java docs.
3. New method added on Fetch: fun resetAutoRetryAttempts(downloadId: Int, retryDownload: Boolean = true, func: Func2<Download?>? = null, func2: Func<Error>? = null): Fetch
4. New method added on RXFetch: fun resetAutoRetryAttempts(downloadId: Int, retryDownload: Boolean = true): Convertible<Download?>
5. New method added on FetchConfiguration: fun setAutoRetryMaxAttempts(autoRetryMaxAttempts: Int): Builder. See Java Docs

```java
final FetchConfiguration fetchConfiguration = new FetchConfiguration.Builder(this)
.enableRetryOnNetworkGain(true)
.setDownloadConcurrentLimit(2)
.setAutoRetryMaxAttempts(10) // set global auto retry max attempts for all downloads.
.build();
final Fetch fetch = Fetch.Impl.getInstance(fetchConfiguration);

//OR

final String url = "dummy url";
final String file = "dummy file";
final Request request = new Request(url, file);
request.setAutoRetryMaxAttempts(5); // set auto retry on individual downloads.

fetch.getDownload(request.getId(), download -> {
if (download != null) {
download.getAutoRetryAttempts(); //get the number of auto retry attempts.
download.getAutoRetryMaxAttempts(); //get the number of max attempts.
}
});

//reset the auto retry attempts for a download
fetch.resetAutoRetryAttempts(request.getId(), true, null, null);
```

Version 3.0.4
1. updated documentation
2. remove has activeDownloads(): Boolean method. Use fun hasActiveDownloads(includeAddedDownloads: Boolean, func: Func<Boolean>): Fetch or fun addActiveDownloadsObserver(includeAddedDownloads: Boolean = false, fetchObserver: FetchObserver<Boolean>): Fetch instead.
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

[![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=3.0.4) ](https://bintray.com/tonyofrancis/maven/fetch2/3.0.4/link)
[ ![Download](https://api.bintray.com/packages/tonyofrancis/maven/fetch2/images/download.svg?version=3.0.5) ](https://bintray.com/tonyofrancis/maven/fetch2/3.0.5/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)

Expand Down Expand Up @@ -50,7 +50,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:3.0.4"
implementation "com.tonyodev.fetch2:fetch2:3.0.5"
```

Next, get an instance of Fetch and request a download.
Expand Down Expand Up @@ -216,7 +216,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:3.0.4"
implementation "com.tonyodev.fetch2okhttp:fetch2okhttp:3.0.5"
```
Set the OkHttp Downloader for Fetch to use.
```java
Expand All @@ -237,7 +237,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:3.0.4"
implementation "com.tonyodev.fetch2rx:fetch2rx:3.0.5"
```

RxFetch makes it super easy to enqueue download requests and query downloads using rxJava2 functional methods.
Expand Down Expand Up @@ -273,7 +273,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:3.0.4"
implementation "com.tonyodev.fetch2fileserver:fetch2fileserver:3.0.5"
```

Start a FetchFileServer instance and add resource files that it can server to connected clients.
Expand Down Expand Up @@ -382,7 +382,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:3.0.4"
implementation "com.tonyodev.fetchmigrator:fetchmigrator:3.0.5"
```

Then run the Migrator.
Expand Down
4 changes: 2 additions & 2 deletions versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ ext {
rxAndroid2_version = "2.1.1"
timber_version = "4.7.1"
novoda_bintray_version = "0.9"
library_version = "3.0.4"
library_version_code = 66
library_version = "3.0.5"
library_version_code = 67
}

0 comments on commit 826088b

Please sign in to comment.