mirror of
https://github.com/transloadit/uppy.git
synced 2026-01-23 02:25:07 +00:00
add extensions to instagram files @arturi
This commit is contained in:
parent
e62d68f330
commit
61bf0a788b
1 changed files with 2 additions and 1 deletions
|
|
@ -102,6 +102,7 @@ module.exports = class Instagram extends Plugin {
|
|||
|
||||
getItemName (item) {
|
||||
if (item && item['created_time']) {
|
||||
const ext = item.type === 'video' ? 'mp4' : 'jpeg'
|
||||
let date = new Date(item['created_time'] * 1000)
|
||||
date = date.toLocaleDateString([], {
|
||||
year: 'numeric',
|
||||
|
|
@ -111,7 +112,7 @@ module.exports = class Instagram extends Plugin {
|
|||
minute: 'numeric'
|
||||
})
|
||||
// adding both date and carousel_id, so the name is unique
|
||||
return `Instagram ${date} ${item.carousel_id || ''}`
|
||||
return `Instagram ${date} ${item.carousel_id || ''}.${ext}`
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue