Skip to content

Commit

Permalink
fix hasAudio on images, increase request timeout to 10
Browse files Browse the repository at this point in the history
  • Loading branch information
kringkaste committed Feb 16, 2021
1 parent a1099cb commit 3a8c15d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

### Changed
- Prevent request storm if no items are cached and the request failed.
- Set default timeout for requests from 5 to 10 seconds.

### Fixed
- Fixed background color of icon
Expand Down
2 changes: 1 addition & 1 deletion src/models/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Settings extends Model
/**
* @var int Timeout in seconds waiting for the Instagram page to load
*/
public $timeout = 5;
public $timeout = 10;

/**
* @var boolean Use Guzzle instead of php's file stream to fetch the Instagram page
Expand Down
2 changes: 1 addition & 1 deletion src/services/InstagramService.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ private function flattenMediaArray($mediaArray): array
$item['timestamp'] = $media['node']['taken_at_timestamp'];
$item['caption'] = $media['node']['edge_media_to_caption']['edges'][0]['node']['text'] ?? '';
$item['isVideo'] = (bool)$media['node']['is_video'];
$item['hasAudio'] = (bool)$media['node']['has_audio'];
$item['hasAudio'] = $item['isVideo'] ? (bool)$media['node']['has_audio'] : false;
$item['video_view_count'] = $media['node']['video_view_count'] ?? 0;
$items[] = $item;
}
Expand Down

0 comments on commit 3a8c15d

Please sign in to comment.