Update ApplicationHost.cs

This commit is contained in:
BaronGreenback 2020-09-17 15:57:11 +01:00 committed by GitHub
parent 826148dc84
commit 92b63db569
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1089,8 +1089,8 @@ namespace Emby.Server.Implementations
// No metafile, so lets see if the folder is versioned.
metafile = dir.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries)[^1];
int p = dir.LastIndexOf('_');
if (p != -1 && Version.TryParse(dir.Substring(p + 1), out Version ver))
int versionIndex = dir.LastIndexOf('_');
if (versionIndex != -1 && Version.TryParse(dir.Substring(versionIndex + 1), out Version ver))
{
// Versioned folder.
versions.Add((ver, metafile, dir));