[FIX] - Crash while deleting a video from a playlist while refreshing

This commit is contained in:
hlloreda 2020-12-06 23:40:38 +01:00
parent 5f9e6b51da
commit 9a223532c5
1 changed files with 16 additions and 1 deletions

View File

@ -7,7 +7,6 @@ import org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity
import org.schabi.newpipe.database.stream.model.StreamEntity import org.schabi.newpipe.database.stream.model.StreamEntity
import org.schabi.newpipe.database.stream.model.StreamStateEntity import org.schabi.newpipe.database.stream.model.StreamStateEntity
import org.schabi.newpipe.extractor.stream.StreamInfoItem import org.schabi.newpipe.extractor.stream.StreamInfoItem
import kotlin.jvm.Throws
class PlaylistStreamEntry( class PlaylistStreamEntry(
@Embedded @Embedded
@ -36,4 +35,20 @@ class PlaylistStreamEntry(
override fun getLocalItemType(): LocalItem.LocalItemType { override fun getLocalItemType(): LocalItem.LocalItemType {
return LocalItem.LocalItemType.PLAYLIST_STREAM_ITEM return LocalItem.LocalItemType.PLAYLIST_STREAM_ITEM
} }
override fun equals(other: Any?): Boolean {
if (other == null || other !is PlaylistStreamEntry || streamEntity != other.streamEntity ||
progressTime != other.progressTime || streamId != other.streamId || joinIndex != other.joinIndex
) return false
return true
}
override fun hashCode(): Int {
var result = streamEntity.hashCode()
result = 31 * result + progressTime.hashCode()
result = 31 * result + streamId.hashCode()
result = 31 * result + joinIndex
return result
}
} }