diff --git a/app/src/main/java/org/schabi/newpipe/database/history/dao/HistoryDAO.kt b/app/src/main/java/org/schabi/newpipe/database/history/dao/HistoryDAO.kt deleted file mode 100644 index fda46073b..000000000 --- a/app/src/main/java/org/schabi/newpipe/database/history/dao/HistoryDAO.kt +++ /dev/null @@ -1,13 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2017 NewPipe contributors - * SPDX-FileCopyrightText: 2025 NewPipe e.V. - * SPDX-License-Identifier: GPL-3.0-or-later - */ - -package org.schabi.newpipe.database.history.dao - -import org.schabi.newpipe.database.BasicDAO - -interface HistoryDAO : BasicDAO { - val latestEntry: T? -} diff --git a/app/src/main/java/org/schabi/newpipe/database/history/dao/SearchHistoryDAO.kt b/app/src/main/java/org/schabi/newpipe/database/history/dao/SearchHistoryDAO.kt index e20e10de9..ddcb00489 100644 --- a/app/src/main/java/org/schabi/newpipe/database/history/dao/SearchHistoryDAO.kt +++ b/app/src/main/java/org/schabi/newpipe/database/history/dao/SearchHistoryDAO.kt @@ -9,13 +9,14 @@ package org.schabi.newpipe.database.history.dao import androidx.room.Dao import androidx.room.Query import io.reactivex.rxjava3.core.Flowable +import org.schabi.newpipe.database.BasicDAO import org.schabi.newpipe.database.history.model.SearchHistoryEntry @Dao -interface SearchHistoryDAO : HistoryDAO { +interface SearchHistoryDAO : BasicDAO { @get:Query("SELECT * FROM search_history WHERE id = (SELECT MAX(id) FROM search_history)") - override val latestEntry: SearchHistoryEntry? + val latestEntry: SearchHistoryEntry? @Query("DELETE FROM search_history") override fun deleteAll(): Int diff --git a/app/src/main/java/org/schabi/newpipe/database/history/dao/StreamHistoryDAO.kt b/app/src/main/java/org/schabi/newpipe/database/history/dao/StreamHistoryDAO.kt index dfea41e12..432c93a55 100644 --- a/app/src/main/java/org/schabi/newpipe/database/history/dao/StreamHistoryDAO.kt +++ b/app/src/main/java/org/schabi/newpipe/database/history/dao/StreamHistoryDAO.kt @@ -10,15 +10,13 @@ import androidx.room.Dao import androidx.room.Query import androidx.room.RewriteQueriesToDropUnusedColumns import io.reactivex.rxjava3.core.Flowable +import org.schabi.newpipe.database.BasicDAO import org.schabi.newpipe.database.history.model.StreamHistoryEntity import org.schabi.newpipe.database.history.model.StreamHistoryEntry import org.schabi.newpipe.database.stream.StreamStatisticsEntry @Dao -abstract class StreamHistoryDAO : HistoryDAO { - - @get:Query("SELECT * FROM stream_history WHERE access_date = (SELECT MAX(access_date) FROM stream_history)") - abstract override val latestEntry: StreamHistoryEntity +abstract class StreamHistoryDAO : BasicDAO { @Query("SELECT * FROM stream_history") abstract override fun getAll(): Flowable>