朗读停止时上传进度

pull/737/head
gedoor 4 years ago
parent 09709d1b28
commit 1325f1e5ce
  1. 4
      app/src/main/java/io/legado/app/service/BaseReadAloudService.kt
  2. 2
      app/src/main/java/io/legado/app/service/help/ReadBook.kt
  3. 2
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt

@ -75,7 +75,7 @@ abstract class BaseReadAloudService : BaseService(),
postEvent(EventBus.ALOUD_STATE, Status.STOP) postEvent(EventBus.ALOUD_STATE, Status.STOP)
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_STOPPED) upMediaSessionPlaybackState(PlaybackStateCompat.STATE_STOPPED)
mediaSessionCompat.release() mediaSessionCompat.release()
ReadBook.upProgress() ReadBook.uploadProgress()
} }
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
@ -141,7 +141,7 @@ abstract class BaseReadAloudService : BaseService(),
upNotification() upNotification()
upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PAUSED) upMediaSessionPlaybackState(PlaybackStateCompat.STATE_PAUSED)
postEvent(EventBus.ALOUD_STATE, Status.PAUSE) postEvent(EventBus.ALOUD_STATE, Status.PAUSE)
ReadBook.upProgress() ReadBook.uploadProgress()
} }
@CallSuper @CallSuper

@ -90,7 +90,7 @@ object ReadBook {
nextTextChapter = null nextTextChapter = null
} }
fun upProgress() { fun uploadProgress() {
book?.let { book?.let {
BookWebDav.uploadBookProgress(it) BookWebDav.uploadBookProgress(it)
} }

@ -141,7 +141,7 @@ class ReadBookActivity : ReadBookBaseActivity(),
} }
upSystemUiVisibility() upSystemUiVisibility()
if (!BuildConfig.DEBUG) { if (!BuildConfig.DEBUG) {
ReadBook.upProgress() ReadBook.uploadProgress()
Backup.autoBack(this) Backup.autoBack(this)
} }
} }

Loading…
Cancel
Save