UX Changes, Tasks, WebP, and More! (#1280)

* When account updates occur for a user, send an event to them to tell them to refresh their account information (if they are on the site at the time). This way if we revoke permissions, the site will reactively adapt.

* Some cleanup on the user preferences to remove some calls we don't need anymore.

* Removed old bulk cleanup bookmark code as it's no longer needed.

* Tweaked the messaging for stat collection to reflect what we collect now versus when this was initially implemented.

* Implemented the ability for users to configure their servers to save bookmarks as webP. Reorganized the tabs for Admin dashboard to account for upcoming features.

* Implemented the ability to bulk convert bookmarks (as many times as the user wants).

Added a display of Reoccurring Jobs to the Tasks admin tab. Currently it's just placeholder, but will be enhanced further later in the release.

* Tweaked the wording around the convert switch.

* Moved System actions to the task tab

* Added a controller just for Tachiyomi so we can have dedicated APIs for that client. Deprecated an existing API on the Reader route.

* Fixed the unit tests
This commit is contained in:
Joseph Milazzo 2022-05-23 18:19:52 -05:00 committed by GitHub
parent dd83b6a9a1
commit e0a2fc615f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 971 additions and 271 deletions

View file

@ -73,6 +73,7 @@ namespace API.SignalR
/// A type of event that has progress (determinate or indeterminate).
/// The underlying event will have a name to give details on how to handle.
/// </summary>
/// <remarks>This is not an Event Name, it is used as the method only</remarks>
public const string NotificationProgress = "NotificationProgress";
/// <summary>
/// Event sent out when Scan Loop is parsing a file
@ -94,6 +95,14 @@ namespace API.SignalR
/// A user's progress was modified
/// </summary>
public const string UserProgressUpdate = "UserProgressUpdate";
/// <summary>
/// A user's account or preferences were updated and UI needs to refresh to stay in sync
/// </summary>
public const string UserUpdate = "UserUpdate";
/// <summary>
/// When bulk bookmarks are being converted
/// </summary>
public const string ConvertBookmarksProgress = "ConvertBookmarksProgress";
@ -387,5 +396,37 @@ namespace API.SignalR
}
};
}
public static SignalRMessage UserUpdateEvent(int userId, string userName)
{
return new SignalRMessage()
{
Name = UserUpdate,
Title = "User Update",
Progress = ProgressType.None,
Body = new
{
UserId = userId,
UserName = userName
}
};
}
public static SignalRMessage ConvertBookmarksProgressEvent(float progress, string eventType)
{
return new SignalRMessage()
{
Name = ConvertBookmarksProgress,
Title = "Converting Bookmarks to WebP",
SubTitle = string.Empty,
EventType = eventType,
Progress = ProgressType.Determinate,
Body = new
{
Progress = progress,
EventTime = DateTime.Now
}
};
}
}
}