Преглед на файлове

add extensions to instagram files @arturi

Ifedapo Olarewaju преди 7 години
родител
ревизия
61bf0a788b
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      src/plugins/Instagram/index.js

+ 2 - 1
src/plugins/Instagram/index.js

@@ -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 ''
   }