diff options
| author | dkanada <dkanada@users.noreply.github.com> | 2020-09-23 20:06:35 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-23 20:06:35 +0900 |
| commit | 236dfe3ed884aba37a2d71b778fa3329d4448ad9 (patch) | |
| tree | 89b9753859c6262012bcb5d65a70493aaa28c25d | |
| parent | 8a299ba7c0e537bd1b4d9d7355e13d241aa77a99 (diff) | |
| parent | 92b63db569f2e425673eba7d05e66411a9c4c21f (diff) | |
Merge pull request #4170 from BaronGreenback/VersioningImprovement
Plugin versioning - amended for plugins 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..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 |
