diff options
| author | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2020-09-17 11:01:46 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-17 11:01:46 +0100 |
| commit | 826148dc843616df4157de9f03e025fa60f6147d (patch) | |
| tree | 3b401692e378b1648ed6aace22005c2f8db7437b | |
| parent | 4c6b60d69db57abf0c669a3ec918443d017fd0e5 (diff) | |
Added versioning to files without meta.json
| -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..abec4126a 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 p = dir.LastIndexOf('_'); + if (p != -1 && Version.TryParse(dir.Substring(p + 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 |
