everywhere: things other than images can be described, so use mediaDescriptions everywhere

This commit is contained in:
William Pitcock 2019-02-18 06:03:41 +00:00
parent 4b9572bd17
commit 9fefd74e9a
4 changed files with 8 additions and 8 deletions

View File

@ -67,7 +67,7 @@ const PostStatusForm = {
status: statusText,
nsfw: false,
files: [],
imageDescriptions: {},
mediaDescriptions: {},
visibility: scope
},
caret: 0
@ -243,7 +243,7 @@ const PostStatusForm = {
visibility: newStatus.visibility,
sensitive: newStatus.nsfw,
media: newStatus.files,
imageDescriptions: newStatus.imageDescriptions || {},
mediaDescriptions: newStatus.mediaDescriptions || {},
store: this.$store,
inReplyToStatusId: this.replyTo,
contentType: newStatus.contentType
@ -253,7 +253,7 @@ const PostStatusForm = {
status: '',
spoilerText: '',
files: [],
imageDescriptions: {},
mediaDescriptions: {},
visibility: newStatus.visibility,
contentType: newStatus.contentType
}

View File

@ -86,7 +86,7 @@
<audio v-if="type(file) === 'audio'" :src="file.image" controls></audio>
<a v-if="type(file) === 'unknown'" :href="file.image">{{file.url}}</a>
</div>
<input type="text" :placeholder="$t('post_status.media_description')" v-model="newStatus.imageDescriptions[file.id]"></input>
<input type="text" :placeholder="$t('post_status.media_description')" v-model="newStatus.mediaDescriptions[file.id]"></input>
</div>
</div>
<div class="upload_settings" v-if="newStatus.files.length > 0">

View File

@ -424,7 +424,7 @@ const unretweet = ({ id, credentials }) => {
})
}
const postStatus = ({credentials, status, spoilerText, visibility, sensitive, mediaIds, inReplyToStatusId, contentType, noAttachmentLinks, imageDescriptions}) => {
const postStatus = ({credentials, status, spoilerText, visibility, sensitive, mediaIds, inReplyToStatusId, contentType, noAttachmentLinks, mediaDescriptions}) => {
const idsText = mediaIds.join(',')
const form = new FormData()
@ -435,7 +435,7 @@ const postStatus = ({credentials, status, spoilerText, visibility, sensitive, me
if (visibility) form.append('visibility', visibility)
if (sensitive) form.append('sensitive', sensitive)
if (contentType) form.append('content_type', contentType)
form.append('descriptions', JSON.stringify(imageDescriptions))
form.append('descriptions', JSON.stringify(mediaDescriptions))
form.append('media_ids', idsText)
if (inReplyToStatusId) {
form.append('in_reply_to_status_id', inReplyToStatusId)

View File

@ -1,10 +1,10 @@
import { map } from 'lodash'
import apiService from '../api/api.service.js'
const postStatus = ({ store, status, spoilerText, visibility, sensitive, media = [], inReplyToStatusId = undefined, contentType = 'text/plain', imageDescriptions = {} }) => {
const postStatus = ({ store, status, spoilerText, visibility, sensitive, media = [], inReplyToStatusId = undefined, contentType = 'text/plain', mediaDescriptions = {} }) => {
const mediaIds = map(media, 'id')
return apiService.postStatus({credentials: store.state.users.currentUser.credentials, status, spoilerText, visibility, sensitive, mediaIds, inReplyToStatusId, contentType, noAttachmentLinks: store.state.instance.noAttachmentLinks, imageDescriptions})
return apiService.postStatus({credentials: store.state.users.currentUser.credentials, status, spoilerText, visibility, sensitive, mediaIds, inReplyToStatusId, contentType, noAttachmentLinks: store.state.instance.noAttachmentLinks, mediaDescriptions})
.then((data) => {
if (!data.error) {
store.dispatch('addNewStatuses', {