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