mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-08 04:18:06 +02:00
when getting season number from paths, only look at path file name
This commit is contained in:
parent
9d1180cdc9
commit
a02017a524
1 changed files with 3 additions and 1 deletions
|
@ -120,10 +120,12 @@ namespace MediaBrowser.Controller.Library
|
||||||
/// <returns>System.Nullable{System.Int32}.</returns>
|
/// <returns>System.Nullable{System.Int32}.</returns>
|
||||||
public static int? GetSeasonNumberFromPath(string path)
|
public static int? GetSeasonNumberFromPath(string path)
|
||||||
{
|
{
|
||||||
|
var filename = Path.GetFileName(path);
|
||||||
|
|
||||||
// Look for one of the season folder names
|
// Look for one of the season folder names
|
||||||
foreach (var name in SeasonFolderNames)
|
foreach (var name in SeasonFolderNames)
|
||||||
{
|
{
|
||||||
var index = path.IndexOf(name, StringComparison.OrdinalIgnoreCase);
|
var index = filename.IndexOf(name, StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
if (index != -1)
|
if (index != -1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue