client/posts: don't define flags on post upload

This commit is contained in:
Shyam Sunder 2020-03-21 18:36:52 -04:00
parent 65202189e1
commit 08e62ec885
3 changed files with 10 additions and 32 deletions

View file

@ -64,16 +64,6 @@
}) %> }) %>
</div> </div>
<% } %> <% } %>
<% if (['video'].includes(ctx.uploadable.type)) { %>
<div class='loop-video'>
<%= ctx.makeCheckbox({
text: 'Loop video',
name: 'loop-video',
checked: ctx.uploadable.flags.includes('loop'),
}) %>
</div>
<% } %>
</div> </div>
<div class='messages'></div> <div class='messages'></div>

View file

@ -49,12 +49,6 @@ class Uploadable extends events.EventTarget {
get name() { get name() {
throw new Error('Not implemented'); throw new Error('Not implemented');
} }
_initComplete() {
if (['video'].includes(this.type)) {
this.flags.push('loop');
}
}
} }
class File extends Uploadable { class File extends Uploadable {
@ -74,7 +68,6 @@ class File extends Uploadable {
new CustomEvent('finish', {detail: {uploadable: this}})); new CustomEvent('finish', {detail: {uploadable: this}}));
}); });
} }
this._initComplete();
} }
destroy() { destroy() {
@ -105,7 +98,6 @@ class Url extends Uploadable {
super(); super();
this.url = url; this.url = url;
this.dispatchEvent(new CustomEvent('finish')); this.dispatchEvent(new CustomEvent('finish'));
this._initComplete();
} }
get mimeType() { get mimeType() {
@ -290,11 +282,6 @@ class PostUploadView extends events.EventTarget {
uploadable.anonymous = true; uploadable.anonymous = true;
} }
uploadable.flags = [];
if (rowNode.querySelector('.loop-video input:checked')) {
uploadable.flags.push('loop');
}
uploadable.tags = []; uploadable.tags = [];
uploadable.relations = []; uploadable.relations = [];
for (let [i, lookalike] of uploadable.lookalikes.entries()) { for (let [i, lookalike] of uploadable.lookalikes.entries()) {

View file

@ -843,12 +843,13 @@ data.
automatically created. Tags created automatically have no implications, no automatically created. Tags created automatically have no implications, no
suggestions, one name and their category is set to the first tag category suggestions, one name and their category is set to the first tag category
found. Safety must be any of `"safe"`, `"sketchy"` or `"unsafe"`. Relations found. Safety must be any of `"safe"`, `"sketchy"` or `"unsafe"`. Relations
must contain valid post IDs. `<flag>` currently can be only `"loop"` to must contain valid post IDs. If `<flag>` is omitted, they will be defined
enable looping for video posts. Sending empty `thumbnail` will cause the by default (`"loop"` will be set for all video posts, and `"sound"` will be
post to use default thumbnail. If `anonymous` is set to truthy value, the auto-detected). Sending empty `thumbnail` will cause the post to use default
uploader name won't be recorded (privilege verification still applies; it's thumbnail. If `anonymous` is set to truthy value, the uploader name won't be
possible to disallow anonymous uploads completely from config.) For details recorded (privilege verification still applies; it's possible to disallow
how to pass `content` and `thumbnail`, see [file uploads](#file-uploads). anonymous uploads completely from config.) For details on how to pass `content`
and `thumbnail`, see [file uploads](#file-uploads).
## Updating post ## Updating post
- **Request** - **Request**
@ -892,9 +893,9 @@ data.
automatically created. Tags created automatically have no implications, no automatically created. Tags created automatically have no implications, no
suggestions, one name and their category is set to the first tag category suggestions, one name and their category is set to the first tag category
found. Safety must be any of `"safe"`, `"sketchy"` or `"unsafe"`. Relations found. Safety must be any of `"safe"`, `"sketchy"` or `"unsafe"`. Relations
must contain valid post IDs. `<flag>` currently can be only `"loop"` to must contain valid post IDs. `<flag>` can be either `"loop"` to enable looping
enable looping for video posts. Sending empty `thumbnail` will reset the for video posts or `"sound"` to indicate sound. Sending empty `thumbnail` will
post thumbnail to default. For details how to pass `content` and reset the post thumbnail to default. For details how to pass `content` and
`thumbnail`, see [file uploads](#file-uploads). All fields except the `thumbnail`, see [file uploads](#file-uploads). All fields except the
[`version`](#versioning) are optional - update concerns only provided [`version`](#versioning) are optional - update concerns only provided
fields. fields.