pull/49/head
kunfei 5 years ago
parent a2c59f6733
commit 532d2b0e8d
  1. 2
      app/src/main/java/io/legado/app/data/entities/BookSource.kt
  2. 4
      app/src/main/java/io/legado/app/service/AudioPlayService.kt
  3. 2
      app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt

@ -152,7 +152,7 @@ data class BookSource(
exploreKinds.add(ExploreKind(d[0], d[1])) exploreKinds.add(ExploreKind(d[0], d[1]))
} }
} catch (e: Exception) { } catch (e: Exception) {
exploreKinds.add(ExploreKind(e.localizedMessage)) exploreKinds.add(ExploreKind(e.localizedMessage ?: ""))
} }
} }
} }

@ -27,7 +27,6 @@ import io.legado.app.help.MediaHelp
import io.legado.app.receiver.MediaButtonReceiver import io.legado.app.receiver.MediaButtonReceiver
import io.legado.app.service.help.AudioPlay import io.legado.app.service.help.AudioPlay
import io.legado.app.ui.audio.AudioPlayActivity import io.legado.app.ui.audio.AudioPlayActivity
import io.legado.app.utils.LogUtils
import io.legado.app.utils.postEvent import io.legado.app.utils.postEvent
import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@ -121,9 +120,8 @@ class AudioPlayService : BaseService(),
mediaPlayer.setDataSource(url) mediaPlayer.setDataSource(url)
mediaPlayer.prepareAsync() mediaPlayer.prepareAsync()
} catch (e: Exception) { } catch (e: Exception) {
LogUtils.d("AudioPlayService", e.localizedMessage + " " + url)
launch { launch {
toast(e.localizedMessage + " " + url) toast("$url ${e.localizedMessage}")
stopSelf() stopSelf()
} }
} }

@ -204,7 +204,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
removeLoading(chapter.index) removeLoading(chapter.index)
} }
}?.onError { }?.onError {
contentLoadFinish(chapter, it.localizedMessage) contentLoadFinish(chapter, it.localizedMessage ?: "未知错误")
removeLoading(chapter.index) removeLoading(chapter.index)
} }
} }

Loading…
Cancel
Save