Skip to content

Commit

Permalink
Pass the required lifecycle scope due to async task replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
rsiebert committed Mar 26, 2021
1 parent 522c0d7 commit 21fe205
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.app.Application
import android.net.Uri
import android.os.Bundle
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import androidx.preference.PreferenceManager
import org.tvheadend.api.AuthenticationStateResult
import org.tvheadend.api.ConnectionStateResult
Expand Down Expand Up @@ -128,7 +129,7 @@ class ExternalPlayerViewModel(application: Application) : BaseViewModel(applicat
if (convertHostnameToAddress && !hostname.isNullOrEmpty()) {
Timber.d("Convert hostname $hostname to IP address")
try {
hostname = ConvertHostnameToAddressTask(hostname).execute().get()
hostname = ConvertHostnameToAddressTask(viewModelScope, hostname).toString()
} catch (e: InterruptedException) {
Timber.d(e, "Could not execute task to get ip address from $hostname")
} catch (e: ExecutionException) {
Expand Down

0 comments on commit 21fe205

Please sign in to comment.