diff options
| author | dkanada <dkanada@users.noreply.github.com> | 2019-08-11 03:47:10 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-11 03:47:10 -0700 |
| commit | 1ad67e223f581efd417efa2bb1cb626c50a6f5a9 (patch) | |
| tree | 9c0fa3d94deac2f807d638162736d8de571c9e5b /MediaBrowser.Model | |
| parent | a96fa7a5c705d8b694c828ff451a77d60711d329 (diff) | |
| parent | ecb8d8991b1ea4e1e26a69c7c9e0a217927d27d4 (diff) | |
Merge pull request #1462 from Bond-009/installationmanager
Improvements to InstallationManager
Diffstat (limited to 'MediaBrowser.Model')
| -rw-r--r-- | MediaBrowser.Model/Updates/PackageVersionInfo.cs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/MediaBrowser.Model/Updates/PackageVersionInfo.cs b/MediaBrowser.Model/Updates/PackageVersionInfo.cs index be531770d..7ef07c0df 100644 --- a/MediaBrowser.Model/Updates/PackageVersionInfo.cs +++ b/MediaBrowser.Model/Updates/PackageVersionInfo.cs @@ -30,23 +30,25 @@ namespace MediaBrowser.Model.Updates /// The _version /// </summary> private Version _version; + /// <summary> /// Gets or sets the version. /// Had to make this an interpreted property since Protobuf can't handle Version /// </summary> /// <value>The version.</value> [IgnoreDataMember] - public Version version => _version ?? (_version = new Version(ValueOrDefault(versionStr, "0.0.0.1"))); - - /// <summary> - /// Values the or default. - /// </summary> - /// <param name="str">The STR.</param> - /// <param name="def">The def.</param> - /// <returns>System.String.</returns> - private static string ValueOrDefault(string str, string def) + public Version Version { - return string.IsNullOrEmpty(str) ? def : str; + get + { + if (_version == null) + { + var ver = versionStr; + _version = new Version(string.IsNullOrEmpty(ver) ? "0.0.0.1" : ver); + } + + return _version; + } } /// <summary> |
