The Free Software Media System - Server Backend & API
added IServerEvents
Luke Pulverenti5267460391c0
diff --git a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csprojindex 926c680b8d..d91d72e803 100644--- a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj+++ b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj@@ -68,6 +68,12 @@<Compile Include="..\MediaBrowser.Model\ApiClient\IApiClient.cs"><Link>ApiClient\IApiClient.cs</Link></Compile>+ <Compile Include="..\MediaBrowser.Model\ApiClient\IServerEvents.cs">+ <Link>ApiClient\IServerEvents.cs</Link>+ </Compile>+ <Compile Include="..\MediaBrowser.Model\ApiClient\ServerEventArgs.cs">+ <Link>ApiClient\ServerEventArgs.cs</Link>+ </Compile><Compile Include="..\MediaBrowser.Model\Configuration\BaseApplicationConfiguration.cs"><Link>Configuration\BaseApplicationConfiguration.cs</Link></Compile>diff --git a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csprojindex 8d7ad5721f..4d62b472d7 100644--- a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj+++ b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj@@ -52,6 +52,15 @@<Reference Include="System.Xml" /></ItemGroup><ItemGroup>+ <Compile Include="..\MediaBrowser.Model\ApiClient\HttpResponseEventArgs.cs">+ <Link>ApiClient\HttpResponseEventArgs.cs</Link>+ </Compile>+ <Compile Include="..\MediaBrowser.Model\ApiClient\IServerEvents.cs">+ <Link>ApiClient\IServerEvents.cs</Link>+ </Compile>+ <Compile Include="..\MediaBrowser.Model\ApiClient\ServerEventArgs.cs">+ <Link>ApiClient\ServerEventArgs.cs</Link>+ </Compile><Compile Include="..\MediaBrowser.Model\Configuration\BaseApplicationConfiguration.cs"><Link>Configuration\BaseApplicationConfiguration.cs</Link></Compile>diff --git a/MediaBrowser.Model/ApiClient/IServerEvents.cs b/MediaBrowser.Model/ApiClient/IServerEvents.csnew file mode 100644index 0000000000..23ec515596--- /dev/null+++ b/MediaBrowser.Model/ApiClient/IServerEvents.cs@@ -0,0 +1,104 @@+using System;++namespace MediaBrowser.Model.ApiClient+{+ /// <summary>+ /// Interface IServerEvents+ /// </summary>+ public interface IServerEvents+ {+ /// <summary>+ /// Occurs when [user deleted].+ /// </summary>+ event EventHandler<UserDeletedEventArgs> UserDeleted;+ /// <summary>+ /// Occurs when [scheduled task started].+ /// </summary>+ event EventHandler<ScheduledTaskStartedEventArgs> ScheduledTaskStarted;+ /// <summary>+ /// Occurs when [scheduled task ended].+ /// </summary>+ event EventHandler<ScheduledTaskEndedEventArgs> ScheduledTaskEnded;+ /// <summary>+ /// Occurs when [package installing].+ /// </summary>+ event EventHandler<PackageInstallationEventArgs> PackageInstalling;+ /// <summary>+ /// Occurs when [package installation failed].+ /// </summary>+ event EventHandler<PackageInstallationEventArgs> PackageInstallationFailed;+ /// <summary>+ /// Occurs when [package installation completed].+ /// </summary>+ event EventHandler<PackageInstallationEventArgs> PackageInstallationCompleted;+ /// <summary>+ /// Occurs when [package installation cancelled].+ /// </summary>+ event EventHandler<PackageInstallationEventArgs> PackageInstallationCancelled;+ /// <summary>+ /// Occurs when [user updated].+ /// </summary>+ event EventHandler<UserUpdatedEventArgs> UserUpdated;+ /// <summary>+ /// Occurs when [plugin uninstalled].+ /// </summary>+ event EventHandler<PluginUninstallEventArgs> PluginUninstalled;+ /// <summary>+ /// Occurs when [library changed].+ /// </summary>+ event EventHandler<LibraryChangedEventArgs> LibraryChanged;++ /// <summary>+ /// Occurs when [browse command].+ /// </summary>+ event EventHandler<BrowseRequestEventArgs> BrowseCommand;+ /// <summary>+ /// Occurs when [play command].+ /// </summary>+ event EventHandler<PlayRequestEventArgs> PlayCommand;+ /// <summary>+ /// Occurs when [playstate command].+ /// </summary>+ event EventHandler<PlaystateRequestEventArgs> PlaystateCommand;+ /// <summary>+ /// Occurs when [message command].+ /// </summary>+ event EventHandler<MessageCommandEventArgs> MessageCommand;+ /// <summary>+ /// Occurs when [system command].+ /// </summary>+ event EventHandler<SystemCommandEventArgs> SystemCommand;+ /// <summary>+ /// Occurs when [notification added].+ /// </summary>+ event EventHandler<EventArgs> NotificationAdded;+ /// <summary>+ /// Occurs when [notification updated].+ /// </summary>+ event EventHandler<EventArgs> NotificationUpdated;+ /// <summary>+ /// Occurs when [notifications marked read].+ /// </summary>+ event EventHandler<EventArgs> NotificationsMarkedRead;+ /// <summary>+ /// Occurs when [server restarting].+ /// </summary>+ event EventHandler<EventArgs> ServerRestarting;+ /// <summary>+ /// Occurs when [server shutting down].+ /// </summary>+ event EventHandler<EventArgs> ServerShuttingDown;+ /// <summary>+ /// Occurs when [sessions updated].+ /// </summary>+ event EventHandler<SessionUpdatesEventArgs> SessionsUpdated;+ /// <summary>+ /// Occurs when [restart required].+ /// </summary>+ event EventHandler<EventArgs> RestartRequired;+ /// <summary>+ /// Occurs when [user data changed].+ /// </summary>+ event EventHandler<UserDataChangedEventArgs> UserDataChanged;+ }+}diff --git a/MediaBrowser.Model/ApiClient/ServerEventArgs.cs b/MediaBrowser.Model/ApiClient/ServerEventArgs.csnew file mode 100644index 0000000000..d3212caf45--- /dev/null+++ b/MediaBrowser.Model/ApiClient/ServerEventArgs.cs@@ -0,0 +1,171 @@+using MediaBrowser.Model.Dto;+using MediaBrowser.Model.Entities;+using MediaBrowser.Model.Plugins;+using MediaBrowser.Model.Session;+using MediaBrowser.Model.Tasks;+using MediaBrowser.Model.Updates;+using System;++namespace MediaBrowser.Model.ApiClient+{+ /// <summary>+ /// Class UserDeletedEventArgs+ /// </summary>+ public class UserDeletedEventArgs : EventArgs+ {+ /// <summary>+ /// Gets or sets the id.+ /// </summary>+ /// <value>The id.</value>+ public string Id { get; set; }+ }++ public class UserDataChangedEventArgs : EventArgs+ {+ /// <summary>+ /// Gets or sets the user.+ /// </summary>+ /// <value>The user.</value>+ public UserDataChangeInfo ChangeInfo { get; set; }+ }++ /// <summary>+ /// Class UserUpdatedEventArgs+ /// </summary>+ public class UserUpdatedEventArgs : EventArgs+ {+ /// <summary>+ /// Gets or sets the user.+ /// </summary>+ /// <value>The user.</value>+ public UserDto User { get; set; }+ }++ /// <summary>+ /// Class ScheduledTaskStartedEventArgs+ /// </summary>+ public class ScheduledTaskStartedEventArgs : EventArgs+ {+ /// <summary>+ /// Gets or sets the name.+ /// </summary>+ /// <value>The name.</value>+ public string Name { get; set; }+ }++ /// <summary>+ /// Class ScheduledTaskEndedEventArgs+ /// </summary>+ public class ScheduledTaskEndedEventArgs : EventArgs+ {+ /// <summary>+ /// Gets or sets the result.+ /// </summary>+ /// <value>The result.</value>+ public TaskResult Result { get; set; }+ }++ /// <summary>+ /// Class PackageInstallationEventArgs+ /// </summary>+ public class PackageInstallationEventArgs : EventArgs+ {+ /// <summary>+ /// Gets or sets the installation info.+ /// </summary>+ /// <value>The installation info.</value>+ public InstallationInfo InstallationInfo { get; set; }+ }++ /// <summary>+ /// Class PluginUninstallEventArgs+ /// </summary>+ public class PluginUninstallEventArgs : EventArgs+ {+ /// <summary>+ /// Gets or sets the plugin info.+ /// </summary>+ /// <value>The plugin info.</value>+ public PluginInfo PluginInfo { get; set; }+ }++ /// <summary>+ /// Class LibraryChangedEventArgs+ /// </summary>+ public class LibraryChangedEventArgs : EventArgs+ {+ /// <summary>+ /// Gets or sets the update info.+ /// </summary>+ /// <value>The update info.</value>+ public LibraryUpdateInfo UpdateInfo { get; set; }+ }++ /// <summary>+ /// Class BrowseRequestEventArgs+ /// </summary>+ public class BrowseRequestEventArgs : EventArgs+ {+ /// <summary>+ /// Gets or sets the request.+ /// </summary>+ /// <value>The request.</value>+ public BrowseRequest Request { get; set; }+ }++ /// <summary>+ /// Class PlayRequestEventArgs+ /// </summary>+ public class PlayRequestEventArgs : EventArgs+ {+ /// <summary>+ /// Gets or sets the request.+ /// </summary>+ /// <value>The request.</value>+ public PlayRequest Request { get; set; }+ }++ /// <summary>+ /// Class PlaystateRequestEventArgs+ /// </summary>+ public class PlaystateRequestEventArgs : EventArgs+ {+ /// <summary>+ /// Gets or sets the request.+ /// </summary>+ /// <value>The request.</value>+ public PlaystateRequest Request { get; set; }+ }++ /// <summary>+ /// Class MessageCommandEventArgs+ /// </summary>+ public class MessageCommandEventArgs : EventArgs+ {+ /// <summary>+ /// Gets or sets the request.+ /// </summary>+ /// <value>The request.</value>+ public MessageCommand Request { get; set; }+ }++ /// <summary>+ /// Class SystemCommandEventArgs+ /// </summary>+ public class SystemCommandEventArgs : EventArgs+ {+ /// <summary>+ /// Gets or sets the command.+ /// </summary>+ /// <value>The command.</value>+ public SystemCommand Command { get; set; }+ }++ /// <summary>+ /// Class SessionUpdatesEventArgs+ /// </summary>+ public class SessionUpdatesEventArgs : EventArgs+ {+ public SessionInfoDto[] Sessions { get; set; }+ }+}diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csprojindex adb05149a7..fd450b585c 100644--- a/MediaBrowser.Model/MediaBrowser.Model.csproj+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj@@ -45,6 +45,8 @@<Compile Include="ApiClient\HttpResponseEventArgs.cs" /><Compile Include="ApiClient\IApiClient.cs" /><Compile Include="ApiClient\ApiClientExtensions.cs" />+ <Compile Include="ApiClient\IServerEvents.cs" />+ <Compile Include="ApiClient\ServerEventArgs.cs" /><Compile Include="Configuration\BaseApplicationConfiguration.cs" /><Compile Include="Configuration\ManualLoginCategory.cs" /><Compile Include="Configuration\ServerConfiguration.cs" />diff --git a/MediaBrowser.Mono.userprefs b/MediaBrowser.Mono.userprefsindex 1cbdc7c0a1..3f004b5b02 100644--- a/MediaBrowser.Mono.userprefs+++ b/MediaBrowser.Mono.userprefs@@ -5,9 +5,9 @@<File FileName="MediaBrowser.Server.Implementations\HttpServer\HttpServer.cs" Line="1" Column="1" /><File FileName="MediaBrowser.Server.Mono\FFMpeg\FFMpegDownloader.cs" Line="1" Column="1" /><File FileName="MediaBrowser.Server.Mono\Networking\NetworkManager.cs" Line="1" Column="1" />- <File FileName="MediaBrowser.ServerApplication\ApplicationHost.cs" Line="525" Column="50" />+ <File FileName="MediaBrowser.ServerApplication\ApplicationHost.cs" Line="1" Column="1" /><File FileName="MediaBrowser.Server.Mono\Native\NativeApp.cs" Line="1" Column="1" />- <File FileName="MediaBrowser.Server.Mono\Program.cs" Line="250" Column="64" />+ <File FileName="MediaBrowser.Server.Mono\Program.cs" Line="193" Column="25" /></Files></MonoDevelop.Ide.Workbench><MonoDevelop.Ide.DebuggingService.Breakpoints>diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspecindex ff1ee204c2..4fecf8feec 100644--- a/Nuget/MediaBrowser.Common.Internal.nuspec+++ b/Nuget/MediaBrowser.Common.Internal.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"><metadata><id>MediaBrowser.Common.Internal</id>- <version>3.0.223</version>+ <version>3.0.224</version><title>MediaBrowser.Common.Internal</title><authors>Luke</authors><owners>ebr,Luke,scottisafool</owners>@@ -12,7 +12,7 @@<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description><copyright>Copyright © Media Browser 2013</copyright><dependencies>- <dependency id="MediaBrowser.Common" version="3.0.223" />+ <dependency id="MediaBrowser.Common" version="3.0.224" /><dependency id="NLog" version="2.0.1.2" /><dependency id="ServiceStack.Text" version="3.9.58" /><dependency id="SimpleInjector" version="2.3.2" />diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspecindex 2a650c467e..29a9eb1234 100644--- a/Nuget/MediaBrowser.Common.nuspec+++ b/Nuget/MediaBrowser.Common.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"><metadata><id>MediaBrowser.Common</id>- <version>3.0.223</version>+ <version>3.0.224</version><title>MediaBrowser.Common</title><authors>Media Browser Team</authors><owners>ebr,Luke,scottisafool</owners>diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspecindex 2d30823a30..c26497b39a 100644--- a/Nuget/MediaBrowser.Server.Core.nuspec+++ b/Nuget/MediaBrowser.Server.Core.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"><metadata><id>MediaBrowser.Server.Core</id>- <version>3.0.223</version>+ <version>3.0.224</version><title>Media Browser.Server.Core</title><authors>Media Browser Team</authors><owners>ebr,Luke,scottisafool</owners>@@ -12,7 +12,7 @@<description>Contains core components required to build plugins for Media Browser Server.</description><copyright>Copyright © Media Browser 2013</copyright><dependencies>- <dependency id="MediaBrowser.Common" version="3.0.223" />+ <dependency id="MediaBrowser.Common" version="3.0.224" /></dependencies></metadata><files>