mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-15 17:58:31 +00:00
Get rid of variable
This commit is contained in:
parent
4284661afe
commit
7c7c60cccc
@ -159,18 +159,17 @@ export default async function({ id, index, toGif, dispatcher }) {
|
|||||||
case 0:
|
case 0:
|
||||||
return { error: 'ErrorNoVideosInTweet' };
|
return { error: 'ErrorNoVideosInTweet' };
|
||||||
case 1:
|
case 1:
|
||||||
const mediaMetadata = {
|
|
||||||
duration: Math.round(media[0].video_info.duration_millis / 1000),
|
|
||||||
likes: baseTweet.favorite_count,
|
|
||||||
views: Number(tweetResult.views.count)
|
|
||||||
};
|
|
||||||
return {
|
return {
|
||||||
type: needsFixing(media[0]) ? "remux" : "normal",
|
type: needsFixing(media[0]) ? "remux" : "normal",
|
||||||
urls: bestQuality(media[0].video_info.variants),
|
urls: bestQuality(media[0].video_info.variants),
|
||||||
filename: `twitter_${id}.mp4`,
|
filename: `twitter_${id}.mp4`,
|
||||||
audioFilename: `twitter_${id}_audio`,
|
audioFilename: `twitter_${id}_audio`,
|
||||||
isGif: media[0].type === "animated_gif",
|
isGif: media[0].type === "animated_gif",
|
||||||
mediaMetadata
|
mediaMetadata: {
|
||||||
|
duration: Math.round(media[0].video_info.duration_millis / 1000),
|
||||||
|
likes: baseTweet.favorite_count,
|
||||||
|
views: Number(tweetResult.views.count)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
default:
|
default:
|
||||||
const picker = media.map((content, i) => {
|
const picker = media.map((content, i) => {
|
||||||
@ -186,17 +185,15 @@ export default async function({ id, index, toGif, dispatcher }) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const mediaMetadata = {
|
|
||||||
duration: Math.round(content.video_info.duration_millis / 1000),
|
|
||||||
likes: baseTweet.favorite_count,
|
|
||||||
views: Number(tweetResult.views.count)
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type: 'video',
|
type: 'video',
|
||||||
url,
|
url,
|
||||||
thumb: content.media_url_https,
|
thumb: content.media_url_https,
|
||||||
mediaMetadata
|
mediaMetadata: {
|
||||||
|
duration: Math.round(content.video_info.duration_millis / 1000),
|
||||||
|
likes: baseTweet.favorite_count,
|
||||||
|
views: Number(tweetResult.views.count)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return { picker };
|
return { picker };
|
||||||
|
Loading…
Reference in New Issue
Block a user