Bookmark Refactor (#1049)
* Tweaked how the migration to change users with ChangePassword role happens. It will now only run once. * Refactored bookmarks into it's own service with unit tests. Bookmark management happens in real time and we no longer delete bookmarks on a schedule. This means once you bookmark something, even if you delete the entity, the files will remain. * Commented out a test that no longer is needed
This commit is contained in:
parent
9c9a5f92a1
commit
05c35a1cb6
8 changed files with 685 additions and 230 deletions
|
@ -5,6 +5,7 @@ using System.Linq;
|
|||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading.Tasks;
|
||||
using API.Constants;
|
||||
using API.Data;
|
||||
using API.Entities;
|
||||
using API.Extensions;
|
||||
|
@ -150,7 +151,12 @@ namespace API
|
|||
await MigrateBookmarks.Migrate(directoryService, unitOfWork,
|
||||
logger, cacheService);
|
||||
|
||||
await MigrateChangePasswordRoles.Migrate(unitOfWork, userManager);
|
||||
// Only run this if we are upgrading
|
||||
var usersWithRole = await userManager.GetUsersInRoleAsync(PolicyConstants.ChangePasswordRole);
|
||||
if (usersWithRole.Count == 0)
|
||||
{
|
||||
await MigrateChangePasswordRoles.Migrate(unitOfWork, userManager);
|
||||
}
|
||||
|
||||
var requiresCoverImageMigration = !Directory.Exists(directoryService.CoverImageDirectory);
|
||||
try
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue