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