From a86b71899ec52c44ddc6c3018e8cc5e9d7ff4d62 Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Thu, 27 Dec 2018 18:27:57 -0500 Subject: Add GPL modules --- MediaBrowser.Model/Updates/CheckForUpdateResult.cs | 30 ++++ MediaBrowser.Model/Updates/InstallationInfo.cs | 46 ++++++ MediaBrowser.Model/Updates/PackageInfo.cs | 176 +++++++++++++++++++++ MediaBrowser.Model/Updates/PackageTargetSystem.cs | 21 +++ MediaBrowser.Model/Updates/PackageVersionClass.cs | 21 +++ MediaBrowser.Model/Updates/PackageVersionInfo.cs | 95 +++++++++++ 6 files changed, 389 insertions(+) create mode 100644 MediaBrowser.Model/Updates/CheckForUpdateResult.cs create mode 100644 MediaBrowser.Model/Updates/InstallationInfo.cs create mode 100644 MediaBrowser.Model/Updates/PackageInfo.cs create mode 100644 MediaBrowser.Model/Updates/PackageTargetSystem.cs create mode 100644 MediaBrowser.Model/Updates/PackageVersionClass.cs create mode 100644 MediaBrowser.Model/Updates/PackageVersionInfo.cs (limited to 'MediaBrowser.Model/Updates') diff --git a/MediaBrowser.Model/Updates/CheckForUpdateResult.cs b/MediaBrowser.Model/Updates/CheckForUpdateResult.cs new file mode 100644 index 0000000000..ff0bba197e --- /dev/null +++ b/MediaBrowser.Model/Updates/CheckForUpdateResult.cs @@ -0,0 +1,30 @@ + +namespace MediaBrowser.Model.Updates +{ + /// + /// Class CheckForUpdateResult + /// + public class CheckForUpdateResult + { + /// + /// Gets or sets a value indicating whether this instance is update available. + /// + /// true if this instance is update available; otherwise, false. + public bool IsUpdateAvailable { get; set; } + + /// + /// Gets or sets the available version. + /// + /// The available version. + public string AvailableVersion + { + get { return Package != null ? Package.versionStr : "0.0.0.1"; } + set { } // need this for the serializer + } + + /// + /// Get or sets package information for an available update + /// + public PackageVersionInfo Package { get; set; } + } +} diff --git a/MediaBrowser.Model/Updates/InstallationInfo.cs b/MediaBrowser.Model/Updates/InstallationInfo.cs new file mode 100644 index 0000000000..09b4975a86 --- /dev/null +++ b/MediaBrowser.Model/Updates/InstallationInfo.cs @@ -0,0 +1,46 @@ +using System; + +namespace MediaBrowser.Model.Updates +{ + /// + /// Class InstallationInfo + /// + public class InstallationInfo + { + /// + /// Gets or sets the id. + /// + /// The id. + public Guid Id { get; set; } + + /// + /// Gets or sets the name. + /// + /// The name. + public string Name { get; set; } + + /// + /// Gets or sets the assembly guid. + /// + /// The guid of the assembly. + public string AssemblyGuid { get; set; } + + /// + /// Gets or sets the version. + /// + /// The version. + public string Version { get; set; } + + /// + /// Gets or sets the update class. + /// + /// The update class. + public PackageVersionClass UpdateClass { get; set; } + + /// + /// Gets or sets the percent complete. + /// + /// The percent complete. + public double? PercentComplete { get; set; } + } +} diff --git a/MediaBrowser.Model/Updates/PackageInfo.cs b/MediaBrowser.Model/Updates/PackageInfo.cs new file mode 100644 index 0000000000..e46d59fc07 --- /dev/null +++ b/MediaBrowser.Model/Updates/PackageInfo.cs @@ -0,0 +1,176 @@ +using System; +using System.Collections.Generic; + +namespace MediaBrowser.Model.Updates +{ + /// + /// Class PackageInfo + /// + public class PackageInfo + { + /// + /// The internal id of this package. + /// + /// The id. + public string id { get; set; } + + /// + /// Gets or sets the name. + /// + /// The name. + public string name { get; set; } + + /// + /// Gets or sets the short description. + /// + /// The short description. + public string shortDescription { get; set; } + + /// + /// Gets or sets the overview. + /// + /// The overview. + public string overview { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is premium. + /// + /// true if this instance is premium; otherwise, false. + public bool isPremium { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is adult only content. + /// + /// true if this instance is adult; otherwise, false. + public bool adult { get; set; } + + /// + /// Gets or sets the rich desc URL. + /// + /// The rich desc URL. + public string richDescUrl { get; set; } + + /// + /// Gets or sets the thumb image. + /// + /// The thumb image. + public string thumbImage { get; set; } + + /// + /// Gets or sets the preview image. + /// + /// The preview image. + public string previewImage { get; set; } + + /// + /// Gets or sets the type. + /// + /// The type. + public string type { get; set; } + + /// + /// Gets or sets the target filename. + /// + /// The target filename. + public string targetFilename { get; set; } + + /// + /// Gets or sets the owner. + /// + /// The owner. + public string owner { get; set; } + + /// + /// Gets or sets the category. + /// + /// The category. + public string category { get; set; } + + /// + /// Gets or sets the catalog tile color. + /// + /// The owner. + public string tileColor { get; set; } + + /// + /// Gets or sets the feature id of this package (if premium). + /// + /// The feature id. + public string featureId { get; set; } + + /// + /// Gets or sets the registration info for this package (if premium). + /// + /// The registration info. + public string regInfo { get; set; } + + /// + /// Gets or sets the price for this package (if premium). + /// + /// The price. + public float price { get; set; } + + /// + /// Gets or sets the target system for this plug-in (Server, MBTheater, MBClassic). + /// + /// The target system. + public PackageTargetSystem targetSystem { get; set; } + + /// + /// The guid of the assembly associated with this package (if a plug-in). + /// This is used to identify the proper item for automatic updates. + /// + /// The name. + public string guid { get; set; } + + /// + /// Gets or sets the total number of ratings for this package. + /// + /// The total ratings. + public int? totalRatings { get; set; } + + /// + /// Gets or sets the average rating for this package . + /// + /// The rating. + public float avgRating { get; set; } + + /// + /// Gets or sets whether or not this package is registered. + /// + /// True if registered. + public bool isRegistered { get; set; } + + /// + /// Gets or sets the expiration date for this package. + /// + /// Expiration Date. + public DateTime expDate { get; set; } + + /// + /// Gets or sets the versions. + /// + /// The versions. + public PackageVersionInfo[] versions { get; set; } + + /// + /// Gets or sets a value indicating whether [enable in application store]. + /// + /// true if [enable in application store]; otherwise, false. + public bool enableInAppStore { get; set; } + + /// + /// Gets or sets the installs. + /// + /// The installs. + public int installs { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public PackageInfo() + { + versions = new PackageVersionInfo[] { }; + } + } +} diff --git a/MediaBrowser.Model/Updates/PackageTargetSystem.cs b/MediaBrowser.Model/Updates/PackageTargetSystem.cs new file mode 100644 index 0000000000..c80dddde31 --- /dev/null +++ b/MediaBrowser.Model/Updates/PackageTargetSystem.cs @@ -0,0 +1,21 @@ +namespace MediaBrowser.Model.Updates +{ + /// + /// Enum PackageType + /// + public enum PackageTargetSystem + { + /// + /// Server + /// + Server, + /// + /// MB Theater + /// + MBTheater, + /// + /// MB Classic + /// + MBClassic + } +} \ No newline at end of file diff --git a/MediaBrowser.Model/Updates/PackageVersionClass.cs b/MediaBrowser.Model/Updates/PackageVersionClass.cs new file mode 100644 index 0000000000..3f51e1b3c5 --- /dev/null +++ b/MediaBrowser.Model/Updates/PackageVersionClass.cs @@ -0,0 +1,21 @@ +namespace MediaBrowser.Model.Updates +{ + /// + /// Enum PackageVersionClass + /// + public enum PackageVersionClass + { + /// + /// The release + /// + Release = 0, + /// + /// The beta + /// + Beta = 1, + /// + /// The dev + /// + Dev = 2 + } +} \ No newline at end of file diff --git a/MediaBrowser.Model/Updates/PackageVersionInfo.cs b/MediaBrowser.Model/Updates/PackageVersionInfo.cs new file mode 100644 index 0000000000..3ac5181872 --- /dev/null +++ b/MediaBrowser.Model/Updates/PackageVersionInfo.cs @@ -0,0 +1,95 @@ +using System; +using MediaBrowser.Model.Serialization; + +namespace MediaBrowser.Model.Updates +{ + /// + /// Class PackageVersionInfo + /// + public class PackageVersionInfo + { + /// + /// Gets or sets the name. + /// + /// The name. + public string name { get; set; } + + /// + /// Gets or sets the guid. + /// + /// The guid. + public string guid { get; set; } + + /// + /// Gets or sets the version STR. + /// + /// The version STR. + public string versionStr { get; set; } + + /// + /// The _version + /// + private Version _version; + /// + /// Gets or sets the version. + /// Had to make this an interpreted property since Protobuf can't handle Version + /// + /// The version. + [IgnoreDataMember] + public Version version + { + get { return _version ?? (_version = new Version(ValueOrDefault(versionStr, "0.0.0.1"))); } + } + + /// + /// Values the or default. + /// + /// The STR. + /// The def. + /// System.String. + private static string ValueOrDefault(string str, string def) + { + return string.IsNullOrEmpty(str) ? def : str; + } + + /// + /// Gets or sets the classification. + /// + /// The classification. + public PackageVersionClass classification { get; set; } + + /// + /// Gets or sets the description. + /// + /// The description. + public string description { get; set; } + + /// + /// Gets or sets the required version STR. + /// + /// The required version STR. + public string requiredVersionStr { get; set; } + + /// + /// Gets or sets the source URL. + /// + /// The source URL. + public string sourceUrl { get; set; } + + /// + /// Gets or sets the source URL. + /// + /// The source URL. + public string checksum { get; set; } + + /// + /// Gets or sets the target filename. + /// + /// The target filename. + public string targetFilename { get; set; } + + public string infoUrl { get; set; } + + public string runtimes { get; set; } + } +} \ No newline at end of file -- cgit v1.2.3