diff --git a/src/Commands/State/PushCommand.php b/src/Commands/State/PushCommand.php
index 95b193b3..dca99c94 100644
--- a/src/Commands/State/PushCommand.php
+++ b/src/Commands/State/PushCommand.php
@@ -83,7 +83,7 @@ class PushCommand extends Command
protected function process(InputInterface $input, OutputInterface $output): int
{
if (!$this->cache->has('queue')) {
- $output->writeln('No items in the queue.', OutputInterface::VERBOSITY_DEBUG);
+ $output->writeln('No items in the queue.', OutputInterface::VERBOSITY_VERY_VERBOSE);
return self::SUCCESS;
}
@@ -103,7 +103,7 @@ class PushCommand extends Command
if (empty($entities)) {
$this->cache->delete('queue');
- $output->writeln('No items in the queued.', OutputInterface::VERBOSITY_DEBUG);
+ $output->writeln('No items in the queue.', OutputInterface::VERBOSITY_VERY_VERBOSE);
return self::SUCCESS;
}
@@ -143,7 +143,7 @@ class PushCommand extends Command
$type = strtolower(ag($server, 'type', 'unknown'));
if (true !== (bool)ag($server, 'webhook.push')) {
- $this->logger->info(sprintf('%s: Ignoring this backend as requested by user config.', $serverName));
+ $this->logger->info(sprintf('%s: Ignoring backend as requested by user config.', $serverName));
continue;
}
@@ -159,8 +159,13 @@ class PushCommand extends Command
continue;
}
- if (null === ag($server, 'url') || false === filter_var(ag($server, 'url'), FILTER_VALIDATE_URL)) {
- $this->logger->error(sprintf('%s: Backend does not have valid URL.', $serverName));
+ if (null === ($url = ag($server, 'url')) || false === filter_var($url, FILTER_VALIDATE_URL)) {
+ $this->logger->error(
+ sprintf('%s: Backend does not have valid url.', $serverName),
+ [
+ 'url' => $url ?? 'None'
+ ]
+ );
return self::FAILURE;
}
@@ -169,7 +174,7 @@ class PushCommand extends Command
}
if (empty($list)) {
- $output->writeln('No servers were found with \'webhook.push\' enabled.');
+ $output->writeln('No Backends have push via webhook enabled.');
return self::FAILURE;
}
diff --git a/src/Libs/Servers/JellyfinServer.php b/src/Libs/Servers/JellyfinServer.php
index 114583d2..15c5f8b2 100644
--- a/src/Libs/Servers/JellyfinServer.php
+++ b/src/Libs/Servers/JellyfinServer.php
@@ -675,11 +675,11 @@ class JellyfinServer implements ServerInterface
$requests = $stateRequests = [];
foreach ($entities as $key => $entity) {
- if (null === $entity) {
+ if (true !== ($entity instanceof StateEntity)) {
continue;
}
- if (false === (ag($this->options, Options::IGNORE_DATE, false))) {
+ if (false === (bool)ag($this->options, Options::IGNORE_DATE, false)) {
if (null !== $after && $after->getTimestamp() > $entity->updated) {
continue;
}
@@ -687,8 +687,11 @@ class JellyfinServer implements ServerInterface
$iName = $entity->getName();
- if (null === ($entity->metadata[$this->name][iFace::COLUMN_ID] ?? null)) {
- $this->logger->warning(sprintf('%s: Ignoring \'%s\'. No relation map.', $this->name, $iName));
+ if (null === $entity->metadata[$this->name][iFace::COLUMN_ID] ?? null) {
+ $this->logger->warning(
+ sprintf('%s: Ignoring \'%s\'. No relation map.', $this->name, $iName),
+ [$this->name => ag($entity->metadata, $this->name, 'no metadata found')]
+ );
continue;
}
diff --git a/src/Libs/Servers/PlexServer.php b/src/Libs/Servers/PlexServer.php
index df64e2a7..4f7dd89b 100644
--- a/src/Libs/Servers/PlexServer.php
+++ b/src/Libs/Servers/PlexServer.php
@@ -712,11 +712,11 @@ class PlexServer implements ServerInterface
$requests = $stateRequests = [];
foreach ($entities as $key => $entity) {
- if (null === $entity) {
+ if (true !== ($entity instanceof StateEntity)) {
continue;
}
- if (false === (ag($this->options, Options::IGNORE_DATE, false))) {
+ if (false === (bool)ag($this->options, Options::IGNORE_DATE, false)) {
if (null !== $after && $after->getTimestamp() > $entity->updated) {
continue;
}
@@ -724,13 +724,15 @@ class PlexServer implements ServerInterface
$iName = $entity->getName();
- if (null === ($entity->metdata[$this->name][iFace::COLUMN_ID] ?? null)) {
- $this->logger->warning(sprintf('%s: Ignoring \'%s\'. No relation map.', $this->name, $iName));
+ if (null === $entity->metadata[$this->name][iFace::COLUMN_ID] ?? null) {
+ $this->logger->warning(
+ sprintf('%s: Ignoring \'%s\'. No relation map.', $this->name, $iName),
+ [$this->name => ag($entity->metadata, $this->name, 'no metadata found')]
+ );
continue;
}
-
try {
- $url = $this->url->withPath('/library/metadata/' . $entity->metdata[$this->name][iFace::COLUMN_ID])
+ $url = $this->url->withPath('/library/metadata/' . $entity->metadata[$this->name][iFace::COLUMN_ID])
->withQuery(
http_build_query(
[
@@ -750,7 +752,7 @@ class PlexServer implements ServerInterface
'user_data' => [
'id' => $key,
'state' => &$entity,
- 'suid' => $entity->metdata[$this->name][iFace::COLUMN_ID],
+ 'suid' => $entity->metadata[$this->name][iFace::COLUMN_ID],
]
])
);