Skip to content

Commit 50851b6

Browse files
authored
Merge pull request #424 from os2display/feature/7008-notified-videos-fixes
Fixed Notified merge issues
2 parents ca1c57f + 39efa20 commit 50851b6

3 files changed

Lines changed: 4 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ All notable changes to this project will be documented in this file.
5757
Release tarball.
5858
- Changed code analysis tool from psalm to phpstan.
5959
- Changed src/Controller/Api/AuthOidcController.php to get session from request.
60-
- Nofified FeedType: Added support for video media.
60+
- Nofified FeedType: Added support for video media and cleanup implementation.
6161

6262
### NB! Prior to 3.x the project was split into separate repositories
6363

phpstan-baseline.neon

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,18 +1824,6 @@ parameters:
18241824
count: 1
18251825
path: src/Feed/NotifiedFeedType.php
18261826

1827-
-
1828-
message: '#^Method App\\Feed\\NotifiedFeedType\:\:getFeedItemObject\(\) has parameter \$item with no value type specified in iterable type array\.$#'
1829-
identifier: missingType.iterableValue
1830-
count: 1
1831-
path: src/Feed/NotifiedFeedType.php
1832-
1833-
-
1834-
message: '#^Method App\\Feed\\NotifiedFeedType\:\:getFeedItemObject\(\) return type has no value type specified in iterable type array\.$#'
1835-
identifier: missingType.iterableValue
1836-
count: 1
1837-
path: src/Feed/NotifiedFeedType.php
1838-
18391827
-
18401828
message: '#^Method App\\Feed\\NotifiedFeedType\:\:getMentions\(\) has parameter \$searchProfileIds with no value type specified in iterable type array\.$#'
18411829
identifier: missingType.iterableValue

src/Feed/NotifiedFeedType.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class NotifiedFeedType implements FeedTypeInterface
2424
{
2525
final public const string SUPPORTED_FEED_TYPE = FeedOutputModels::INSTAGRAM_OUTPUT;
2626

27-
private const int REQUEST_TIMEOUT = 10;
2827
private const string BASE_URL = 'https://api.listen.notified.com';
2928
private const string DATETIME_FORMAT = 'Y-m-d\TH:i:s.v\Z';
3029
private const string LOOKBACK_PERIOD = '-3 months';
@@ -55,11 +54,10 @@ public function getData(Feed $feed): array
5554

5655
$token = $secrets['token'];
5756

58-
$feedItems = [];
57+
$mentions = [];
5958

6059
try {
61-
$data = $this->getMentions($token, 1, $pageSize, $configuration['feeds']);
62-
$feedItems = array_map($this->getFeedItemObject(...), $data);
60+
$mentions = $this->getMentions($token, 1, $pageSize, $configuration['feeds']);
6361
} catch (\Throwable $throwable) {
6462
$this->logger->error("NotifiedFeedType: Failed to get mentions: {$throwable->getMessage()}");
6563
}
@@ -69,7 +67,7 @@ public function getData(Feed $feed): array
6967
// Check that image/video is available and accessible, otherwise leave out the feed element.
7068
// Use the content type to determine if the mediaUrl is an image or video.
7169
// If the content type is not available, try to determine it from the file extension.
72-
foreach ($feedItems as $dataItem) {
70+
foreach ($mentions as $dataItem) {
7371
$mediaUrl = $dataItem['mediaUrl'] ?? null;
7472

7573
if (!is_string($mediaUrl)) {

0 commit comments

Comments
 (0)