fix(tv-requests): 🐛 Fixed a small bug where an exception can get thrown when attempting to view TV Requests

This commit is contained in:
tidusjar 2023-07-03 20:11:15 +01:00
commit 9840077c5c

View file

@ -929,7 +929,14 @@ namespace Ombi.Core.Engine
var playedCount = playedEpisodes.Count(); var playedCount = playedEpisodes.Count();
var toWatchCount = requestedEpisodes.Count(); var toWatchCount = requestedEpisodes.Count();
if (playedCount == 0 || toWatchCount == 0)
{
request.RequestedUserPlayedProgress = 0;
}
else
{
request.RequestedUserPlayedProgress = 100 * playedCount / toWatchCount; request.RequestedUserPlayedProgress = 100 * playedCount / toWatchCount;
}
} }
} }