summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authornullobsi <me@nullob.si>2021-05-27 17:38:09 -0700
committerGitHub <noreply@github.com>2021-05-28 09:38:09 +0900
commitffb9646ce9c3d2326a3e922e58702674eb65646c (patch)
treebb656e32c4b61313faad218578018a7bcc989e05 /src/server
parentimprove types (diff)
downloadsharkey-ffb9646ce9c3d2326a3e922e58702674eb65646c.tar.gz
sharkey-ffb9646ce9c3d2326a3e922e58702674eb65646c.tar.bz2
sharkey-ffb9646ce9c3d2326a3e922e58702674eb65646c.zip
Add image description support (#7518)
* recieve image descriptions under the name property * fix other components * use comment for alt and title * allow editing of file comment * allow editing of file comment in note dialog * federate note comments * use file instead of this * backend should accept comment on update * update now actually accepts comment * allow multiline descriptions * image should also have description attached * Update locales/ja-JP.yml Co-authored-by: rinsuki <428rinsuki+git@gmail.com> * Use custom component with side-by-side image * improve usability on mobile devices * revert changes * Update post-form-attaches.vue * Update drive.file.vue * Update media-caption.vue Co-authored-by: rinsuki <428rinsuki+git@gmail.com> Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'src/server')
-rw-r--r--src/server/api/endpoints/drive/files/update.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/server/api/endpoints/drive/files/update.ts b/src/server/api/endpoints/drive/files/update.ts
index 6eda83967b..f740fea67e 100644
--- a/src/server/api/endpoints/drive/files/update.ts
+++ b/src/server/api/endpoints/drive/files/update.ts
@@ -49,6 +49,14 @@ export const meta = {
'ja-JP': 'このメディアが「閲覧注意」(NSFW)かどうか',
'en-US': 'Whether this media is NSFW'
}
+ },
+
+ comment: {
+ validator: $.optional.nullable.str,
+ default: undefined as any,
+ desc: {
+ 'ja-JP': 'コメント'
+ }
}
},
@@ -92,6 +100,8 @@ export default define(meta, async (ps, user) => {
if (ps.name) file.name = ps.name;
+ if (ps.comment !== undefined) file.comment = ps.comment;
+
if (ps.isSensitive !== undefined) file.isSensitive = ps.isSensitive;
if (ps.folderId !== undefined) {
@@ -113,6 +123,7 @@ export default define(meta, async (ps, user) => {
await DriveFiles.update(file.id, {
name: file.name,
+ comment: file.comment,
folderId: file.folderId,
isSensitive: file.isSensitive
});