diff --git a/app/schemas/com.futo.platformplayer.stores.db.types.DBHistory.DB/3.json b/app/schemas/com.futo.platformplayer.stores.db.types.DBHistory.DB/3.json new file mode 100644 index 00000000..a9a08d30 --- /dev/null +++ b/app/schemas/com.futo.platformplayer.stores.db.types.DBHistory.DB/3.json @@ -0,0 +1,94 @@ +{ + "formatVersion": 1, + "database": { + "version": 3, + "identityHash": "ffba56c2f572c25080ce8596e8bb8945", + "entities": [ + { + "tableName": "history", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `url` TEXT NOT NULL, `position` INTEGER NOT NULL, `datetime` INTEGER NOT NULL, `name` TEXT NOT NULL, `serialized` BLOB)", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "url", + "columnName": "url", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "position", + "columnName": "position", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "datetime", + "columnName": "datetime", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "serialized", + "columnName": "serialized", + "affinity": "BLOB", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_history_url", + "unique": false, + "columnNames": [ + "url" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_history_url` ON `${TABLE_NAME}` (`url`)" + }, + { + "name": "index_history_name", + "unique": false, + "columnNames": [ + "name" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_history_name` ON `${TABLE_NAME}` (`name`)" + }, + { + "name": "index_history_datetime", + "unique": false, + "columnNames": [ + "datetime" + ], + "orders": [ + "DESC" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_history_datetime` ON `${TABLE_NAME}` (`datetime` DESC)" + } + ], + "foreignKeys": [] + } + ], + "views": [], + "setupQueries": [ + "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'ffba56c2f572c25080ce8596e8bb8945')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/com.futo.platformplayer.stores.db.types.DBSubscriptionCache.DB/5.json b/app/schemas/com.futo.platformplayer.stores.db.types.DBSubscriptionCache.DB/5.json new file mode 100644 index 00000000..d224cb45 --- /dev/null +++ b/app/schemas/com.futo.platformplayer.stores.db.types.DBSubscriptionCache.DB/5.json @@ -0,0 +1,88 @@ +{ + "formatVersion": 1, + "database": { + "version": 5, + "identityHash": "eb813d54b9c44d29f1d7bb198a16d4d1", + "entities": [ + { + "tableName": "subscription_cache", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `url` TEXT, `channelUrl` TEXT, `datetime` INTEGER, `serialized` BLOB)", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "url", + "columnName": "url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "channelUrl", + "columnName": "channelUrl", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "datetime", + "columnName": "datetime", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "serialized", + "columnName": "serialized", + "affinity": "BLOB", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_subscription_cache_url", + "unique": false, + "columnNames": [ + "url" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_subscription_cache_url` ON `${TABLE_NAME}` (`url`)" + }, + { + "name": "index_subscription_cache_channelUrl", + "unique": false, + "columnNames": [ + "channelUrl" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_subscription_cache_channelUrl` ON `${TABLE_NAME}` (`channelUrl`)" + }, + { + "name": "index_subscription_cache_datetime", + "unique": false, + "columnNames": [ + "datetime" + ], + "orders": [ + "DESC" + ], + "createSql": "CREATE INDEX IF NOT EXISTS `index_subscription_cache_datetime` ON `${TABLE_NAME}` (`datetime` DESC)" + } + ], + "foreignKeys": [] + } + ], + "views": [], + "setupQueries": [ + "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'eb813d54b9c44d29f1d7bb198a16d4d1')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/com.futo.platformplayer.testing.DBTOs.DB/3.json b/app/schemas/com.futo.platformplayer.testing.DBTOs.DB/3.json new file mode 100644 index 00000000..5edb25df --- /dev/null +++ b/app/schemas/com.futo.platformplayer.testing.DBTOs.DB/3.json @@ -0,0 +1,52 @@ +{ + "formatVersion": 1, + "database": { + "version": 3, + "identityHash": "6e3b2d286325c4ea8a7a4c94c290daec", + "entities": [ + { + "tableName": "testing", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`someString` TEXT NOT NULL, `someNum` INTEGER NOT NULL, `id` INTEGER PRIMARY KEY AUTOINCREMENT, `serialized` BLOB)", + "fields": [ + { + "fieldPath": "someString", + "columnName": "someString", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "someNum", + "columnName": "someNum", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "serialized", + "columnName": "serialized", + "affinity": "BLOB", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "id" + ] + }, + "indices": [], + "foreignKeys": [] + } + ], + "views": [], + "setupQueries": [ + "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '6e3b2d286325c4ea8a7a4c94c290daec')" + ] + } +} \ No newline at end of file diff --git a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailView.kt b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailView.kt index f59a6f0f..cbc4ed80 100644 --- a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailView.kt +++ b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailView.kt @@ -538,6 +538,7 @@ class VideoDetailView : ConstraintLayout { if(!_destroyed) { updateQueueState(); StatePlayer.instance.updateMediaSession(null); + _cast.setLoopVisible(!StatePlayer.instance.hasQueue); } }; StatePlayer.instance.onVideoChanging.subscribe(this) { diff --git a/app/src/main/java/com/futo/platformplayer/states/StatePlayer.kt b/app/src/main/java/com/futo/platformplayer/states/StatePlayer.kt index 98d9826c..006bbb9a 100644 --- a/app/src/main/java/com/futo/platformplayer/states/StatePlayer.kt +++ b/app/src/main/java/com/futo/platformplayer/states/StatePlayer.kt @@ -57,12 +57,16 @@ class StatePlayer { var queueShuffle: Boolean = false private set; - val hasQueue: Boolean get() { + val queueSize: Int get() { synchronized(_queue) { - return _queue.isNotEmpty() + return _queue.size } } + val hasQueue: Boolean get() { + return queueSize > 1 + } + val queueName: String get() = _queueName ?: _queueType; //Events diff --git a/app/src/main/java/com/futo/platformplayer/views/casting/CastView.kt b/app/src/main/java/com/futo/platformplayer/views/casting/CastView.kt index 8cbbabbb..f322eaeb 100644 --- a/app/src/main/java/com/futo/platformplayer/views/casting/CastView.kt +++ b/app/src/main/java/com/futo/platformplayer/views/casting/CastView.kt @@ -106,6 +106,10 @@ class CastView : ConstraintLayout { _gestureControlView.stopAllGestures(); } + fun setLoopVisible(visible: Boolean) { + _buttonLoop.visibility = if (visible) View.VISIBLE else View.GONE; + } + fun setIsPlaying(isPlaying: Boolean) { _updateTimeJob?.cancel(); diff --git a/app/src/main/java/com/futo/platformplayer/views/overlays/QueueEditorOverlay.kt b/app/src/main/java/com/futo/platformplayer/views/overlays/QueueEditorOverlay.kt index 2d7df204..215e8dcb 100644 --- a/app/src/main/java/com/futo/platformplayer/views/overlays/QueueEditorOverlay.kt +++ b/app/src/main/java/com/futo/platformplayer/views/overlays/QueueEditorOverlay.kt @@ -22,7 +22,10 @@ class QueueEditorOverlay : LinearLayout { _topbar.onClose.subscribe(this, onClose::emit); _editor.onVideoOrderChanged.subscribe { StatePlayer.instance.setQueueWithExisting(it) } - _editor.onVideoRemoved.subscribe { v -> StatePlayer.instance.removeFromQueue(v) } + _editor.onVideoRemoved.subscribe { v -> + StatePlayer.instance.removeFromQueue(v); + _topbar.setInfo(context.getString(R.string.queue), "${StatePlayer.instance.queueSize} " + context.getString(R.string.videos)); + } _editor.onVideoClicked.subscribe { v -> StatePlayer.instance.setQueuePosition(v) } _topbar.setInfo(context.getString(R.string.queue), ""); diff --git a/app/src/main/java/com/futo/platformplayer/views/video/FutoVideoPlayer.kt b/app/src/main/java/com/futo/platformplayer/views/video/FutoVideoPlayer.kt index df179723..16a51e99 100644 --- a/app/src/main/java/com/futo/platformplayer/views/video/FutoVideoPlayer.kt +++ b/app/src/main/java/com/futo/platformplayer/views/video/FutoVideoPlayer.kt @@ -305,6 +305,7 @@ class FutoVideoPlayer : FutoVideoPlayerBase { StatePlayer.instance.onQueueChanged.subscribe(this) { CoroutineScope(Dispatchers.Main).launch(Dispatchers.Main) { + setLoopVisible(!StatePlayer.instance.hasQueue) updateNextPrevious(); } } @@ -361,6 +362,11 @@ class FutoVideoPlayer : FutoVideoPlayerBase { _currentChapterLoopActive = false; } + fun setLoopVisible(visible: Boolean) { + _control_loop.visibility = if (visible) View.VISIBLE else View.GONE; + _control_loop_fullscreen.visibility = if (visible) View.VISIBLE else View.GONE; + } + fun stopAllGestures() { gestureControl.stopAllGestures(); } @@ -391,11 +397,11 @@ class FutoVideoPlayer : FutoVideoPlayerBase { fun setArtwork(drawable: Drawable?) { if (drawable != null) { _videoView.defaultArtwork = drawable; - _videoView.useArtwork = true; + _videoView.artworkDisplayMode = StyledPlayerView.ARTWORK_DISPLAY_MODE_FILL; fitOrFill(isFullScreen); } else { _videoView.defaultArtwork = null; - _videoView.useArtwork = false; + _videoView.artworkDisplayMode = StyledPlayerView.ARTWORK_DISPLAY_MODE_OFF; } }