Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Add auto play next video migration

Chocobozzz85c1df6ae899
diff --git a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html b/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html
index 06fd9833a5..84c78c457e 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html
+++ b/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html
@@ -47,7 +47,9 @@
inputName="autoPlayVideo" formControlName="autoPlayVideo"
i18n-labelText labelText="Automatically plays video"
></my-peertube-checkbox>
+ </div>
+ <div class="form-group">
<my-peertube-checkbox
inputName="autoPlayNextVideo" formControlName="autoPlayNextVideo"
i18n-labelText labelText="Automatically starts playing next video"
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index be4a664889..332b57cf2e 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -14,7 +14,7 @@ import { CONFIG, registerConfigChangedHandler } from './config'
// ---------------------------------------------------------------------------
-const LAST_MIGRATION_VERSION = 435
+const LAST_MIGRATION_VERSION = 440
// ---------------------------------------------------------------------------
diff --git a/server/initializers/migrations/0440-user-auto-play-next-video.ts b/server/initializers/migrations/0440-user-auto-play-next-video.ts
new file mode 100644
index 0000000000..f0baafe7b2
--- /dev/null
+++ b/server/initializers/migrations/0440-user-auto-play-next-video.ts
@@ -0,0 +1,27 @@
+import * as Sequelize from 'sequelize'
+
+async function up (utils: {
+ transaction: Sequelize.Transaction,
+ queryInterface: Sequelize.QueryInterface,
+ sequelize: Sequelize.Sequelize,
+ db: any
+}): Promise<void> {
+ {
+ const data = {
+ type: Sequelize.BOOLEAN,
+ allowNull: false,
+ defaultValue: false
+ }
+
+ await utils.queryInterface.addColumn('user', 'autoPlayNextVideo', data)
+ }
+}
+
+function down (options) {
+ throw new Error('Not implemented.')
+}
+
+export {
+ up,
+ down
+}