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,10 +199,17 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata
return;
}
var statusCode = await TubeArchivistApi.GetInstance().SetWatchedStatus(itemYTId, isPlayed).ConfigureAwait(true);
if (statusCode != System.Net.HttpStatusCode.OK)
try
{
Logger.LogCritical("POST /watched returned {StatusCode} for item {ItemName} ({VideoYTId}) with watched status {IsPlayed}", statusCode, eventArgs.Item.Name, itemYTId, isPlayed);
var statusCode = await TubeArchivistApi.GetInstance().SetWatchedStatus(itemYTId, isPlayed).ConfigureAwait(true);
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);
}
}
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"
changelog: >
Adapt to the new TA API changes
Fix JF crash when setting watched status with TA offline