pull/525/head
gedoor 5 years ago
parent e297b92c41
commit 56b85eeb92
  1. 1
      app/src/main/java/io/legado/app/service/help/AudioPlay.kt
  2. 3
      app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt

@ -21,7 +21,6 @@ object AudioPlay {
var book: Book? = null var book: Book? = null
var durChapter: BookChapter? = null var durChapter: BookChapter? = null
var inBookshelf = false var inBookshelf = false
var chapterSize = 0
var durChapterIndex = 0 var durChapterIndex = 0
var durChapterPos = 0 var durChapterPos = 0
var webBook: WebBook? = null var webBook: WebBook? = null

@ -51,7 +51,6 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application)
} }
durChapter = App.db.bookChapterDao.getChapter(book.bookUrl, durChapterIndex) durChapter = App.db.bookChapterDao.getChapter(book.bookUrl, durChapterIndex)
upDurChapter(book) upDurChapter(book)
chapterSize = count
} }
} }
saveRead() saveRead()
@ -81,7 +80,6 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application)
if (cList.isNotEmpty()) { if (cList.isNotEmpty()) {
if (changeDruChapterIndex == null) { if (changeDruChapterIndex == null) {
App.db.bookChapterDao.insert(*cList.toTypedArray()) App.db.bookChapterDao.insert(*cList.toTypedArray())
AudioPlay.chapterSize = cList.size
} else { } else {
changeDruChapterIndex(cList) changeDruChapterIndex(cList)
} }
@ -132,7 +130,6 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application)
book.durChapterTitle = chapters[AudioPlay.durChapterIndex].title book.durChapterTitle = chapters[AudioPlay.durChapterIndex].title
App.db.bookDao.update(book) App.db.bookDao.update(book)
App.db.bookChapterDao.insert(*chapters.toTypedArray()) App.db.bookChapterDao.insert(*chapters.toTypedArray())
AudioPlay.chapterSize = chapters.size
} }
} }

Loading…
Cancel
Save