fix webp as image type
This commit is contained in:
@@ -31,7 +31,7 @@ const exportController = {
|
|||||||
start_datetime: { [Op.gte]: yesterday },
|
start_datetime: { [Op.gte]: yesterday },
|
||||||
...where
|
...where
|
||||||
},
|
},
|
||||||
include: [{ model: Tag, ...where_tags }, { model: Place, attributes: ['name', 'id', 'address'] }]
|
include: [{ model: Tag, required: false, ...where_tags }, { model: Place, attributes: ['name', 'id', 'address'] }]
|
||||||
})
|
})
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
if (this.image_path) {
|
if (this.image_path) {
|
||||||
attachment.push({
|
attachment.push({
|
||||||
type: 'Document',
|
type: 'Document',
|
||||||
mediaType: 'image/jpeg',
|
mediaType: 'image/webp',
|
||||||
url: `${config.baseurl}/media/${this.image_path}`,
|
url: `${config.baseurl}/media/${this.image_path}`,
|
||||||
name: null,
|
name: null,
|
||||||
blurHash: null
|
blurHash: null
|
||||||
@@ -66,8 +66,14 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
id: `${config.baseurl}/federation/m/${this.id}`,
|
id: `${config.baseurl}/federation/m/${this.id}`,
|
||||||
|
name: this.title,
|
||||||
url: `${config.baseurl}/event/${this.id}`,
|
url: `${config.baseurl}/event/${this.id}`,
|
||||||
type: 'Event',
|
type: 'Event',
|
||||||
|
startTime: moment.unix(this.start_datetime).locale(locale).format(),
|
||||||
|
endTime: moment.unix(this.end_datetime).locale(locale).format(),
|
||||||
|
location: {
|
||||||
|
name: this.place.name
|
||||||
|
},
|
||||||
attachment,
|
attachment,
|
||||||
tag: tags.map(tag => ({
|
tag: tags.map(tag => ({
|
||||||
type: 'Hashtag',
|
type: 'Hashtag',
|
||||||
@@ -78,7 +84,6 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
attributedTo: `${config.baseurl}/federation/u/${username}`,
|
attributedTo: `${config.baseurl}/federation/u/${username}`,
|
||||||
to: follower || [],
|
to: follower || [],
|
||||||
cc: ['https://www.w3.org/ns/activitystreams#Public', `${config.baseurl}/federation/u/${username}/followers`],
|
cc: ['https://www.w3.org/ns/activitystreams#Public', `${config.baseurl}/federation/u/${username}/followers`],
|
||||||
name: this.title,
|
|
||||||
summary,
|
summary,
|
||||||
sensitive: false
|
sensitive: false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ module.exports = {
|
|||||||
if (req.accepts('html')) { return res.redirect(301, '/') }
|
if (req.accepts('html')) { return res.redirect(301, '/') }
|
||||||
const name = req.params.name
|
const name = req.params.name
|
||||||
if (!name) { return res.status(400).send('Bad request.') }
|
if (!name) { return res.status(400).send('Bad request.') }
|
||||||
|
|
||||||
// const user = await User.findOne({ where: { username: name } })
|
// const user = await User.findOne({ where: { username: name } })
|
||||||
if (name !== req.settings.instance_name) { return res.status(404).send(`No record found for ${name}`) }
|
if (name !== req.settings.instance_name) { return res.status(404).send(`No record found for ${name}`) }
|
||||||
const ret = {
|
const ret = {
|
||||||
@@ -26,7 +27,7 @@ module.exports = {
|
|||||||
name,
|
name,
|
||||||
preferredUsername: name,
|
preferredUsername: name,
|
||||||
inbox: `${config.baseurl}/federation/u/${name}/inbox`,
|
inbox: `${config.baseurl}/federation/u/${name}/inbox`,
|
||||||
// outbox: `${config.baseurl}/federation/u/${name}/outbox`,
|
outbox: `${config.baseurl}/federation/u/${name}/outbox`,
|
||||||
// followers: `${config.baseurl}/federation/u/${name}/followers`,
|
// followers: `${config.baseurl}/federation/u/${name}/followers`,
|
||||||
discoverable: true,
|
discoverable: true,
|
||||||
attachment: [{
|
attachment: [{
|
||||||
|
|||||||
Reference in New Issue
Block a user