From f2200c97cbd79e5ff432948ee0fbd1e66ffa4e14 Mon Sep 17 00:00:00 2001 From: Niels van Velzen Date: Tue, 27 Dec 2022 14:24:34 +0100 Subject: Remove unused notification endpoints (#8952) --- .../Controllers/NotificationsController.cs | 87 +--------------------- 1 file changed, 1 insertion(+), 86 deletions(-) (limited to 'Jellyfin.Api/Controllers/NotificationsController.cs') diff --git a/Jellyfin.Api/Controllers/NotificationsController.cs b/Jellyfin.Api/Controllers/NotificationsController.cs index 420630cdf..a28556476 100644 --- a/Jellyfin.Api/Controllers/NotificationsController.cs +++ b/Jellyfin.Api/Controllers/NotificationsController.cs @@ -1,12 +1,5 @@ -using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading; using Jellyfin.Api.Constants; -using Jellyfin.Api.Models.NotificationDtos; -using Jellyfin.Data.Enums; -using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Notifications; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Notifications; @@ -23,41 +16,14 @@ namespace Jellyfin.Api.Controllers public class NotificationsController : BaseJellyfinApiController { private readonly INotificationManager _notificationManager; - private readonly IUserManager _userManager; /// /// Initializes a new instance of the class. /// /// The notification manager. - /// The user manager. - public NotificationsController(INotificationManager notificationManager, IUserManager userManager) + public NotificationsController(INotificationManager notificationManager) { _notificationManager = notificationManager; - _userManager = userManager; - } - - /// - /// Gets a user's notifications. - /// - /// Notifications returned. - /// An containing a list of notifications. - [HttpGet("{userId}")] - [ProducesResponseType(StatusCodes.Status200OK)] - public ActionResult GetNotifications() - { - return new NotificationResultDto(); - } - - /// - /// Gets a user's notification summary. - /// - /// Summary of user's notifications returned. - /// An containing a summary of the users notifications. - [HttpGet("{userId}/Summary")] - [ProducesResponseType(StatusCodes.Status200OK)] - public ActionResult GetNotificationsSummary() - { - return new NotificationsSummaryDto(); } /// @@ -83,56 +49,5 @@ namespace Jellyfin.Api.Controllers { return _notificationManager.GetNotificationServices(); } - - /// - /// Sends a notification to all admins. - /// - /// The notification request. - /// Notification sent. - /// A . - [HttpPost("Admin")] - [ProducesResponseType(StatusCodes.Status204NoContent)] - public ActionResult CreateAdminNotification([FromBody, Required] AdminNotificationDto notificationDto) - { - var notification = new NotificationRequest - { - Name = notificationDto.Name, - Description = notificationDto.Description, - Url = notificationDto.Url, - Level = notificationDto.NotificationLevel ?? NotificationLevel.Normal, - UserIds = _userManager.Users - .Where(user => user.HasPermission(PermissionKind.IsAdministrator)) - .Select(user => user.Id) - .ToArray(), - Date = DateTime.UtcNow, - }; - - _notificationManager.SendNotification(notification, CancellationToken.None); - return NoContent(); - } - - /// - /// Sets notifications as read. - /// - /// Notifications set as read. - /// A . - [HttpPost("{userId}/Read")] - [ProducesResponseType(StatusCodes.Status204NoContent)] - public ActionResult SetRead() - { - return NoContent(); - } - - /// - /// Sets notifications as unread. - /// - /// Notifications set as unread. - /// A . - [HttpPost("{userId}/Unread")] - [ProducesResponseType(StatusCodes.Status204NoContent)] - public ActionResult SetUnread() - { - return NoContent(); - } } } -- cgit v1.2.3