Skip to content

Commit

Permalink
Handle Null Groups better in Desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
da3dsoul committed Jan 8, 2024
1 parent 1ab41b1 commit 0ec403f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ public List<CL_VideoDetailed> GetFilesByGroupAndResolution(int animeID, string r
string resolution,
string videoSource, int videoBitDepth, int userID)
{
relGroupName = relGroupName == null ? null : Uri.UnescapeDataString(relGroupName.Replace("+", " "));
relGroupName = relGroupName == null || relGroupName.EqualsInvariantIgnoreCase("null") ? null : Uri.UnescapeDataString(relGroupName.Replace("+", " "));
videoSource = videoSource == null ? null : Uri.UnescapeDataString(videoSource.Replace("+", " "));
logger.Trace($"GetFilesByGroupAndResolution -- relGroupName: {relGroupName}");
logger.Trace($"GetFilesByGroupAndResolution -- videoSource: {videoSource}");
Expand Down Expand Up @@ -1330,7 +1330,7 @@ public List<CL_VideoDetailed> GetFilesByGroupAndResolution(int animeID, string r
var sourceMatches =
"Manual Link".EqualsInvariantIgnoreCase(videoSource) ||
"unknown".EqualsInvariantIgnoreCase(videoSource);
var groupMatches = Constants.NO_GROUP_INFO.EqualsInvariantIgnoreCase(relGroupName);
var groupMatches = Constants.NO_GROUP_INFO.EqualsInvariantIgnoreCase(relGroupName) || "null".EqualsInvariantIgnoreCase(relGroupName) || relGroupName == null;
logger.Trace($"GetFilesByGroupAndResolution -- sourceMatches (manual/unkown): {sourceMatches}");
logger.Trace($"GetFilesByGroupAndResolution -- groupMatches (NO GROUP INFO): {groupMatches}");

Expand All @@ -1352,8 +1352,8 @@ public List<CL_VideoDetailed> GetFilesByGroupAndResolution(int animeID, string r

if (!"raw".Equals(aniFile.Anime_GroupNameShort) &&
((aniFile.Anime_GroupName?.Contains("unk", StringComparison.InvariantCultureIgnoreCase) ?? false) ||
(aniFile.Anime_GroupNameShort?.Contains("unk", StringComparison.InvariantCultureIgnoreCase) ?? false)))
groupMatches = Constants.NO_GROUP_INFO.EqualsInvariantIgnoreCase(relGroupName);
(aniFile.Anime_GroupNameShort?.Contains("unk", StringComparison.InvariantCultureIgnoreCase) ?? false)) || aniFile.Anime_GroupName == null)
groupMatches = Constants.NO_GROUP_INFO.EqualsInvariantIgnoreCase(relGroupName) || relGroupName == null || "null".EqualsInvariantIgnoreCase(relGroupName);

logger.Trace($"GetFilesByGroupAndResolution -- sourceMatches (aniFile): {sourceMatches}");
logger.Trace($"GetFilesByGroupAndResolution -- groupMatches (aniFile): {groupMatches}");
Expand Down

0 comments on commit 0ec403f

Please sign in to comment.