client/upload: automatically set source when uploading from url

Fixes #230
This commit is contained in:
neobooru 2019-07-23 01:20:42 +02:00
parent 2484aef492
commit b8699d59d2

View file

@ -151,6 +151,9 @@ class PostUploadController {
} }
post.relations = uploadable.relations; post.relations = uploadable.relations;
post.newContent = uploadable.url || uploadable.file; post.newContent = uploadable.url || uploadable.file;
// if uploadable.source is ever going to be a valid field (e.g when setting source directly in the upload window)
// you'll need to change the line below to `post.source = uploadable.source || uploadable.url;`
if (uploadable.url) post.source = uploadable.url;
return post; return post;
} }
} }