Add FindByName to IsoLanguage

(cherry picked from commit 723810014573c4bae2b8c611144bbee1a6b56237)

Fixes #2515
pull/2538/head
Mark McDowall 1 year ago committed by Bogdan
parent e199e40621
commit 985f0fa4a6

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Core.Languages;
@ -68,14 +69,14 @@ namespace NzbDrone.Core.Parser
return null;
}
public static IsoLanguage FindByName(string name)
public static IsoLanguage Get(Language language)
{
return All.FirstOrDefault(l => l.EnglishName == name.Trim());
return All.FirstOrDefault(l => l.Language == language);
}
public static IsoLanguage Get(Language language)
public static IsoLanguage FindByName(string name)
{
return All.FirstOrDefault(l => l.Language == language);
return All.FirstOrDefault(l => l.EnglishName.Equals(name.Trim(), StringComparison.InvariantCultureIgnoreCase));
}
}
}

Loading…
Cancel
Save