diff options
author | Allan Wang <me@allanwang.ca> | 2018-09-26 14:56:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-26 14:56:44 -0400 |
commit | 438affb07ae106e490884fafa3c2dd825e7649a4 (patch) | |
tree | b94e182bf4d083af049120a6b5f94f82c4595318 /app/src/main/kotlin/com/pitchedapps/frost/debugger | |
parent | c5e769deabeb80d7257b85c5c3d802cf46e6b191 (diff) | |
download | frost-438affb07ae106e490884fafa3c2dd825e7649a4.tar.gz frost-438affb07ae106e490884fafa3c2dd825e7649a4.tar.bz2 frost-438affb07ae106e490884fafa3c2dd825e7649a4.zip |
Cleanup (#1087)
* Feature/download manager (#855)
* Add initial github release check
* Create update service
* Clean old manager directory
* Update kau
* Update updateActivity snippet
* Add back gradle keys
* Remove update service functionality
* Update changelog
* Misc (#865)
* Clean up git code
* Update download link
* Update theme
* Reorder settings, resolvees #856
* Do not log undeliverable exception
* Handle potential lack of webview
* Set notification epoch default to now, resolves #857
* Fix notification epoch time init
* Update changelog
* Update theme
* Add slack url, resolves #880
* Prepare for image update
* Fix view full image (#882)
* Test including full photo viewer
* Test cookie in glide
* Fix parser and add redirects to view full image
* Update changelog
* Fix compilation and add new keys
* Update all versions
* Fix signing configs
* Fix exoplayer api update
* Change string usage
* Test scss on travis
* Test with node_js flag
* Add back css
* Update versions and fix video view
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/debugger')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/debugger/OfflineWebsite.kt | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/debugger/OfflineWebsite.kt b/app/src/main/kotlin/com/pitchedapps/frost/debugger/OfflineWebsite.kt index 95162932..f5f7463d 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/debugger/OfflineWebsite.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/debugger/OfflineWebsite.kt @@ -10,6 +10,8 @@ import com.pitchedapps.frost.utils.createFreshDir import com.pitchedapps.frost.utils.createFreshFile import com.pitchedapps.frost.utils.frostJsoup import com.pitchedapps.frost.utils.unescapeHtml +import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxkotlin.addTo import okhttp3.Request import okhttp3.ResponseBody import org.jsoup.Jsoup @@ -71,6 +73,8 @@ class OfflineWebsite(private val url: String, .get() .call() + private val compositeDisposable = CompositeDisposable() + /** * Caller to bind callbacks and start the load * Callback is guaranteed to be called unless the load is cancelled @@ -155,7 +159,7 @@ class OfflineWebsite(private val url: String, progress(100) callback(true) } - } + }.addTo(compositeDisposable) } fun zip(name: String): Boolean { @@ -217,7 +221,7 @@ class OfflineWebsite(private val url: String, }) private fun downloadCss() = cssQueue.clean().toTypedArray().zip<String, Set<String>, Set<String>>({ - it.flatMap { it }.toSet() + it.flatMap { l -> l }.toSet() }, { it.downloadUrl({ emptySet() }) { file, body -> var content = body.string() @@ -319,6 +323,7 @@ class OfflineWebsite(private val url: String, fun cancel() { cancelled = true + compositeDisposable.dispose() L.v { "Request cancelled" } } |