diff --git a/client/html/post_edit_sidebar.tpl b/client/html/post_edit_sidebar.tpl
index 4c055618..a66a375f 100644
--- a/client/html/post_edit_sidebar.tpl
+++ b/client/html/post_edit_sidebar.tpl
@@ -50,6 +50,11 @@
name: 'loop',
checked: ctx.post.flags.includes('loop'),
}) %>
+ <%= ctx.makeCheckbox({
+ text: 'Sound',
+ name: 'sound',
+ checked: ctx.post.flags.includes('sound'),
+ }) %>
<% } %>
diff --git a/client/html/post_readonly_sidebar.tpl b/client/html/post_readonly_sidebar.tpl
index 54208ef0..401ce209 100644
--- a/client/html/post_readonly_sidebar.tpl
+++ b/client/html/post_readonly_sidebar.tpl
@@ -14,6 +14,9 @@
}[ctx.post.mimeType] %>
(<%- ctx.post.canvasWidth %>x<%- ctx.post.canvasHeight %>)
+ <% if (ctx.post.flags.includes('sound')) { %>
+
+ <% } %>
diff --git a/client/js/controls/post_edit_sidebar_control.js b/client/js/controls/post_edit_sidebar_control.js
index dd8b66da..a5af449c 100644
--- a/client/js/controls/post_edit_sidebar_control.js
+++ b/client/js/controls/post_edit_sidebar_control.js
@@ -331,9 +331,7 @@ class PostEditSidebarControl extends events.EventTarget {
.value.toLowerCase() :
undefined,
- flags: this._loopVideoInputNode ?
- (this._loopVideoInputNode.checked ? ['loop'] : []) :
- undefined,
+ flags: this._videoFlags,
tags: this._tagInputNode ?
misc.splitByWhitespace(this._tagInputNode.value) :
@@ -375,6 +373,18 @@ class PostEditSidebarControl extends events.EventTarget {
return this._formNode.querySelector('.flags input[name=loop]');
}
+ get _soundVideoInputNode() {
+ return this._formNode.querySelector('.flags input[name=sound]');
+ }
+
+ get _videoFlags() {
+ if (!this._loopVideoInputNode) return undefined;
+ let ret = [];
+ if (this._loopVideoInputNode.checked) ret.push('loop');
+ if (this._soundVideoInputNode.checked) ret.push('sound');
+ return ret;
+ }
+
get _relationsInputNode() {
return this._formNode.querySelector('.relations input');
}
diff --git a/server/szurubooru/func/posts.py b/server/szurubooru/func/posts.py
index 9589a30f..4fcc087c 100644
--- a/server/szurubooru/func/posts.py
+++ b/server/szurubooru/func/posts.py
@@ -81,6 +81,7 @@ TYPE_MAP = {
FLAG_MAP = {
model.Post.FLAG_LOOP: 'loop',
+ model.Post.FLAG_SOUND: 'sound',
}
diff --git a/server/szurubooru/model/post.py b/server/szurubooru/model/post.py
index f04ffb53..d682c1b0 100644
--- a/server/szurubooru/model/post.py
+++ b/server/szurubooru/model/post.py
@@ -154,6 +154,7 @@ class Post(Base):
TYPE_FLASH = 'flash'
FLAG_LOOP = 'loop'
+ FLAG_SOUND = 'sound'
# basic meta
post_id = sa.Column('id', sa.Integer, primary_key=True)