Fix JF crash when setting watched status with TA offline

This commit is contained in:
DarkFighterLuke
2025-02-22 15:39:58 +01:00
parent 4db1ce755a
commit 11eb456c56
2 changed files with 11 additions and 3 deletions
@@ -199,12 +199,19 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata
return; return;
} }
try
{
var statusCode = await TubeArchivistApi.GetInstance().SetWatchedStatus(itemYTId, isPlayed).ConfigureAwait(true); var statusCode = await TubeArchivistApi.GetInstance().SetWatchedStatus(itemYTId, isPlayed).ConfigureAwait(true);
if (statusCode != System.Net.HttpStatusCode.OK) if (statusCode != System.Net.HttpStatusCode.OK)
{ {
Logger.LogCritical("POST /watched returned {StatusCode} for item {ItemName} ({VideoYTId}) with watched status {IsPlayed}", statusCode, eventArgs.Item.Name, itemYTId, isPlayed); Logger.LogCritical("POST /watched returned {StatusCode} for item {ItemName} ({VideoYTId}) with watched status {IsPlayed}", statusCode, eventArgs.Item.Name, itemYTId, isPlayed);
} }
} }
catch (Exception ex)
{
Logger.LogCritical("An exception occurred while calling POST /watched for item {ItemName} ({VideoYTId}) with watched status {IsPlayed}: {ExceptionMessage}", eventArgs.Item.Name, itemYTId, isPlayed, ex.Message);
}
}
} }
} }
} }
+1
View File
@@ -15,3 +15,4 @@ artifacts:
- "Jellyfin.Plugin.TubeArchivistMetadata.dll" - "Jellyfin.Plugin.TubeArchivistMetadata.dll"
changelog: > changelog: >
Adapt to the new TA API changes Adapt to the new TA API changes
Fix JF crash when setting watched status with TA offline