Change GUID parsing from error level to info.

This commit is contained in:
arabcoders
2025-05-10 20:26:25 +03:00
parent 33fad10519
commit 309fa1dc92
3 changed files with 14 additions and 15 deletions

View File

@@ -24,6 +24,7 @@ class JellyfinGuid implements iGuid
'tmdb' => Guid::GUID_TMDB,
'tvdb' => Guid::GUID_TVDB,
'tvmaze' => Guid::GUID_TVMAZE,
'tv maze' => Guid::GUID_TVMAZE, //-- why emby?
'tvrage' => Guid::GUID_TVRAGE,
'anidb' => Guid::GUID_ANIDB,
'ytinforeader' => Guid::GUID_YOUTUBE,
@@ -267,18 +268,13 @@ class JellyfinGuid implements iGuid
$guid[$this->guidMapper[$key]] = $value;
} catch (Throwable $e) {
if (true === $log) {
$this->logger->error(
message: "{class}: Unhandled exception was thrown during '{client}: {user}@{backend}' {title}parsing '{agent}' identifier. '{error.message}' at '{error.file}:{error.line}'.",
$this->logger->info(
message: "{class}: Ignoring '{user}@{backend}' invalid GUID '{agent}' for {item.type} '{item.id}: {item.title}'.",
context: [
'class' => afterLast(static::class, '\\'),
'backend' => $this->context->backendName,
'client' => $this->context->clientName,
'user' => $this->context->userContext->name,
'backend' => $this->context->backendName,
'agent' => $value,
'title' => ag_exists($context, 'item.title') ? r(
"'{item.id}: {item.title}'",
$context
) . ' ' : '',
...$context,
...exception_log($e),
]

View File

@@ -418,16 +418,13 @@ final class PlexGuid implements iGuid
$guid[$this->guidMapper[$key]] = $value;
} catch (Throwable $e) {
if (true === $log) {
$this->logger->error(
message: "PlexGuid: Unhandled exception was thrown during '{client}: {backend}' {title}parsing '{agent}' identifier. '{error.message}' at '{error.file}:{error.line}'.",
$this->logger->info(
message: "{class}: Ignoring '{user}@{backend}' invalid GUID '{agent}' for {item.type} '{item.id}: {item.title}'.",
context: [
'class' => afterLast(self::class, '\\'),
'user' => $this->context->userContext->name,
'backend' => $this->context->backendName,
'client' => $this->context->clientName,
'agent' => $val,
'title' => ag_exists($context, 'item.title') ? r(
"'{item.id}: {item.title}'",
$context
) . ' ' : '',
...$context,
...exception_log($e),
]

View File

@@ -353,6 +353,12 @@ class JellyfinGuidTest extends TestCase
'none' => '123456',
'imdb' => ''
], $context), 'Assert that the GUID does not exist. for invalid GUIDs.');
$this->assertEquals(
[Guid::GUID_TVMAZE => '123456'],
$this->getClass()->parse(['tv maze' => '123456'], $context),
'Assert "tv maze" get converted to "tvmaze".'
);
}
public function test_get()