Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.
C# annotationscbzcomicinfocomicscomics-readercross-platformcsharpepubepub-readerfreelinuxmangamedia-servermetadataopdsopds-feedpdfself-hostedubooquitywindows
Misc Bugfixes and Cleanup (#1144)
Joseph Milazzo54c164172862
diff --git a/API.Tests/Services/ReaderServiceTests.cs b/API.Tests/Services/ReaderServiceTests.csindex d4edddf72..f12472c5b 100644--- a/API.Tests/Services/ReaderServiceTests.cs+++ b/API.Tests/Services/ReaderServiceTests.cs@@ -1569,6 +1569,61 @@ public class ReaderServiceTestsAssert.Equal("Some Special Title", nextChapter.Range);}+ [Fact]+ public async Task GetContinuePoint_ShouldReturnFirstVolumeChapter_WhenPreExistingProgress()+ {+ var series = new Series()+ {+ Name = "Test",+ Library = new Library()+ {+ Name = "Test LIb",+ Type = LibraryType.Manga,+ },+ Volumes = new List<Volume>()+ {+ EntityFactory.CreateVolume("0", new List<Chapter>()+ {+ EntityFactory.CreateChapter("230", false, new List<MangaFile>(), 1),+ //EntityFactory.CreateChapter("231", false, new List<MangaFile>(), 1), (added later)+ }),+ EntityFactory.CreateVolume("1", new List<Chapter>()+ {+ EntityFactory.CreateChapter("1", false, new List<MangaFile>(), 1),+ EntityFactory.CreateChapter("2", false, new List<MangaFile>(), 1),+ }),+ EntityFactory.CreateVolume("2", new List<Chapter>()+ {+ EntityFactory.CreateChapter("0", false, new List<MangaFile>(), 1),+ //EntityFactory.CreateChapter("14.9", false, new List<MangaFile>(), 1), (added later)+ }),+ }+ };+ _context.Series.Add(series);++ _context.AppUser.Add(new AppUser()+ {+ UserName = "majora2007"+ });++ await _context.SaveChangesAsync();+++ var readerService = new ReaderService(_unitOfWork, Substitute.For<ILogger<ReaderService>>());+ var user = await _unitOfWork.UserRepository.GetUserByIdAsync(1, AppUserIncludes.Progress);+ await readerService.MarkSeriesAsRead(user, 1);+ await _context.SaveChangesAsync();++ // Add 2 new unread series to the Series+ series.Volumes[0].Chapters.Add(EntityFactory.CreateChapter("231", false, new List<MangaFile>(), 1));+ series.Volumes[2].Chapters.Add(EntityFactory.CreateChapter("14.9", false, new List<MangaFile>(), 1));+ _context.Series.Attach(series);+ await _context.SaveChangesAsync();++ var nextChapter = await readerService.GetContinuePoint(1, 1);+ Assert.Equal("14.9", nextChapter.Range);+ }+#endregion#region MarkChaptersUntilAsRead@@ -1702,5 +1757,126 @@ public class ReaderServiceTests#endregion+ #region MarkSeriesAsRead++ [Fact]+ public async Task MarkSeriesAsReadTest()+ {+ await ResetDB();++ _context.Series.Add(new Series()+ {+ Name = "Test",+ Library = new Library() {+ Name = "Test LIb",+ Type = LibraryType.Manga,+ },+ Volumes = new List<Volume>()+ {+ new Volume()+ {+ Chapters = new List<Chapter>()+ {+ new Chapter()+ {+ Pages = 1+ },+ new Chapter()+ {+ Pages = 2+ }+ }+ },+ new Volume()+ {+ Chapters = new List<Chapter>()+ {+ new Chapter()+ {+ Pages = 1+ },+ new Chapter()+ {+ Pages = 2+ }+ }+ }+ }+ });++ _context.AppUser.Add(new AppUser()+ {+ UserName = "majora2007"+ });++ await _context.SaveChangesAsync();++ var readerService = new ReaderService(_unitOfWork, Substitute.For<ILogger<ReaderService>>());++ await readerService.MarkSeriesAsRead(await _unitOfWork.UserRepository.GetUserByIdAsync(1, AppUserIncludes.Progress), 1);+ await _context.SaveChangesAsync();++ Assert.Equal(4, (await _unitOfWork.UserRepository.GetUserByIdAsync(1, AppUserIncludes.Progress)).Progresses.Count);+ }+++ #endregion++ #region MarkSeriesAsUnread++ [Fact]+ public async Task MarkSeriesAsUnreadTest()+ {+ await ResetDB();+ _context.Series.Add(new Series()+ {+ Name = "Test",+ Library = new Library() {+ Name = "Test LIb",+ Type = LibraryType.Manga,+ },+ Volumes = new List<Volume>()+ {+ new Volume()+ {+ Chapters = new List<Chapter>()+ {+ new Chapter()+ {+ Pages = 1+ },+ new Chapter()+ {+ Pages = 2+ }+ }+ }+ }+ });++ _context.AppUser.Add(new AppUser()+ {+ UserName = "majora2007"+ });++ await _context.SaveChangesAsync();++ var readerService = new ReaderService(_unitOfWork, Substitute.For<ILogger<ReaderService>>());++ var volumes = (await _unitOfWork.VolumeRepository.GetVolumes(1)).ToList();+ readerService.MarkChaptersAsRead(await _unitOfWork.UserRepository.GetUserByIdAsync(1, AppUserIncludes.Progress), 1, volumes.First().Chapters);++ await _context.SaveChangesAsync();+ Assert.Equal(2, (await _unitOfWork.UserRepository.GetUserByIdAsync(1, AppUserIncludes.Progress)).Progresses.Count);++ await readerService.MarkSeriesAsUnread(await _unitOfWork.UserRepository.GetUserByIdAsync(1, AppUserIncludes.Progress), 1);+ await _context.SaveChangesAsync();++ var progresses = (await _unitOfWork.UserRepository.GetUserByIdAsync(1, AppUserIncludes.Progress)).Progresses;+ Assert.Equal(0, progresses.Max(p => p.PagesRead));+ Assert.Equal(2, progresses.Count);+ }++ #endregion}diff --git a/API/Controllers/AccountController.cs b/API/Controllers/AccountController.csindex 913f53133..7fc8769e7 100644--- a/API/Controllers/AccountController.cs+++ b/API/Controllers/AccountController.cs@@ -338,6 +338,12 @@ namespace API.Controllers+ /// <summary>+ /// Invites a user to the server. Will generate a setup link for continuing setup. If the server is not accessible, no+ /// email will be sent.+ /// </summary>+ /// <param name="dto"></param>+ /// <returns></returns>[Authorize(Policy = "RequireAdminRole")][HttpPost("invite")]public async Task<ActionResult<string>> InviteUser(InviteUserDto dto)@@ -417,7 +423,9 @@ namespace API.Controllersvar emailLink = GenerateEmailLink(token, "confirm-email", dto.Email);_logger.LogCritical("[Invite User]: Email Link for {UserName}: {Link}", user.UserName, emailLink);- if (dto.SendEmail)+ var host = _environment.IsDevelopment() ? "localhost:4200" : Request.Host.ToString();+ var accessible = await _emailService.CheckIfAccessible(host);+ if (accessible){await _emailService.SendConfirmationEmail(new ConfirmationEmailDto(){@@ -426,7 +434,11 @@ namespace API.ControllersServerConfirmationLink = emailLink});}- return Ok(emailLink);+ return Ok(new InviteUserResponse+ {+ EmailLink = emailLink,+ EmailSent = accessible+ });}catch (Exception){diff --git a/API/Controllers/ReaderController.cs b/API/Controllers/ReaderController.csindex a8a34bdfd..fa3be9c05 100644--- a/API/Controllers/ReaderController.cs+++ b/API/Controllers/ReaderController.cs@@ -109,14 +109,7 @@ namespace API.Controllerspublic async Task<ActionResult> MarkRead(MarkReadDto markReadDto){var user = await _unitOfWork.UserRepository.GetUserByUsernameAsync(User.GetUsername(), AppUserIncludes.Progress);- var volumes = await _unitOfWork.VolumeRepository.GetVolumes(markReadDto.SeriesId);- user.Progresses ??= new List<AppUserProgress>();- foreach (var volume in volumes)- {- _readerService.MarkChaptersAsRead(user, markReadDto.SeriesId, volume.Chapters);- }-- _unitOfWork.UserRepository.Update(user);+ await _readerService.MarkSeriesAsRead(user, markReadDto.SeriesId);if (await _unitOfWork.CommitAsync()){@@ -137,14 +130,7 @@ namespace API.Controllerspublic async Task<ActionResult> MarkUnread(MarkReadDto markReadDto){var user = await _unitOfWork.UserRepository.GetUserByUsernameAsync(User.GetUsername(), AppUserIncludes.Progress);- var volumes = await _unitOfWork.VolumeRepository.GetVolumes(markReadDto.SeriesId);- user.Progresses ??= new List<AppUserProgress>();- foreach (var volume in volumes)- {- _readerService.MarkChaptersAsUnread(user, markReadDto.SeriesId, volume.Chapters);- }-- _unitOfWork.UserRepository.Update(user);+ await _readerService.MarkSeriesAsUnread(user, markReadDto.SeriesId);if (await _unitOfWork.CommitAsync()){diff --git a/API/DTOs/Account/InviteUserDto.cs b/API/DTOs/Account/InviteUserDto.csindex 04c9c1103..42d4bdf8e 100644--- a/API/DTOs/Account/InviteUserDto.cs+++ b/API/DTOs/Account/InviteUserDto.cs@@ -16,6 +16,4 @@ public class InviteUserDto/// A list of libraries to grant access to/// </summary>public IList<int> Libraries { get; init; }-- public bool SendEmail { get; init; } = true;}diff --git a/API/DTOs/Account/InviteUserResponse.cs b/API/DTOs/Account/InviteUserResponse.csnew file mode 100644index 000000000..9387b5492--- /dev/null+++ b/API/DTOs/Account/InviteUserResponse.cs@@ -0,0 +1,13 @@+namespace API.DTOs.Account;++public class InviteUserResponse+{+ /// <summary>+ /// Email link used to setup the user account+ /// </summary>+ public string EmailLink { get; set; }+ /// <summary>+ /// Was an email sent (ie is this server accessible)+ /// </summary>+ public bool EmailSent { get; set; }+}diff --git a/API/DTOs/Filtering/FilterDto.cs b/API/DTOs/Filtering/FilterDto.csindex fba9a7493..90ad52759 100644--- a/API/DTOs/Filtering/FilterDto.cs+++ b/API/DTOs/Filtering/FilterDto.cs@@ -25,51 +25,51 @@ namespace API.DTOs.Filtering/// </summary>public IList<int> Genres { get; init; } = new List<int>();/// <summary>- /// A list of Writers to restrict search to. Defaults to all genres by passing an empty list+ /// A list of Writers to restrict search to. Defaults to all Writers by passing an empty list/// </summary>public IList<int> Writers { get; init; } = new List<int>();/// <summary>- /// A list of Penciller ids to restrict search to. Defaults to all genres by passing an empty list+ /// A list of Penciller ids to restrict search to. Defaults to all Pencillers by passing an empty list/// </summary>public IList<int> Penciller { get; init; } = new List<int>();/// <summary>- /// A list of Inker ids to restrict search to. Defaults to all genres by passing an empty list+ /// A list of Inker ids to restrict search to. Defaults to all Inkers by passing an empty list/// </summary>public IList<int> Inker { get; init; } = new List<int>();/// <summary>- /// A list of Colorist ids to restrict search to. Defaults to all genres by passing an empty list+ /// A list of Colorist ids to restrict search to. Defaults to all Colorists by passing an empty list/// </summary>public IList<int> Colorist { get; init; } = new List<int>();/// <summary>- /// A list of Letterer ids to restrict search to. Defaults to all genres by passing an empty list+ /// A list of Letterer ids to restrict search to. Defaults to all Letterers by passing an empty list/// </summary>public IList<int> Letterer { get; init; } = new List<int>();/// <summary>- /// A list of CoverArtist ids to restrict search to. Defaults to all genres by passing an empty list+ /// A list of CoverArtist ids to restrict search to. Defaults to all CoverArtists by passing an empty list/// </summary>public IList<int> CoverArtist { get; init; } = new List<int>();/// <summary>- /// A list of Editor ids to restrict search to. Defaults to all genres by passing an empty list+ /// A list of Editor ids to restrict search to. Defaults to all Editors by passing an empty list/// </summary>public IList<int> Editor { get; init; } = new List<int>();/// <summary>- /// A list of Publisher ids to restrict search to. Defaults to all genres by passing an empty list+ /// A list of Publisher ids to restrict search to. Defaults to all Publishers by passing an empty list/// </summary>public IList<int> Publisher { get; init; } = new List<int>();/// <summary>- /// A list of Character ids to restrict search to. Defaults to all genres by passing an empty list+ /// A list of Character ids to restrict search to. Defaults to all Characters by passing an empty list/// </summary>public IList<int> Character { get; init; } = new List<int>();/// <summary>- /// A list of Translator ids to restrict search to. Defaults to all genres by passing an empty list+ /// A list of Translator ids to restrict search to. Defaults to all Translatorss by passing an empty list/// </summary>public IList<int> Translators { get; init; } = new List<int>();/// <summary>- /// A list of Collection Tag ids to restrict search to. Defaults to all genres by passing an empty list+ /// A list of Collection Tag ids to restrict search to. Defaults to all Collection Tags by passing an empty list/// </summary>public IList<int> CollectionTags { get; init; } = new List<int>();/// <summary>- /// A list of Tag ids to restrict search to. Defaults to all genres by passing an empty list+ /// A list of Tag ids to restrict search to. Defaults to all Tags by passing an empty list/// </summary>public IList<int> Tags { get; init; } = new List<int>();/// <summary>diff --git a/API/DTOs/Reader/ChapterInfoDto.cs b/API/DTOs/Reader/ChapterInfoDto.csindex 7c847d926..9f33bada7 100644--- a/API/DTOs/Reader/ChapterInfoDto.cs+++ b/API/DTOs/Reader/ChapterInfoDto.cs@@ -12,6 +12,7 @@ namespace API.DTOs.Readerpublic MangaFormat SeriesFormat { get; set; }public int SeriesId { get; set; }public int LibraryId { get; set; }+ public LibraryType LibraryType { get; set; }public string ChapterTitle { get; set; } = string.Empty;public int Pages { get; set; }public string FileName { get; set; }diff --git a/API/Data/Repositories/ChapterRepository.cs b/API/Data/Repositories/ChapterRepository.csindex 330aa4b5e..ab3684fa0 100644--- a/API/Data/Repositories/ChapterRepository.cs+++ b/API/Data/Repositories/ChapterRepository.cs@@ -81,7 +81,8 @@ public class ChapterRepository : IChapterRepositorydata.TitleName,SeriesFormat = series.Format,SeriesName = series.Name,- series.LibraryId+ series.LibraryId,+ LibraryType = series.Library.Type}).Select(data => new ChapterInfoDto(){@@ -89,12 +90,13 @@ public class ChapterRepository : IChapterRepositoryVolumeNumber = data.VolumeNumber + string.Empty,VolumeId = data.VolumeId,IsSpecial = data.IsSpecial,- SeriesId =data.SeriesId,+ SeriesId = data.SeriesId,SeriesFormat = data.SeriesFormat,SeriesName = data.SeriesName,LibraryId = data.LibraryId,Pages = data.Pages,- ChapterTitle = data.TitleName+ ChapterTitle = data.TitleName,+ LibraryType = data.LibraryType}).AsNoTracking().AsSplitQuery()diff --git a/API/Data/Repositories/SeriesRepository.cs b/API/Data/Repositories/SeriesRepository.csindex efe2f1a27..d70681b46 100644--- a/API/Data/Repositories/SeriesRepository.cs+++ b/API/Data/Repositories/SeriesRepository.cs@@ -79,8 +79,8 @@ public interface ISeriesRepository/// <returns></returns>Task AddSeriesModifiers(int userId, List<SeriesDto> series);Task<string> GetSeriesCoverImageAsync(int seriesId);- Task<IEnumerable<SeriesDto>> GetOnDeck(int userId, int libraryId, UserParams userParams, FilterDto filter);- Task<PagedList<SeriesDto>> GetRecentlyAdded(int libraryId, int userId, UserParams userParams, FilterDto filter); // NOTE: Probably put this in LibraryRepo+ Task<IEnumerable<SeriesDto>> GetOnDeck(int userId, int libraryId, UserParams userParams, FilterDto filter, bool cutoffOnDate = true);+ Task<PagedList<SeriesDto>> GetRecentlyAdded(int libraryId, int userId, UserParams userParams, FilterDto filter);Task<SeriesMetadataDto> GetSeriesMetadata(int seriesId);Task<PagedList<SeriesDto>> GetSeriesDtoForCollectionAsync(int collectionId, int userId, UserParams userParams);Task<IList<MangaFile>> GetFilesForSeries(int seriesId);@@ -593,11 +593,11 @@ public class SeriesRepository : ISeriesRepository/// <param name="userParams">Pagination information</param>/// <param name="filter">Optional (default null) filter on query</param>/// <returns></returns>- public async Task<IEnumerable<SeriesDto>> GetOnDeck(int userId, int libraryId, UserParams userParams, FilterDto filter)+ public async Task<IEnumerable<SeriesDto>> GetOnDeck(int userId, int libraryId, UserParams userParams, FilterDto filter, bool cutoffOnDate = true){//var allSeriesWithProgress = await _context.AppUserProgresses.Select(p => p.SeriesId).ToListAsync();//var allChapters = await GetChapterIdsForSeriesAsync(allSeriesWithProgress);- var cuttoffProgressPoint = DateTime.Now - TimeSpan.FromDays(30);+ var cutoffProgressPoint = DateTime.Now - TimeSpan.FromDays(30);var query = (await CreateFilteredSearchQueryable(userId, libraryId, filter)).Join(_context.AppUserProgresses, s => s.Id, progress => progress.SeriesId, (s, progress) =>new@@ -612,8 +612,12 @@ public class SeriesRepository : ISeriesRepository// This is only taking into account chapters that have progress on them, not all chapters in said seriesLastChapterCreated = _context.Chapter.Where(c => progress.ChapterId == c.Id).Max(c => c.Created)//LastChapterCreated = _context.Chapter.Where(c => allChapters.Contains(c.Id)).Max(c => c.Created)- })- .Where(d => d.LastReadingProgress >= cuttoffProgressPoint);+ });+ if (cutoffOnDate)+ {+ query = query.Where(d => d.LastReadingProgress >= cutoffProgressPoint);+ }+// I think I need another Join statement. The problem is the chapters are still limited to progressdiff --git a/API/Services/EmailService.cs b/API/Services/EmailService.csindex ab2c52a2c..c5ba90464 100644--- a/API/Services/EmailService.cs+++ b/API/Services/EmailService.cs@@ -98,7 +98,7 @@ public class EmailService : IEmailServicereturn await SendEmailWithPost(emailLink + "/api/email/email-password-reset", data);}- private static async Task<bool> SendEmailWithGet(string url)+ private static async Task<bool> SendEmailWithGet(string url, int timeoutSecs = 30){try{@@ -108,7 +108,7 @@ public class EmailService : IEmailService.WithHeader("x-api-key", "MsnvA2DfQqxSK5jh").WithHeader("x-kavita-version", BuildInfo.Version).WithHeader("Content-Type", "application/json")- .WithTimeout(TimeSpan.FromSeconds(30))+ .WithTimeout(TimeSpan.FromSeconds(timeoutSecs)).GetStringAsync();if (!string.IsNullOrEmpty(response) && bool.Parse(response))@@ -124,7 +124,7 @@ public class EmailService : IEmailService}- private static async Task<bool> SendEmailWithPost(string url, object data)+ private static async Task<bool> SendEmailWithPost(string url, object data, int timeoutSecs = 30){try{@@ -134,7 +134,7 @@ public class EmailService : IEmailService.WithHeader("x-api-key", "MsnvA2DfQqxSK5jh").WithHeader("x-kavita-version", BuildInfo.Version).WithHeader("Content-Type", "application/json")- .WithTimeout(TimeSpan.FromSeconds(30))+ .WithTimeout(TimeSpan.FromSeconds(timeoutSecs)).PostJsonAsync(data);if (response.StatusCode != StatusCodes.Status200OK)diff --git a/API/Services/ReaderService.cs b/API/Services/ReaderService.csindex 4e73b422e..3e6fe06a5 100644--- a/API/Services/ReaderService.cs+++ b/API/Services/ReaderService.cs@@ -16,6 +16,8 @@ namespace API.Services;public interface IReaderService{+ Task MarkSeriesAsRead(AppUser user, int seriesId);+ Task MarkSeriesAsUnread(AppUser user, int seriesId);void MarkChaptersAsRead(AppUser user, int seriesId, IEnumerable<Chapter> chapters);void MarkChaptersAsUnread(AppUser user, int seriesId, IEnumerable<Chapter> chapters);Task<bool> SaveReadingProgress(ProgressDto progressDto, int userId);@@ -45,6 +47,40 @@ public class ReaderService : IReaderServicereturn Parser.Parser.NormalizePath(Path.Join(baseDirectory, $"{userId}", $"{seriesId}", $"{chapterId}"));}+ /// <summary>+ /// Does not commit. Marks all entities under the series as read.+ /// </summary>+ /// <param name="user"></param>+ /// <param name="seriesId"></param>+ public async Task MarkSeriesAsRead(AppUser user, int seriesId)+ {+ var volumes = await _unitOfWork.VolumeRepository.GetVolumes(seriesId);+ user.Progresses ??= new List<AppUserProgress>();+ foreach (var volume in volumes)+ {+ MarkChaptersAsRead(user, seriesId, volume.Chapters);+ }++ _unitOfWork.UserRepository.Update(user);+ }++ /// <summary>+ /// Does not commit. Marks all entities under the series as unread.+ /// </summary>+ /// <param name="user"></param>+ /// <param name="seriesId"></param>+ public async Task MarkSeriesAsUnread(AppUser user, int seriesId)+ {+ var volumes = await _unitOfWork.VolumeRepository.GetVolumes(seriesId);+ user.Progresses ??= new List<AppUserProgress>();+ foreach (var volume in volumes)+ {+ MarkChaptersAsUnread(user, seriesId, volume.Chapters);+ }++ _unitOfWork.UserRepository.Update(user);+ }+/// <summary>/// Marks all Chapters as Read by creating or updating UserProgress rows. Does not commit./// </summary>@@ -364,7 +400,7 @@ public class ReaderService : IReaderService.ToList();// If there are any volumes that have progress, return those. If not, move on.- var currentlyReadingChapter = volumeChapters.FirstOrDefault(chapter => chapter.PagesRead < chapter.Pages && chapter.PagesRead > 0);+ var currentlyReadingChapter = volumeChapters.FirstOrDefault(chapter => chapter.PagesRead < chapter.Pages); // (removed for GetContinuePoint_ShouldReturnFirstVolumeChapter_WhenPreExistingProgress), not sure if needed && chapter.PagesRead > 0if (currentlyReadingChapter != null) return currentlyReadingChapter;// Check loose leaf chapters (and specials). First check if there are anydiff --git a/UI/Web/src/app/_models/invite-user-response.ts b/UI/Web/src/app/_models/invite-user-response.tsnew file mode 100644index 000000000..a9042c555--- /dev/null+++ b/UI/Web/src/app/_models/invite-user-response.ts@@ -0,0 +1,10 @@+export interface InviteUserResponse {+ /**+ * Link to register new user+ */+ emailLink: string;+ /**+ * If an email was sent to the invited user+ */+ emailSent: boolean;+}\ No newline at end of filediff --git a/UI/Web/src/app/_services/account.service.ts b/UI/Web/src/app/_services/account.service.tsindex 791c6643a..df5555f41 100644--- a/UI/Web/src/app/_services/account.service.ts+++ b/UI/Web/src/app/_services/account.service.ts@@ -8,6 +8,7 @@ import { User } from '../_models/user';import { Router } from '@angular/router';import { MessageHubService } from './message-hub.service';import { ThemeService } from '../theme.service';+import { InviteUserResponse } from '../_models/invite-user-response';@Injectable({providedIn: 'root'@@ -134,8 +135,8 @@ export class AccountService implements OnDestroy {return this.httpClient.post<string>(this.baseUrl + 'account/resend-confirmation-email?userId=' + userId, {}, {responseType: 'text' as 'json'});}- inviteUser(model: {email: string, roles: Array<string>, libraries: Array<number>, sendEmail: boolean}) {- return this.httpClient.post<string>(this.baseUrl + 'account/invite', model, {responseType: 'text' as 'json'});+ inviteUser(model: {email: string, roles: Array<string>, libraries: Array<number>}) {+ return this.httpClient.post<InviteUserResponse>(this.baseUrl + 'account/invite', model);}confirmEmail(model: {email: string, username: string, password: string, token: string}) {diff --git a/UI/Web/src/app/admin/admin.module.ts b/UI/Web/src/app/admin/admin.module.tsindex 8baed6a00..d594cbff3 100644--- a/UI/Web/src/app/admin/admin.module.ts+++ b/UI/Web/src/app/admin/admin.module.ts@@ -19,6 +19,7 @@ import { InviteUserComponent } from './invite-user/invite-user.component';import { RoleSelectorComponent } from './role-selector/role-selector.component';import { LibrarySelectorComponent } from './library-selector/library-selector.component';import { EditUserComponent } from './edit-user/edit-user.component';+import { UserSettingsModule } from '../user-settings/user-settings.module';@@ -49,7 +50,8 @@ import { EditUserComponent } from './edit-user/edit-user.component';NgbTooltipModule,NgbDropdownModule,SharedModule,- PipeModule+ PipeModule,+ UserSettingsModule // API-key componet],providers: []})diff --git a/UI/Web/src/app/admin/invite-user/invite-user.component.html b/UI/Web/src/app/admin/invite-user/invite-user.component.htmlindex 83fbb86eb..495b3f6e9 100644--- a/UI/Web/src/app/admin/invite-user/invite-user.component.html+++ b/UI/Web/src/app/admin/invite-user/invite-user.component.html@@ -9,13 +9,7 @@Invite a user to your server. Enter their email in and we will send them an email to create an account.</p>- <p *ngIf="!checkedAccessibility">- <span class="spinner-border text-primary" style="width: 1.5rem; height: 1.5rem;" role="status" aria-hidden="true"></span>- Checking accessibility of server...- </p>--- <form [formGroup]="inviteForm">+ <form [formGroup]="inviteForm" *ngIf="emailLink === ''"><div class="row g-0"><div class="mb-3" style="width:100%"><label for="email" class="form-label">Email</label>@@ -28,11 +22,6 @@</div></div>- <ng-container *ngIf="emailLink !== '' && checkedAccessibility && !accessible">- <p>Use this link to finish setting up the user account due to your server not being accessible outside your local network.</p>- <a class="email-link" href="{{emailLink}}" target="_blank">{{emailLink}}</a>- </ng-container>-<div class="row g-0"><div class="col-md-6"><app-role-selector (selected)="updateRoleSelection($event)" [allowAdmin]="true"></app-role-selector>@@ -44,12 +33,21 @@</div></form>+ <ng-container *ngIf="emailLink !== ''">+ <h4>User invited</h4>+ <p>You can use the following link below to setup the account for your user or use the copy button. You may need to log out before using the link to register a new user.+ If your server is externallyaccessible, an email will have been sent to the user and the links can be used by them to finish setting up their account.+ </p>+ <a class="email-link" href="{{emailLink}}" target="_blank">Setup user's account</a>+ <app-api-key title="Invite Url" tooltipText="Copy this and paste in a new tab. You may need to log out." [showRefresh]="false" [transform]="makeLink"></app-api-key>+ </ng-container>+</div><div class="modal-footer"><button type="button" class="btn btn-secondary" (click)="close()">Cancel</button>- <button type="button" class="btn btn-primary" (click)="invite()" [disabled]="isSending || !inviteForm.valid || !checkedAccessibility || emailLink !== ''">+ <button type="button" class="btn btn-primary" (click)="invite()" [disabled]="isSending || !inviteForm.valid || emailLink !== ''"><span *ngIf="isSending" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span><span>{{isSending ? 'Inviting...' : 'Invite'}}</span></button>diff --git a/UI/Web/src/app/admin/invite-user/invite-user.component.ts b/UI/Web/src/app/admin/invite-user/invite-user.component.tsindex cc525957f..b5066c99c 100644--- a/UI/Web/src/app/admin/invite-user/invite-user.component.ts+++ b/UI/Web/src/app/admin/invite-user/invite-user.component.ts@@ -3,6 +3,7 @@ import { FormControl, FormGroup, Validators } from '@angular/forms';import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';import { ToastrService } from 'ngx-toastr';import { ConfirmService } from 'src/app/shared/confirm.service';+import { InviteUserResponse } from 'src/app/_models/invite-user-response';import { Library } from 'src/app/_models/library';import { AccountService } from 'src/app/_services/account.service';import { ServerService } from 'src/app/_services/server.service';@@ -19,15 +20,12 @@ export class InviteUserComponent implements OnInit {*/isSending: boolean = false;inviteForm: FormGroup = new FormGroup({});- /**- * If a user would be able to load this server up externally- */- accessible: boolean = true;- checkedAccessibility: boolean = false;selectedRoles: Array<string> = [];selectedLibraries: Array<number> = [];emailLink: string = '';+ makeLink: (val: string) => string = (val: string) => {return this.emailLink};+public get email() { return this.inviteForm.get('email'); }constructor(public modal: NgbActiveModal, private accountService: AccountService, private serverService: ServerService,@@ -35,14 +33,6 @@ export class InviteUserComponent implements OnInit {ngOnInit(): void {this.inviteForm.addControl('email', new FormControl('', [Validators.required]));-- this.serverService.isServerAccessible().subscribe(async (accessibile) => {- if (!accessibile) {- await this.confirmService.alert('This server is not accessible outside the network. You cannot invite via Email. You wil be given a link to finish registration with instead.');- this.accessible = accessibile;- }- this.checkedAccessibility = true;- });}close() {@@ -57,11 +47,10 @@ export class InviteUserComponent implements OnInit {email,libraries: this.selectedLibraries,roles: this.selectedRoles,- sendEmail: this.accessible- }).subscribe(emailLink => {- this.emailLink = emailLink;+ }).subscribe((data: InviteUserResponse) => {+ this.emailLink = data.emailLink;this.isSending = false;- if (this.accessible) {+ if (data.emailSent) {this.toastr.info('Email sent to ' + email);this.modal.close(true);}diff --git a/UI/Web/src/app/all-series/all-series.component.ts b/UI/Web/src/app/all-series/all-series.component.tsindex 8d2f2134d..cdcca3b20 100644--- a/UI/Web/src/app/all-series/all-series.component.ts+++ b/UI/Web/src/app/all-series/all-series.component.ts@@ -6,7 +6,6 @@ import { take, debounceTime, takeUntil } from 'rxjs/operators';import { BulkSelectionService } from '../cards/bulk-selection.service';import { FilterSettings } from '../cards/card-detail-layout/card-detail-layout.component';import { KEY_CODES, UtilityService } from '../shared/_services/utility.service';-import { SeriesAddedEvent } from '../_models/events/series-added-event';import { Library } from '../_models/library';import { Pagination } from '../_models/pagination';import { Series } from '../_models/series';diff --git a/UI/Web/src/app/app-routing.module.ts b/UI/Web/src/app/app-routing.module.tsindex d0960294b..0a09d8c38 100644--- a/UI/Web/src/app/app-routing.module.ts+++ b/UI/Web/src/app/app-routing.module.ts@@ -6,7 +6,6 @@ import { RecentlyAddedComponent } from './recently-added/recently-added.componenimport { UserLoginComponent } from './user-login/user-login.component';import { AuthGuard } from './_guards/auth.guard';import { LibraryAccessGuard } from './_guards/library-access.guard';-import { OnDeckComponent } from './on-deck/on-deck.component';import { DashboardComponent } from './dashboard/dashboard.component';import { AllSeriesComponent } from './all-series/all-series.component';import { AdminGuard } from './_guards/admin.guard';@@ -64,7 +63,6 @@ const routes: Routes = [children: [{path: 'library', component: DashboardComponent},{path: 'recently-added', component: RecentlyAddedComponent},- {path: 'on-deck', component: OnDeckComponent},{path: 'all-series', component: AllSeriesComponent},]diff --git a/UI/Web/src/app/app.module.ts b/UI/Web/src/app/app.module.tsindex 2bfb306a5..7fe0c2554 100644--- a/UI/Web/src/app/app.module.ts+++ b/UI/Web/src/app/app.module.ts@@ -22,7 +22,6 @@ import { CarouselModule } from './carousel/carousel.module';import { TypeaheadModule } from './typeahead/typeahead.module';import { RecentlyAddedComponent } from './recently-added/recently-added.component';-import { OnDeckComponent } from './on-deck/on-deck.component';import { DashboardComponent } from './dashboard/dashboard.component';import { CardsModule } from './cards/cards.module';import { CollectionsModule } from './collections/collections.module';@@ -48,7 +47,6 @@ import { ColorPickerModule } from 'ngx-color-picker';SeriesDetailComponent,ReviewSeriesModalComponent,RecentlyAddedComponent,- OnDeckComponent,DashboardComponent,NavEventsToggleComponent,SeriesMetadataDetailComponent,@@ -99,7 +97,6 @@ import { ColorPickerModule } from 'ngx-color-picker';{provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true},Title,{provide: SAVER, useFactory: getSaver},- // { provide: APP_BASE_HREF, useFactory: (config: ConfigData) => config.baseUrl, deps: [ConfigData] },],entryComponents: [],bootstrap: [AppComponent]diff --git a/UI/Web/src/app/cards/_modals/card-details-modal/card-details-modal.component.html b/UI/Web/src/app/cards/_modals/card-details-modal/card-details-modal.component.htmlindex 7d2dbddc7..a3cb6dfdd 100644--- a/UI/Web/src/app/cards/_modals/card-details-modal/card-details-modal.component.html+++ b/UI/Web/src/app/cards/_modals/card-details-modal/card-details-modal.component.html@@ -27,7 +27,7 @@<span><span *ngIf="chapterMetadata && chapterMetadata.releaseDate !== null">Release Date: {{chapterMetadata.releaseDate | date: 'shortDate' || '-'}}</span></span>- <span class="text-accent">{{chapter.pages}} pages</span>+ <span class="text-accent">{{data.pages}} pages</span></div><div class="row g-0"><div class="col-auto">@@ -106,24 +106,26 @@<h4 *ngIf="!utilityService.isChapter(data)">{{utilityService.formatChapterName(libraryType) + 's'}}</h4><ul class="list-unstyled"><li class="d-flex my-4" *ngFor="let chapter of chapters">- <a (click)="readChapter(chapter)" href="javascript:void(0);" title="Read {{libraryType !== LibraryType.Comic ? 'Chapter ' : 'Issue #'}} {{chapter.number}}">+ <a (click)="readChapter(chapter)" href="javascript:void(0);" title="Read {{utilityService.formatChapterName(libraryType, true, false)}} {{formatChapterNumber(chapter)}}"><app-image class="me-2" width="74px" [imageUrl]="chapter.coverImage"></app-image></a><div class="flex-grow-1"><h5 class="mt-0 mb-1">- <span *ngIf="chapter.number !== '0'; else specialHeader">+ <span ><span><app-card-actionables (actionHandler)="performAction($event, chapter)" [actions]="chapterActions"[labelBy]="utilityService.formatChapterName(libraryType, true, true) + formatChapterNumber(chapter)"></app-card-actionables>- {{utilityService.formatChapterName(libraryType, true, false) }} {{formatChapterNumber(chapter)}}+ <ng-container *ngIf="chapter.number !== '0'; else specialHeader">+ {{utilityService.formatChapterName(libraryType, true, false) }} {{formatChapterNumber(chapter)}}+ </ng-container></span>- <span class="badge bg-primary rounded-pill">+ <span class="badge bg-primary rounded-pill ms-1"><span *ngIf="chapter.pagesRead > 0 && chapter.pagesRead < chapter.pages">{{chapter.pagesRead}} / {{chapter.pages}}</span><span *ngIf="chapter.pagesRead === 0">UNREAD</span><span *ngIf="chapter.pagesRead === chapter.pages">READ</span></span></span>- <ng-template #specialHeader>File(s)</ng-template>+ <ng-template #specialHeader>Files</ng-template></h5><ul class="list-group"><li *ngFor="let file of chapter.files" class="list-group-item no-hover">diff --git a/UI/Web/src/app/cards/_modals/edit-series-modal/edit-series-modal.component.ts b/UI/Web/src/app/cards/_modals/edit-series-modal/edit-series-modal.component.tsindex fc1897afe..787b5e7d3 100644--- a/UI/Web/src/app/cards/_modals/edit-series-modal/edit-series-modal.component.ts+++ b/UI/Web/src/app/cards/_modals/edit-series-modal/edit-series-modal.component.ts@@ -67,6 +67,8 @@ export class EditSeriesModalComponent implements OnInit, OnDestroy {publicationStatuses: Array<PublicationStatusDto> = [];validLanguages: Array<Language> = [];+ coverImageReset = false;+get Breakpoint(): typeof Breakpoint {return Breakpoint;}@@ -403,30 +405,22 @@ export class EditSeriesModalComponent implements OnInit, OnDestroy {this.seriesService.updateMetadata(this.metadata, this.collectionTags)];- // We only need to call updateSeries if we changed name, sort name, or localized name- if (this.editSeriesForm.get('name')?.dirty || this.editSeriesForm.get('sortName')?.dirty || this.editSeriesForm.get('localizedName')?.dirty) {+ // We only need to call updateSeries if we changed name, sort name, or localized name or reset a cover image+ if (this.editSeriesForm.get('name')?.dirty || this.editSeriesForm.get('sortName')?.dirty || this.editSeriesForm.get('localizedName')?.dirty || this.coverImageReset) {apis.push(this.seriesService.updateSeries(model));}-- if (selectedIndex > 0) {+ if (selectedIndex > 0 && this.selectedCover !== '') {apis.push(this.uploadService.updateSeriesCoverImage(model.id, this.selectedCover));}+forkJoin(apis).subscribe(results => {this.modal.close({success: true, series: model, coverImageUpdate: selectedIndex > 0});});}- handleUnlock(field: string) {- console.log('todo: unlock ', field);- }-- hello(val: boolean) {- console.log('hello: ', val);- }-updateCollections(tags: CollectionTag[]) {this.collectionTags = tags;}@@ -491,6 +485,7 @@ export class EditSeriesModalComponent implements OnInit, OnDestroy {}handleReset() {+ this.coverImageReset = true;this.editSeriesForm.patchValue({coverImageLocked: false});diff --git a/UI/Web/src/app/cards/card-detail-layout/card-detail-layout.component.html b/UI/Web/src/app/cards/card-detail-layout/card-detail-layout.component.htmlindex 6c5147d7e..f6262d111 100644--- a/UI/Web/src/app/cards/card-detail-layout/card-detail-layout.component.html+++ b/UI/Web/src/app/cards/card-detail-layout/card-detail-layout.component.html@@ -27,9 +27,7 @@<app-drawer #commentDrawer="drawer" [isOpen]="!filteringCollapsed" [style.--drawer-width]="'300px'" [style.--drawer-background-color]="'#010409'" (drawerClosed)="filteringCollapsed = !filteringCollapsed"><div header><h2 style="margin-top: 0.5rem">Book Settings- <button type="button" class="btn-close" aria-label="Close" (click)="commentDrawer.close()">-- </button>+ <button type="button" class="btn-close" aria-label="Close" (click)="commentDrawer.close()"></button></h2></div>@@ -324,7 +322,7 @@</div><div class="col-md-2 me-3"></div></div>- <div class="row justify-content-center g-0">+ <div class="row justify-content-center g-0 mt-2"><div class="col-md-2 me-3" *ngIf="!filterSettings.sortDisabled"><form [formGroup]="sortGroup"><div class="mb-3">diff --git a/UI/Web/src/app/cards/card-detail-layout/card-detail-layout.component.ts b/UI/Web/src/app/cards/card-detail-layout/card-detail-layout.component.tsindex e6a43a1be..1ca53e63d 100644--- a/UI/Web/src/app/cards/card-detail-layout/card-detail-layout.component.ts+++ b/UI/Web/src/app/cards/card-detail-layout/card-detail-layout.component.ts@@ -113,6 +113,7 @@ export class CardDetailLayoutComponent implements OnInit, OnDestroy {constructor(private libraryService: LibraryService, private metadataService: MetadataService, private seriesService: SeriesService,private utilityService: UtilityService, private collectionTagService: CollectionTagService) {this.filter = this.seriesService.createSeriesFilter();+this.readProgressGroup = new FormGroup({read: new FormControl(this.filter.readStatus.read, []),notRead: new FormControl(this.filter.readStatus.notRead, []),@@ -163,6 +164,12 @@ export class CardDetailLayoutComponent implements OnInit, OnDestroy {this.filterSettings = new FilterSettings();}+ if (this.filterSettings.presets) {+ this.readProgressGroup.get('read')?.patchValue(this.filterSettings.presets?.readStatus.read);+ this.readProgressGroup.get('notRead')?.patchValue(this.filterSettings.presets?.readStatus.notRead);+ this.readProgressGroup.get('inProgress')?.patchValue(this.filterSettings.presets?.readStatus.inProgress);+ }+this.setupTypeaheads();}diff --git a/UI/Web/src/app/library/library.component.ts b/UI/Web/src/app/library/library.component.tsindex dade32f8b..610d67f1b 100644--- a/UI/Web/src/app/library/library.component.ts+++ b/UI/Web/src/app/library/library.component.ts@@ -141,7 +141,11 @@ export class LibraryComponent implements OnInit, OnDestroy {} else if (sectionTitle.toLowerCase() === 'recently updated series') {this.router.navigate(['recently-added']);} else if (sectionTitle.toLowerCase() === 'on deck') {- this.router.navigate(['on-deck']);+ const params: any = {};+ params['readStatus'] = 'true,false,false';+ params['page'] = 1;+ this.router.navigate(['all-series'], {queryParams: params});+ //this.router.navigate(['on-deck']);} else if (sectionTitle.toLowerCase() === 'libraries') {this.router.navigate(['all-series']);}diff --git a/UI/Web/src/app/manga-reader/_models/chapter-info.ts b/UI/Web/src/app/manga-reader/_models/chapter-info.tsindex f83c86902..f9313b973 100644--- a/UI/Web/src/app/manga-reader/_models/chapter-info.ts+++ b/UI/Web/src/app/manga-reader/_models/chapter-info.ts@@ -1,3 +1,4 @@+import { LibraryType } from "src/app/_models/library";import { MangaFormat } from "src/app/_models/manga-format";export interface ChapterInfo {@@ -8,6 +9,7 @@ export interface ChapterInfo {seriesFormat: MangaFormat;seriesId: number;libraryId: number;+ libraryType: LibraryType;fileName: string;isSpecial: boolean;volumeId: number;diff --git a/UI/Web/src/app/manga-reader/manga-reader.component.html b/UI/Web/src/app/manga-reader/manga-reader.component.htmlindex ae6563fd9..7891cb54a 100644--- a/UI/Web/src/app/manga-reader/manga-reader.component.html+++ b/UI/Web/src/app/manga-reader/manga-reader.component.html@@ -38,7 +38,7 @@</canvas></div><div class="image-container" [ngClass]="{'d-none': renderWithCanvas, 'center-double': ShouldRenderDoublePage, 'fit-to-width-double-offset' : this.generalSettingsForm.get('fittingOption')?.value === FITTING_OPTION.WIDTH && ShouldRenderDoublePage, 'fit-to-height-double-offset': this.generalSettingsForm.get('fittingOption')?.value === FITTING_OPTION.HEIGHT && ShouldRenderDoublePage, 'original-double-offset' : this.generalSettingsForm.get('fittingOption')?.value === FITTING_OPTION.ORIGINAL && ShouldRenderDoublePage, 'reverse': ShouldRenderReverseDouble}">- <img [src]="readerService.getPageUrl(this.chapterId, this.pageNum)" id="image-1"+ <img [src]="canvasImage.src" id="image-1"class="{{getFittingOptionClass()}} {{readerMode === ReaderMode.LeftRight || readerMode === ReaderMode.UpDown ? '' : 'd-none'}} {{showClickOverlay ? 'blur' : ''}}"><ng-container *ngIf="ShouldRenderDoublePage && (this.pageNum + 1 <= maxPages - 1 && this.pageNum > 0)">@@ -128,27 +128,19 @@</div><div class="bottom-menu" *ngIf="settingsOpen && generalSettingsForm"><form [formGroup]="generalSettingsForm">- <div class="row">- <div class="col-6">+ <div class="row mb-2">+ <div class="col-md-6 col-sm-12"><label for="page-splitting" class="form-label">Image Splitting</label> <div class="split fa fa-image"><div class="{{splitIconClass}}"></div></div>+ <select class="form-control" id="page-splitting" formControlName="pageSplitOption">+ <option *ngFor="let opt of pageSplitOptions" [value]="opt.value">{{opt.text}}</option>+ </select></div>- <div class="col-6">- <div class="mb-3">- <select class="form-control" id="page-splitting" formControlName="pageSplitOption">- <option *ngFor="let opt of pageSplitOptions" [value]="opt.value">{{opt.text}}</option>- </select>- </div>- </div>- </div>- <div class="row">- <div class="col-6">+ <div class="col-md-6 col-sm-12"><label for="page-fitting" class="form-label">Image Scaling</label> <i class="fa {{getFittingIcon()}}" aria-hidden="true"></i>- </div>- <div class="col-6"><select class="form-control" id="page-fitting" formControlName="fittingOption"><option value="full-height">Height</option><option value="full-width">Width</option>@@ -157,11 +149,14 @@</div></div>- <div class="row mt-2 mb-2">- <div class="col-6">- <label for="autoCloseMenu" class="form-check-label">Auto Close Menu</label>+ <div class="row mb-2">+ <div class="col-md-6 col-sm-12">+ <label for="layout-mode" class="form-label">Layout Mode</label>+ <select class="form-control" id="page-fitting" formControlName="layoutMode">+ <option [value]="opt.value" *ngFor="let opt of layoutModes">{{opt.text}}</option>+ </select></div>- <div class="col-6">+ <div class="col-md-6 col-sm-12"><div class="mb-3"><label id="auto-close-label" class="form-label"></label><div class="mb-3">@@ -173,17 +168,6 @@</div></div></div>-- <div class="row mt-2 mb-2">- <div class="col-6">- <label for="layout-mode" class="form-label">Layout Mode</label>- </div>- <div class="col-6">- <select class="form-control" id="page-fitting" formControlName="layoutMode">- <option [value]="opt.value" *ngFor="let opt of layoutModes">{{opt.text}}</option>- </select>- </div>- </div></form></div></div>diff --git a/UI/Web/src/app/manga-reader/manga-reader.component.scss b/UI/Web/src/app/manga-reader/manga-reader.component.scssindex 65bef4e82..0bc038212 100644--- a/UI/Web/src/app/manga-reader/manga-reader.component.scss+++ b/UI/Web/src/app/manga-reader/manga-reader.component.scss@@ -47,9 +47,9 @@ img {}}-canvas {- position: absolute;-}+// canvas {+// //position: absolute; // JOE: Not sure why we have this, but it breaks the renderer+// }.reader {background-color: var(--manga-reader-bg-color);diff --git a/UI/Web/src/app/manga-reader/manga-reader.component.ts b/UI/Web/src/app/manga-reader/manga-reader.component.tsindex 9ad50d2e8..1e3eae62f 100644--- a/UI/Web/src/app/manga-reader/manga-reader.component.ts+++ b/UI/Web/src/app/manga-reader/manga-reader.component.ts@@ -122,7 +122,10 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {* Used soley for LayoutMode.Double rendering. Will always hold the next image in buffer.*/canvasImage2 = new Image();- renderWithCanvas: boolean = false; // Dictates if we use render with canvas or with image+ /**+ * Dictates if we use render with canvas or with image. This is only for Splitting.+ */+ renderWithCanvas: boolean = false;/*** A circular array of size PREFETCH_PAGES + 2. Maintains prefetched Images around the current page to load from to avoid loading animation.@@ -530,11 +533,8 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {newOptions.ceil = this.maxPages - 1; // We -1 so that the slider UI shows us hitting the end, since visually we +1 everything.this.pageOptions = newOptions;- // TODO: Move this into ChapterInfo- this.libraryService.getLibraryType(results.chapterInfo.libraryId).pipe(take(1)).subscribe(type => {- this.libraryType = type;- this.updateTitle(results.chapterInfo, type);- });+ this.libraryType = results.chapterInfo.libraryType;+ this.updateTitle(results.chapterInfo, this.libraryType);this.inSetup = false;@@ -645,20 +645,20 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {getFittingOptionClass() {const formControl = this.generalSettingsForm.get('fittingOption');- let val = FITTING_OPTION.HEIGHT;+ let val = FITTING_OPTION.HEIGHT as string;if (formControl === undefined) {- val = FITTING_OPTION.HEIGHT;+ val = FITTING_OPTION.HEIGHT as string;}val = formControl?.value;-- if (this.isCoverImage() && this.layoutMode !== LayoutMode.Single) {- return val + ' cover double';+ if (this.layoutMode !== LayoutMode.Single) {+ val = val + (this.isCoverImage() ? 'cover' : '') + 'double';+ } else if (this.isCoverImage() && this.shouldRenderAsFitSplit()) {+ // JOE: If we are Fit to Screen, we should use fitting as width just for cover images+ // Rewriting to fit to width for this cover image+ val = FITTING_OPTION.WIDTH;}- if (!this.isCoverImage() && this.layoutMode !== LayoutMode.Single) {- return val + ' double';- }return val;}@@ -971,6 +971,10 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {this.renderWithCanvas = true;} else {this.renderWithCanvas = false;++ // if (this.isCoverImage() && this.layoutMode === LayoutMode.Single && this.getFit() !== FITTING_OPTION.WIDTH) {++ // }}// Reset scroll on non HEIGHT Fitsdiff --git a/UI/Web/src/app/on-deck/on-deck.component.html b/UI/Web/src/app/on-deck/on-deck.component.htmldeleted file mode 100644index d03b4b696..000000000--- a/UI/Web/src/app/on-deck/on-deck.component.html+++ /dev/null@@ -1,13 +0,0 @@-<app-bulk-operations [actionCallback]="bulkActionCallback"></app-bulk-operations>-<app-card-detail-layout header="On Deck"- [isLoading]="isLoading"- [items]="series"- [pagination]="pagination"- [filterSettings]="filterSettings"- (pageChange)="onPageChange($event)"- (applyFilter)="updateFilter($event)"- >- <ng-template #cardItem let-item let-position="idx">- <app-series-card [data]="item" [libraryId]="item.libraryId" (reload)="loadPage()" (selection)="bulkSelectionService.handleCardSelection('series', position, series.length, $event)" [selected]="bulkSelectionService.isCardSelected('series', position)" [allowSelection]="true"></app-series-card>- </ng-template>-</app-card-detail-layout>diff --git a/UI/Web/src/app/on-deck/on-deck.component.scss b/UI/Web/src/app/on-deck/on-deck.component.scssdeleted file mode 100644index e69de29bb..000000000diff --git a/UI/Web/src/app/on-deck/on-deck.component.ts b/UI/Web/src/app/on-deck/on-deck.component.tsdeleted file mode 100644index a7bcbe5f1..000000000--- a/UI/Web/src/app/on-deck/on-deck.component.ts+++ /dev/null@@ -1,132 +0,0 @@-import { Component, HostListener, OnInit } from '@angular/core';-import { Title } from '@angular/platform-browser';-import { Router, ActivatedRoute } from '@angular/router';-import { take } from 'rxjs/operators';-import { BulkSelectionService } from '../cards/bulk-selection.service';-import { FilterSettings } from '../cards/card-detail-layout/card-detail-layout.component';-import { KEY_CODES } from '../shared/_services/utility.service';-import { Pagination } from '../_models/pagination';-import { Series } from '../_models/series';-import { FilterEvent, SeriesFilter} from '../_models/series-filter';-import { Action } from '../_services/action-factory.service';-import { ActionService } from '../_services/action.service';-import { SeriesService } from '../_services/series.service';--@Component({- selector: 'app-on-deck',- templateUrl: './on-deck.component.html',- styleUrls: ['./on-deck.component.scss']-})-export class OnDeckComponent implements OnInit {-- isLoading: boolean = true;- series: Series[] = [];- pagination!: Pagination;- libraryId!: number;- filter: SeriesFilter | undefined = undefined;- filterSettings: FilterSettings = new FilterSettings();-- constructor(private router: Router, private route: ActivatedRoute, private seriesService: SeriesService, private titleService: Title,- private actionService: ActionService, public bulkSelectionService: BulkSelectionService) {- this.router.routeReuseStrategy.shouldReuseRoute = () => false;- this.titleService.setTitle('Kavita - On Deck');- if (this.pagination === undefined || this.pagination === null) {- this.pagination = {currentPage: 0, itemsPerPage: 30, totalItems: 0, totalPages: 1};- }- this.filterSettings.readProgressDisabled = true;- this.filterSettings.sortDisabled = true;- this.loadPage();- }-- @HostListener('document:keydown.shift', ['$event'])- handleKeypress(event: KeyboardEvent) {- if (event.key === KEY_CODES.SHIFT) {- this.bulkSelectionService.isShiftDown = true;- }- }-- @HostListener('document:keyup.shift', ['$event'])- handleKeyUp(event: KeyboardEvent) {- if (event.key === KEY_CODES.SHIFT) {- this.bulkSelectionService.isShiftDown = false;- }- }-- ngOnInit() {}-- seriesClicked(series: Series) {- this.router.navigate(['library', this.libraryId, 'series', series.id]);- }-- onPageChange(pagination: Pagination) {- window.history.replaceState(window.location.href, '', window.location.href.split('?')[0] + '?page=' + this.pagination.currentPage);- this.loadPage();- }-- updateFilter(event: FilterEvent) {- this.filter = event.filter;- const page = this.getPage();- if (page === undefined || page === null || !event.isFirst) {- this.pagination.currentPage = 1;- this.onPageChange(this.pagination);- } else {- this.loadPage();- }- }-- loadPage() {- const page = this.getPage();- if (page != null) {- this.pagination.currentPage = parseInt(page, 10);- }- this.isLoading = true;- this.seriesService.getOnDeck(this.libraryId, this.pagination?.currentPage, this.pagination?.itemsPerPage, this.filter).pipe(take(1)).subscribe(series => {- this.series = series.result;- this.pagination = series.pagination;- this.isLoading = false;- window.scrollTo(0, 0);- });- }-- getPage() {- const urlParams = new URLSearchParams(window.location.search);- return urlParams.get('page');- }-- bulkActionCallback = (action: Action, data: any) => {- const selectedSeriesIndexies = this.bulkSelectionService.getSelectedCardsForSource('series');- const selectedSeries = this.series.filter((series, index: number) => selectedSeriesIndexies.includes(index + ''));-- switch (action) {- case Action.AddToReadingList:- this.actionService.addMultipleSeriesToReadingList(selectedSeries, () => {- this.bulkSelectionService.deselectAll();- });- break;- case Action.AddToCollection:- this.actionService.addMultipleSeriesToCollectionTag(selectedSeries, () => {- this.bulkSelectionService.deselectAll();- });- break;- case Action.MarkAsRead:- this.actionService.markMultipleSeriesAsRead(selectedSeries, () => {- this.loadPage();- this.bulkSelectionService.deselectAll();- });- break;- case Action.MarkAsUnread:- this.actionService.markMultipleSeriesAsUnread(selectedSeries, () => {- this.loadPage();- this.bulkSelectionService.deselectAll();- });- break;- case Action.Delete:- this.actionService.deleteMultipleSeries(selectedSeries, () => {- this.loadPage();- this.bulkSelectionService.deselectAll();- });- break;- }- }--}diff --git a/UI/Web/src/app/series-detail/series-detail.component.html b/UI/Web/src/app/series-detail/series-detail.component.htmlindex f82caf80c..fc48ea0de 100644--- a/UI/Web/src/app/series-detail/series-detail.component.html+++ b/UI/Web/src/app/series-detail/series-detail.component.html@@ -5,7 +5,6 @@</div><div class="col-md-10 col-xs-8 col-sm-6"><div class="row g-0">-<h2>{{series?.name}}</h2>diff --git a/UI/Web/src/app/series-detail/series-detail.component.ts b/UI/Web/src/app/series-detail/series-detail.component.tsindex 08b8d42c7..e59087f63 100644--- a/UI/Web/src/app/series-detail/series-detail.component.ts+++ b/UI/Web/src/app/series-detail/series-detail.component.ts@@ -496,7 +496,12 @@ export class SeriesDetailComponent implements OnInit, OnDestroy {// If user has progress on the volume, load them where they left offif (volume.pagesRead < volume.pages && volume.pagesRead > 0) {// Find the continue point chapter and load it- this.readerService.getCurrentChapter(this.seriesId).subscribe(chapter => this.openChapter(chapter));+ const unreadChapters = volume.chapters.filter(item => item.pagesRead < item.pages);+ if (unreadChapters.length > 0) {+ this.openChapter(unreadChapters[0]);+ return;+ }+ this.openChapter(volume.chapters[0]);return;}@@ -509,7 +514,7 @@ export class SeriesDetailComponent implements OnInit, OnDestroy {}openViewInfo(data: Volume | Chapter) {- const modalRef = this.modalService.open(CardDetailsModalComponent, { size: 'lg' }); // , scrollable: true (these don't work well on mobile)+ const modalRef = this.modalService.open(CardDetailsModalComponent, { size: 'lg' });modalRef.componentInstance.data = data;modalRef.componentInstance.parentName = this.series?.name;modalRef.componentInstance.seriesId = this.series?.id;diff --git a/UI/Web/src/app/shared/_services/utility.service.ts b/UI/Web/src/app/shared/_services/utility.service.tsindex 06241a544..b0d0e3410 100644--- a/UI/Web/src/app/shared/_services/utility.service.ts+++ b/UI/Web/src/app/shared/_services/utility.service.ts@@ -207,6 +207,18 @@ export class UtilityService {filter.translators = [...filter.translators, ...translators.split(',').map(item => parseInt(item, 10))];anyChanged = true;}++ /// Read status is encoded as true,true,true+ const readStatus = snapshot.queryParamMap.get('readStatus');+ if (readStatus !== undefined && readStatus !== null) {+ const values = readStatus.split(',').map(i => i === "true");+ if (values.length === 3) {+ filter.readStatus.inProgress = values[0];+ filter.readStatus.notRead = values[1];+ filter.readStatus.read = values[2];+ anyChanged = true;+ }+ }return [filter, anyChanged];diff --git a/UI/Web/src/app/user-settings/api-key/api-key.component.html b/UI/Web/src/app/user-settings/api-key/api-key.component.htmlindex 588181ef9..6eb7b3363 100644--- a/UI/Web/src/app/user-settings/api-key/api-key.component.html+++ b/UI/Web/src/app/user-settings/api-key/api-key.component.html@@ -4,7 +4,7 @@<div class="input-group"><input #apiKey type="text" readonly class="form-control" id="api-key--{{title}}" aria-describedby="button-addon4" [value]="key" (click)="selectAll()"><div id="button-addon4">- <button class="btn btn-outline-secondary" type="button" (click)="copy()"><span class="visually-hidden">Copy</span><i class="fa fa-copy" aria-hidden="true"></i></button>+ <button class="btn btn-outline-secondary" type="button" (click)="copy()" title="Copy"><span class="visually-hidden">Copy</span><i class="fa fa-copy" aria-hidden="true"></i></button><button class="btn btn-danger" type="button" [ngbTooltip]="tipContent" (click)="refresh()" *ngIf="showRefresh"><span class="visually-hidden">Regenerate</span><i class="fa fa-sync-alt" aria-hidden="true"></i></button></div><ng-template #tipContent>diff --git a/UI/Web/src/app/user-settings/user-settings.module.ts b/UI/Web/src/app/user-settings/user-settings.module.tsindex d7ce36f44..430d68dd4 100644--- a/UI/Web/src/app/user-settings/user-settings.module.ts+++ b/UI/Web/src/app/user-settings/user-settings.module.ts@@ -31,12 +31,12 @@ import { ColorPickerModule } from 'ngx-color-picker';NgbTooltipModule,NgxSliderModule,UserSettingsRoutingModule,- //SharedModule, // SentenceCase pipePipeModule,ColorPickerModule, // User prefernces background color],exports: [- SiteThemeProviderPipe+ SiteThemeProviderPipe,+ ApiKeyComponent]})export class UserSettingsModule { }