1
1
package com.xyoye.common_component.source.factory
2
2
3
+ import android.text.TextUtils
3
4
import com.xyoye.common_component.config.DanmuConfig
4
5
import com.xyoye.common_component.config.SubtitleConfig
5
- import com.xyoye.common_component.database.DatabaseManager
6
6
import com.xyoye.common_component.extension.toMd5String
7
7
import com.xyoye.common_component.source.base.VideoSourceFactory
8
8
import com.xyoye.common_component.source.media.LocalMediaSource
@@ -45,8 +45,8 @@ object LocalSourceFactory {
45
45
46
46
private fun getVideoDanmu (video : VideoEntity , history : PlayHistoryEntity ? ): Pair <Int , String ?> {
47
47
// 当前视频已绑定弹幕
48
- if (history?.danmuPath != null ) {
49
- return Pair (history.episodeId, history.danmuPath)
48
+ if (TextUtils .isEmpty( history?.danmuPath). not () ) {
49
+ return Pair (history!! .episodeId, history.danmuPath)
50
50
}
51
51
// 从本地找同名弹幕
52
52
if (DanmuConfig .isAutoLoadSameNameDanmu()) {
@@ -59,8 +59,8 @@ object LocalSourceFactory {
59
59
60
60
private suspend fun getVideoSubtitle (video : VideoEntity , history : PlayHistoryEntity ? ): String? {
61
61
// 当前视频已绑定字幕
62
- if (history?.subtitlePath != null ) {
63
- return history.subtitlePath
62
+ if (TextUtils .isEmpty( history?.subtitlePath). not () ) {
63
+ return history!! .subtitlePath
64
64
}
65
65
// 自动加载本地同名字幕
66
66
if (SubtitleConfig .isAutoLoadSameNameSubtitle()) {
0 commit comments