diff options
| author | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2020-09-26 11:37:00 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-26 11:37:00 +0100 |
| commit | abfddba5684b59acd0fa74c18f3037b5c7cda4be (patch) | |
| tree | c9e9f8b50adf463a87b6e8801dc83d705906819d /Emby.Server.Implementations/ApplicationHost.cs | |
| parent | 4c6b60d69db57abf0c669a3ec918443d017fd0e5 (diff) | |
| parent | 800c03961281d4f2ee6d3d7c9d9c0db6f45f506a (diff) | |
Merge pull request #74 from jellyfin/master
Updating from upstream
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
| -rw-r--r-- | Emby.Server.Implementations/ApplicationHost.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 276d0fe30..7a46fdf2e 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -1086,9 +1086,20 @@ namespace Emby.Server.Implementations } else { + // No metafile, so lets see if the folder is versioned. metafile = dir.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries)[^1]; - // Add it under the path name and version 0.0.0.1. - versions.Add((new Version(0, 0, 0, 1), metafile, dir)); + + int versionIndex = dir.LastIndexOf('_'); + if (versionIndex != -1 && Version.TryParse(dir.Substring(versionIndex + 1), out Version ver)) + { + // Versioned folder. + versions.Add((ver, metafile, dir)); + } + else + { + // Un-versioned folder - Add it under the path name and version 0.0.0.1. + versions.Add((new Version(0, 0, 0, 1), metafile, dir)); + } } } catch |
