mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 18:47:15 -07:00
Attempt at fixing a potential bug found from #466
This commit is contained in:
parent
f098e0355e
commit
a7d5378426
11 changed files with 222 additions and 133 deletions
|
@ -72,6 +72,29 @@ namespace PlexRequests.Helpers
|
|||
return ep;
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetSeasonNumberFromTitle(string title)
|
||||
{
|
||||
if (string.IsNullOrEmpty(title))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
var split = title.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (split.Length < 2)
|
||||
{
|
||||
// Cannot get the season number, it's not in the usual format
|
||||
return 0;
|
||||
}
|
||||
|
||||
int season;
|
||||
if (int.TryParse(split[1], out season))
|
||||
{
|
||||
return season;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public class EpisodeModelHelper
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue