fix: 数据库版本更新到3,修复续播逻辑
This commit is contained in:
@@ -184,6 +184,12 @@ class PlayerActivity : AppCompatActivity() {
|
||||
|
||||
if (historyEpisode != null) {
|
||||
scrollToEpisode(historyEpisode!!)
|
||||
if (resumePosition != null && resumePosition!! > 0) {
|
||||
val target = source.episodes.find { it.title == historyEpisode }
|
||||
if (target != null) {
|
||||
playEpisode(target)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (source.episodes.isNotEmpty()) {
|
||||
playEpisode(source.episodes.first())
|
||||
@@ -205,6 +211,7 @@ class PlayerActivity : AppCompatActivity() {
|
||||
isFocusableInTouchMode = true
|
||||
setOnClickListener {
|
||||
highlightEpisode(it)
|
||||
resumePosition = null
|
||||
playEpisode(ep)
|
||||
resetAutoHide()
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import androidx.room.Database
|
||||
import androidx.room.Room
|
||||
import androidx.room.RoomDatabase
|
||||
|
||||
@Database(entities = [SearchHistory::class, PlayHistory::class], version = 2, exportSchema = false)
|
||||
@Database(entities = [SearchHistory::class, PlayHistory::class], version = 3, exportSchema = false)
|
||||
abstract class AppDatabase : RoomDatabase() {
|
||||
abstract fun searchHistoryDao(): SearchHistoryDao
|
||||
abstract fun playHistoryDao(): PlayHistoryDao
|
||||
|
||||
Reference in New Issue
Block a user