Misc Bugfixes and Enhancements (#507)

* Removed some extra spam for the console

* Implemented the code to update RowVersion, which is our concurrency check

* Fixed a critical issue where more than one bookmark could occur for a given chapter due to a race condition. Now we use concurrency checks and we also gracefully allow more than one row, by only grabbing first.

* Cleaned up the logic for IHasConcurencyToken and updated the setters to be private.

* Lots of comments and when deleting a library, remove any user progress items for which chapters don't exist.

* When deleting a Series, cleanup user progress rows.

* Now after a scan of library, if a series is removed, collection tags are pruned as well if there are no longer any series bound to it.

* Updated the image on the Readme to show a better picture

* Small code cleanup to remove null check modifier as I check for null just before then

* Fixed images loading multiple times due to using function in binding with random. You can now click chapter images to read that chapter specifically.

* Fixed cards being different sizes when read vs unread

* Moved over Robbie's workflow changes from notifier. Commented out activity indicators as that is not shipping with this release.

* Remove code that isn't needed

* Reverted GA

* Changed GA to trigger only when HEAD is updated
This commit is contained in:
Joseph Milazzo 2021-08-17 14:15:32 -07:00 committed by GitHub
parent 16faa82d20
commit 3ed99afd32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 1378 additions and 81 deletions

View file

@ -18,9 +18,11 @@ namespace API.Entities
public AppUserPreferences UserPreferences { get; set; }
public ICollection<AppUserBookmark> Bookmarks { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; set; }
public uint RowVersion { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;

View file

@ -1,30 +1,71 @@

using System;
using System.ComponentModel.DataAnnotations;
using API.Entities.Interfaces;
using Microsoft.EntityFrameworkCore;
namespace API.Entities
{
/// <summary>
/// Represents the progress a single user has on a given Chapter.
/// </summary>
public class AppUserProgress : IEntityDate
//[Index(nameof(SeriesId), nameof(VolumeId), nameof(ChapterId), nameof(AppUserId), IsUnique = true)]
public class AppUserProgress : IEntityDate, IHasConcurrencyToken
{
/// <summary>
/// Id of Entity
/// </summary>
public int Id { get; set; }
/// <summary>
/// Pages Read for given Chapter
/// </summary>
public int PagesRead { get; set; }
/// <summary>
/// Volume belonging to Chapter
/// </summary>
public int VolumeId { get; set; }
/// <summary>
/// Series belonging to Chapter
/// </summary>
public int SeriesId { get; set; }
/// <summary>
/// Chapter
/// </summary>
public int ChapterId { get; set; }
/// <summary>
/// For Book Reader, represents the nearest passed anchor on the screen that can be used to resume scroll point
/// on next load
/// </summary>
public string BookScrollId { get; set; }
// Relationships
/// <summary>
/// Navigational Property for EF. Links to a unique AppUser
/// </summary>
public AppUser AppUser { get; set; }
/// <summary>
/// User this progress belongs to
/// </summary>
public int AppUserId { get; set; }
/// <summary>
/// When this was first created
/// </summary>
public DateTime Created { get; set; }
/// <summary>
/// Last date this was updated
/// </summary>
public DateTime LastModified { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
}
}

View file

@ -43,9 +43,11 @@ namespace API.Entities
public ICollection<SeriesMetadata> SeriesMetadatas { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; set; }
public uint RowVersion { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;

View file

@ -9,9 +9,11 @@ namespace API.Entities
public string Name { get; set; }
// MetadataUpdate add ProviderId
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; set; }
public uint RowVersion { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;

View file

@ -10,12 +10,14 @@ namespace API.Entities
public string Name { get; set; }
public PersonRole Role { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; set; }
public uint RowVersion { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
}
}

View file

@ -16,9 +16,11 @@ namespace API.Entities
public Series Series { get; set; }
public int SeriesId { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; set; }
public uint RowVersion { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;

View file

@ -10,11 +10,14 @@ namespace API.Entities
public ServerSettingKey Key { get; set; }
public string Value { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; set; }
public uint RowVersion { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
}
}