Scanner Bugfixes (#2818)
This commit is contained in:
parent
829a610579
commit
93a8883fe4
24 changed files with 180 additions and 99 deletions
|
@ -129,6 +129,35 @@ public static class MigrateMixedSpecials
|
|||
|
||||
//UpdateCoverImage(directoryService, logger, specialChapter, extension, newVolume);
|
||||
}
|
||||
|
||||
var oldVolumeBookmarks = await dataContext.AppUserBookmark
|
||||
.Where(p => p.VolumeId == distinctVolume.Volume.Id).ToListAsync();
|
||||
logger.LogInformation("Moving {Count} existing Bookmarks from Volume Id {OldVolumeId} to New Volume {NewVolumeId}",
|
||||
oldVolumeBookmarks.Count, distinctVolume.Volume.Id, newVolume.Id);
|
||||
foreach (var bookmark in oldVolumeBookmarks)
|
||||
{
|
||||
bookmark.VolumeId = newVolume.Id;
|
||||
}
|
||||
|
||||
|
||||
var oldVolumePersonalToC = await dataContext.AppUserTableOfContent
|
||||
.Where(p => p.VolumeId == distinctVolume.Volume.Id).ToListAsync();
|
||||
logger.LogInformation("Moving {Count} existing Personal ToC from Volume Id {OldVolumeId} to New Volume {NewVolumeId}",
|
||||
oldVolumePersonalToC.Count, distinctVolume.Volume.Id, newVolume.Id);
|
||||
foreach (var pToc in oldVolumePersonalToC)
|
||||
{
|
||||
pToc.VolumeId = newVolume.Id;
|
||||
}
|
||||
|
||||
var oldVolumeReadingListItems = await dataContext.ReadingListItem
|
||||
.Where(p => p.VolumeId == distinctVolume.Volume.Id).ToListAsync();
|
||||
logger.LogInformation("Moving {Count} existing Personal ToC from Volume Id {OldVolumeId} to New Volume {NewVolumeId}",
|
||||
oldVolumeReadingListItems.Count, distinctVolume.Volume.Id, newVolume.Id);
|
||||
foreach (var readingListItem in oldVolumeReadingListItems)
|
||||
{
|
||||
readingListItem.VolumeId = newVolume.Id;
|
||||
}
|
||||
|
||||
await dataContext.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue