mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
27 lines
707 B
Kotlin
27 lines
707 B
Kotlin
package com.github.libretube.database
|
|
|
|
import androidx.room.Dao
|
|
import androidx.room.Delete
|
|
import androidx.room.Insert
|
|
import androidx.room.OnConflictStrategy
|
|
import androidx.room.Query
|
|
import com.github.libretube.obj.WatchPosition
|
|
|
|
@Dao
|
|
interface WatchPositionDao {
|
|
@Query("SELECT * FROM watchPosition")
|
|
fun getAll(): List<WatchPosition>
|
|
|
|
@Query("SELECT * FROM watchPosition WHERE videoId LIKE :videoId LIMIT 1")
|
|
fun findById(videoId: String): WatchPosition
|
|
|
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
fun insertAll(vararg watchPositions: WatchPosition)
|
|
|
|
@Delete
|
|
fun delete(watchPosition: WatchPosition)
|
|
|
|
@Query("DELETE FROM watchPosition")
|
|
fun deleteAll()
|
|
}
|