mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-02-24 05:22:52 +00:00
Merge remote-tracking branch 'upstream/master' into 3.1.7
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
using System;
|
||||
using Jellyfin.Data.Entities;
|
||||
using Jellyfin.Data.Events;
|
||||
using MediaBrowser.Model.Devices;
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
|
||||
20
MediaBrowser.Controller/Events/IEventConsumer.cs
Normal file
20
MediaBrowser.Controller/Events/IEventConsumer.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// An interface representing a type that consumes events of type <c>T</c>.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of events this consumes.</typeparam>
|
||||
public interface IEventConsumer<in T>
|
||||
where T : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// A method that is called when an event of type <c>T</c> is fired.
|
||||
/// </summary>
|
||||
/// <param name="eventArgs">The event.</param>
|
||||
/// <returns>A task representing the consumption of the event.</returns>
|
||||
Task OnEvent(T eventArgs);
|
||||
}
|
||||
}
|
||||
28
MediaBrowser.Controller/Events/IEventManager.cs
Normal file
28
MediaBrowser.Controller/Events/IEventManager.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// An interface that handles eventing.
|
||||
/// </summary>
|
||||
public interface IEventManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Publishes an event.
|
||||
/// </summary>
|
||||
/// <param name="eventArgs">the event arguments.</param>
|
||||
/// <typeparam name="T">The type of event.</typeparam>
|
||||
void Publish<T>(T eventArgs)
|
||||
where T : EventArgs;
|
||||
|
||||
/// <summary>
|
||||
/// Publishes an event asynchronously.
|
||||
/// </summary>
|
||||
/// <param name="eventArgs">The event arguments.</param>
|
||||
/// <typeparam name="T">The type of event.</typeparam>
|
||||
/// <returns>A task representing the publishing of the event.</returns>
|
||||
Task PublishAsync<T>(T eventArgs)
|
||||
where T : EventArgs;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using Jellyfin.Data.Events;
|
||||
using MediaBrowser.Controller.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Events.Session
|
||||
{
|
||||
/// <summary>
|
||||
/// An event that fires when a session is ended.
|
||||
/// </summary>
|
||||
public class SessionEndedEventArgs : GenericEventArgs<SessionInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SessionEndedEventArgs"/> class.
|
||||
/// </summary>
|
||||
/// <param name="arg">The session info.</param>
|
||||
public SessionEndedEventArgs(SessionInfo arg) : base(arg)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using Jellyfin.Data.Events;
|
||||
using MediaBrowser.Controller.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Events.Session
|
||||
{
|
||||
/// <summary>
|
||||
/// An event that fires when a session is started.
|
||||
/// </summary>
|
||||
public class SessionStartedEventArgs : GenericEventArgs<SessionInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SessionStartedEventArgs"/> class.
|
||||
/// </summary>
|
||||
/// <param name="arg">The session info.</param>
|
||||
public SessionStartedEventArgs(SessionInfo arg) : base(arg)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using Jellyfin.Data.Events;
|
||||
using MediaBrowser.Model.Updates;
|
||||
|
||||
namespace MediaBrowser.Controller.Events.Updates
|
||||
{
|
||||
/// <summary>
|
||||
/// An event that occurs when a plugin installation is cancelled.
|
||||
/// </summary>
|
||||
public class PluginInstallationCancelledEventArgs : GenericEventArgs<InstallationInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginInstallationCancelledEventArgs"/> class.
|
||||
/// </summary>
|
||||
/// <param name="arg">The installation info.</param>
|
||||
public PluginInstallationCancelledEventArgs(InstallationInfo arg) : base(arg)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using Jellyfin.Data.Events;
|
||||
using MediaBrowser.Model.Updates;
|
||||
|
||||
namespace MediaBrowser.Controller.Events.Updates
|
||||
{
|
||||
/// <summary>
|
||||
/// An event that occurs when a plugin is installed.
|
||||
/// </summary>
|
||||
public class PluginInstalledEventArgs : GenericEventArgs<InstallationInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginInstalledEventArgs"/> class.
|
||||
/// </summary>
|
||||
/// <param name="arg">The installation info.</param>
|
||||
public PluginInstalledEventArgs(InstallationInfo arg) : base(arg)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using Jellyfin.Data.Events;
|
||||
using MediaBrowser.Model.Updates;
|
||||
|
||||
namespace MediaBrowser.Controller.Events.Updates
|
||||
{
|
||||
/// <summary>
|
||||
/// An event that occurs when a plugin is installing.
|
||||
/// </summary>
|
||||
public class PluginInstallingEventArgs : GenericEventArgs<InstallationInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginInstallingEventArgs"/> class.
|
||||
/// </summary>
|
||||
/// <param name="arg">The installation info.</param>
|
||||
public PluginInstallingEventArgs(InstallationInfo arg) : base(arg)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using Jellyfin.Data.Events;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
|
||||
namespace MediaBrowser.Controller.Events.Updates
|
||||
{
|
||||
/// <summary>
|
||||
/// An event that occurs when a plugin is uninstalled.
|
||||
/// </summary>
|
||||
public class PluginUninstalledEventArgs : GenericEventArgs<IPlugin>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginUninstalledEventArgs"/> class.
|
||||
/// </summary>
|
||||
/// <param name="arg">The plugin.</param>
|
||||
public PluginUninstalledEventArgs(IPlugin arg) : base(arg)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using Jellyfin.Data.Events;
|
||||
using MediaBrowser.Model.Updates;
|
||||
|
||||
namespace MediaBrowser.Controller.Events.Updates
|
||||
{
|
||||
/// <summary>
|
||||
/// An event that occurs when a plugin is updated.
|
||||
/// </summary>
|
||||
public class PluginUpdatedEventArgs : GenericEventArgs<InstallationInfo>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginUpdatedEventArgs"/> class.
|
||||
/// </summary>
|
||||
/// <param name="arg">The installation info.</param>
|
||||
public PluginUpdatedEventArgs(InstallationInfo arg) : base(arg)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,13 +18,7 @@ namespace MediaBrowser.Controller
|
||||
{
|
||||
event EventHandler HasUpdateAvailableChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system info.
|
||||
/// </summary>
|
||||
/// <returns>SystemInfo.</returns>
|
||||
Task<SystemInfo> GetSystemInfo(CancellationToken cancellationToken);
|
||||
|
||||
Task<PublicSystemInfo> GetPublicSystemInfo(CancellationToken cancellationToken);
|
||||
IServiceProvider ServiceProvider { get; }
|
||||
|
||||
bool CanLaunchWebBrowser { get; }
|
||||
|
||||
@@ -57,6 +51,14 @@ namespace MediaBrowser.Controller
|
||||
/// <value>The name of the friendly.</value>
|
||||
string FriendlyName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system info.
|
||||
/// </summary>
|
||||
/// <returns>SystemInfo.</returns>
|
||||
Task<SystemInfo> GetSystemInfo(CancellationToken cancellationToken);
|
||||
|
||||
Task<PublicSystemInfo> GetPublicSystemInfo(CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all the local IP addresses of this API instance. Each address is validated by sending a 'ping' request
|
||||
/// to the API that should exist at the address.
|
||||
|
||||
@@ -4,9 +4,9 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Data.Entities;
|
||||
using Jellyfin.Data.Events;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.Users;
|
||||
|
||||
namespace MediaBrowser.Controller.Library
|
||||
@@ -21,26 +21,6 @@ namespace MediaBrowser.Controller.Library
|
||||
/// </summary>
|
||||
event EventHandler<GenericEventArgs<User>> OnUserUpdated;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when a user is created.
|
||||
/// </summary>
|
||||
event EventHandler<GenericEventArgs<User>> OnUserCreated;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when a user is deleted.
|
||||
/// </summary>
|
||||
event EventHandler<GenericEventArgs<User>> OnUserDeleted;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when a user's password is changed.
|
||||
/// </summary>
|
||||
event EventHandler<GenericEventArgs<User>> OnUserPasswordChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when a user is locked out.
|
||||
/// </summary>
|
||||
event EventHandler<GenericEventArgs<User>> OnUserLockedOut;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the users.
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace MediaBrowser.Controller.Library
|
||||
{
|
||||
/// <summary>
|
||||
/// An event that occurs when playback is started.
|
||||
/// </summary>
|
||||
public class PlaybackStartEventArgs : PlaybackProgressEventArgs
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,11 @@ using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Data.Entities;
|
||||
using Jellyfin.Data.Events;
|
||||
using MediaBrowser.Controller.Dto;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.LiveTv;
|
||||
using MediaBrowser.Model.Querying;
|
||||
|
||||
|
||||
@@ -8,8 +8,9 @@
|
||||
<PropertyGroup>
|
||||
<Authors>Jellyfin Contributors</Authors>
|
||||
<PackageId>Jellyfin.Controller</PackageId>
|
||||
<PackageLicenseUrl>https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt</PackageLicenseUrl>
|
||||
<VersionPrefix>10.7.0</VersionPrefix>
|
||||
<RepositoryUrl>https://github.com/jellyfin/jellyfin</RepositoryUrl>
|
||||
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Model.Events;
|
||||
using Jellyfin.Data.Events;
|
||||
using MediaBrowser.Model.Services;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Data.Entities;
|
||||
using Jellyfin.Data.Events;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.Providers;
|
||||
|
||||
namespace MediaBrowser.Controller.Providers
|
||||
|
||||
@@ -4,11 +4,11 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Data.Events;
|
||||
using MediaBrowser.Controller.Authentication;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Security;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
|
||||
namespace MediaBrowser.Controller.Subtitles
|
||||
{
|
||||
public class SubtitleDownloadEventArgs
|
||||
{
|
||||
public BaseItem Item { get; set; }
|
||||
|
||||
public string Format { get; set; }
|
||||
|
||||
public string Language { get; set; }
|
||||
|
||||
public bool IsForced { get; set; }
|
||||
|
||||
public string Provider { get; set; }
|
||||
}
|
||||
|
||||
public class SubtitleDownloadFailureEventArgs
|
||||
{
|
||||
public BaseItem Item { get; set; }
|
||||
|
||||
public string Provider { get; set; }
|
||||
|
||||
public Exception Exception { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
|
||||
namespace MediaBrowser.Controller.Subtitles
|
||||
{
|
||||
/// <summary>
|
||||
/// An event that occurs when subtitle downloading fails.
|
||||
/// </summary>
|
||||
public class SubtitleDownloadFailureEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the item.
|
||||
/// </summary>
|
||||
public BaseItem Item { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the provider.
|
||||
/// </summary>
|
||||
public string Provider { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the exception.
|
||||
/// </summary>
|
||||
public Exception Exception { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user