mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-18 11:03:17 +00:00
Fixes pixelfed/pixelfed#5272 Instagram import fails silently if there's one post only in posts_1.json
This commit is contained in:
parent
6615408023
commit
f6590570ff
1 changed files with 4 additions and 0 deletions
|
@ -369,6 +369,10 @@
|
|||
async filterPostMeta(media) {
|
||||
let fbfix = await this.fixFacebookEncoding(media);
|
||||
let json = JSON.parse(fbfix);
|
||||
/* Sometimes the JSON isn't an array, when there's only one post */
|
||||
if (!Array.isArray(json)) {
|
||||
json = new Array(json);
|
||||
}
|
||||
let res = json.filter(j => {
|
||||
let ids = j.media.map(m => m.uri).filter(m => {
|
||||
if(this.config.allow_video_posts == true) {
|
||||
|
|
Loading…
Reference in a new issue