mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-22 22:10:35 +00:00
Add FindByName to IsoLanguage
(cherry picked from commit 723810014573c4bae2b8c611144bbee1a6b56237) Fixes #3699 Fixes #3700
This commit is contained in:
parent
fc6748e7ad
commit
c0b892ff7b
1 changed files with 6 additions and 5 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NzbDrone.Core.Languages;
|
using NzbDrone.Core.Languages;
|
||||||
|
@ -68,14 +69,14 @@ public static IsoLanguage Find(string isoCode)
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IsoLanguage FindByName(string name)
|
|
||||||
{
|
|
||||||
return All.FirstOrDefault(l => l.EnglishName == name.Trim());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IsoLanguage Get(Language language)
|
public static IsoLanguage Get(Language language)
|
||||||
{
|
{
|
||||||
return All.FirstOrDefault(l => l.Language == language);
|
return All.FirstOrDefault(l => l.Language == language);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IsoLanguage FindByName(string name)
|
||||||
|
{
|
||||||
|
return All.FirstOrDefault(l => l.EnglishName.Equals(name.Trim(), StringComparison.InvariantCultureIgnoreCase));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue