mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-21 08:15:28 +03:00
update translations
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Common.ScheduledTasks;
|
||||
using MediaBrowser.Common.Updates;
|
||||
using MediaBrowser.Controller;
|
||||
@@ -42,7 +43,9 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
|
||||
private Timer LibraryUpdateTimer { get; set; }
|
||||
private readonly object _libraryChangedSyncLock = new object();
|
||||
|
||||
public Notifications(IInstallationManager installationManager, IUserManager userManager, ILogger logger, ITaskManager taskManager, INotificationManager notificationManager, ILibraryManager libraryManager, ISessionManager sessionManager, IServerApplicationHost appHost)
|
||||
private readonly IConfigurationManager _config;
|
||||
|
||||
public Notifications(IInstallationManager installationManager, IUserManager userManager, ILogger logger, ITaskManager taskManager, INotificationManager notificationManager, ILibraryManager libraryManager, ISessionManager sessionManager, IServerApplicationHost appHost, IConfigurationManager config)
|
||||
{
|
||||
_installationManager = installationManager;
|
||||
_userManager = userManager;
|
||||
@@ -52,6 +55,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
|
||||
_libraryManager = libraryManager;
|
||||
_sessionManager = sessionManager;
|
||||
_appHost = appHost;
|
||||
_config = config;
|
||||
}
|
||||
|
||||
public void Run()
|
||||
@@ -160,20 +164,25 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
|
||||
await SendNotification(notification).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
void _sessionManager_PlaybackStart(object sender, PlaybackProgressEventArgs e)
|
||||
{
|
||||
var item = e.MediaInfo;
|
||||
private NotificationOptions GetOptions()
|
||||
{
|
||||
return _config.GetConfiguration<NotificationOptions>("notifications");
|
||||
}
|
||||
|
||||
if (item == null)
|
||||
{
|
||||
_logger.Warn("PlaybackStart reported with null media info.");
|
||||
return;
|
||||
}
|
||||
void _sessionManager_PlaybackStart(object sender, PlaybackProgressEventArgs e)
|
||||
{
|
||||
var item = e.MediaInfo;
|
||||
|
||||
var type = GetPlaybackNotificationType(item.MediaType);
|
||||
if (item == null)
|
||||
{
|
||||
_logger.Warn("PlaybackStart reported with null media info.");
|
||||
return;
|
||||
}
|
||||
|
||||
SendPlaybackNotification(type, e);
|
||||
}
|
||||
var type = GetPlaybackNotificationType(item.MediaType);
|
||||
|
||||
SendPlaybackNotification(type, e);
|
||||
}
|
||||
|
||||
void _sessionManager_PlaybackStopped(object sender, PlaybackStopEventArgs e)
|
||||
{
|
||||
@@ -194,6 +203,11 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
|
||||
{
|
||||
var user = e.Users.FirstOrDefault();
|
||||
|
||||
if (user != null && !GetOptions().IsEnabledToMonitorUser(type, user.Id.ToString("N")))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var item = e.MediaInfo;
|
||||
var themeMedia = item as IThemeMedia;
|
||||
|
||||
@@ -203,6 +217,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var notification = new NotificationRequest
|
||||
{
|
||||
NotificationType = type
|
||||
|
||||
Reference in New Issue
Block a user