mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-06-25 06:33:21 +00:00
![Cyril Müller](/assets/img/avatar_default.png)
Add search and watch history * Make MainActicity a single task * Remove some casting * SearchFragment: start searching when created with query * Handle settings change in onResume * History: Log pop up and background playback * History: Add swipe to remove functionallity * Enable history by default * Use stream item * Store more information about the stream * Integrate history database into AppDatabase * Remove redundant casts * Re-enable date converters * History: Use Rx Java and run DB in background * Also make HistoryDAO extend BasicDAO * History: RX-ify swipe to remove * Sort history entries by creation date * History: Set toolbar title * Don't repeat history entries * Introduced setters so we can update entries in the database * If the latest entry has the same (main) values, just update it
27 lines
1.1 KiB
Java
27 lines
1.1 KiB
Java
package org.schabi.newpipe.database;
|
|
|
|
import android.arch.persistence.room.Database;
|
|
import android.arch.persistence.room.RoomDatabase;
|
|
import android.arch.persistence.room.TypeConverters;
|
|
|
|
import org.schabi.newpipe.database.history.dao.SearchHistoryDAO;
|
|
import org.schabi.newpipe.database.history.dao.WatchHistoryDAO;
|
|
import org.schabi.newpipe.database.history.model.SearchHistoryEntry;
|
|
import org.schabi.newpipe.database.history.model.WatchHistoryEntry;
|
|
import org.schabi.newpipe.database.subscription.SubscriptionDAO;
|
|
import org.schabi.newpipe.database.subscription.SubscriptionEntity;
|
|
import org.schabi.newpipe.database.history.Converters;
|
|
|
|
@TypeConverters({Converters.class})
|
|
@Database(entities = {SubscriptionEntity.class, WatchHistoryEntry.class, SearchHistoryEntry.class}, version = 1, exportSchema = false)
|
|
public abstract class AppDatabase extends RoomDatabase{
|
|
|
|
public static final String DATABASE_NAME = "newpipe.db";
|
|
|
|
public abstract SubscriptionDAO subscriptionDAO();
|
|
|
|
public abstract WatchHistoryDAO watchHistoryDAO();
|
|
|
|
public abstract SearchHistoryDAO searchHistoryDAO();
|
|
}
|