1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2026-04-30 10:41:23 +00:00

-Added history record manager as single entry for all database history transactions.

-Merged stream record manager into history record manager.
-Removed subject-based history database actions.
-Merged normalized history table into watch history fragment.
-Modified history fragments to use long click for delete actions.
-Refactored DAO operations from search fragment to record manager.
-Added index to search history table on search string.
-Fix baseplayer round repeat not detected by discontinuity.
This commit is contained in:
John Zhen Mo
2018-01-26 21:34:17 -08:00
parent f0829f9ef3
commit 388ec3e3d3
22 changed files with 476 additions and 485 deletions

View File

@@ -20,6 +20,7 @@ public class Migrations {
// Not much we can do about this, since room doesn't create tables before migration.
// It's either this or blasting the entire database anew.
database.execSQL("CREATE INDEX `index_search_history_search` ON `search_history` (`search`)");
database.execSQL("CREATE TABLE IF NOT EXISTS `streams` (`uid` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `service_id` INTEGER NOT NULL, `url` TEXT, `title` TEXT, `stream_type` TEXT, `duration` INTEGER, `uploader` TEXT, `thumbnail_url` TEXT)");
database.execSQL("CREATE UNIQUE INDEX `index_streams_service_id_url` ON `streams` (`service_id`, `url`)");
database.execSQL("CREATE TABLE IF NOT EXISTS `stream_history` (`stream_id` INTEGER NOT NULL, `access_date` INTEGER NOT NULL, PRIMARY KEY(`stream_id`, `access_date`), FOREIGN KEY(`stream_id`) REFERENCES `streams`(`uid`) ON UPDATE CASCADE ON DELETE CASCADE )");