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
Feature/enhancements and more (#1166)
Joseph Milazzo4a93b5c71586
diff --git a/API.Benchmark/ParserBenchmarks.cs b/API.Benchmark/ParserBenchmarks.csindex 98e83eb00..63adc6985 100644--- a/API.Benchmark/ParserBenchmarks.cs+++ b/API.Benchmark/ParserBenchmarks.cs@@ -54,7 +54,7 @@ namespace API.Benchmark{foreach (var name in _names){- if ((name + ".epub").ToLower() == ".epub")+ if ((name).ToLower() == ".epub"){/* No Operation */}@@ -67,7 +67,7 @@ namespace API.Benchmarkforeach (var name in _names){- if (IsEpub.IsMatch((name + ".epub")))+ if (Path.GetExtension(name).Equals(".epub", StringComparison.InvariantCultureIgnoreCase)){/* No Operation */}diff --git a/API.Tests/Parser/ParserTest.cs b/API.Tests/Parser/ParserTest.csindex 84dee1b8b..e57f56928 100644--- a/API.Tests/Parser/ParserTest.cs+++ b/API.Tests/Parser/ParserTest.cs@@ -163,6 +163,7 @@ namespace API.Tests.Parser[InlineData("Citrus+", "citrus+")][InlineData("Again!!!!", "again")][InlineData("카비타", "카비타")]+ [InlineData("06", "06")][InlineData("", "")]public void NormalizeTest(string input, string expected){diff --git a/API.Tests/Services/ReaderServiceTests.cs b/API.Tests/Services/ReaderServiceTests.csindex 402f136c3..2cf796e6c 100644--- a/API.Tests/Services/ReaderServiceTests.cs+++ b/API.Tests/Services/ReaderServiceTests.cs@@ -1650,6 +1650,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@@ -1855,5 +1910,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/DownloadController.cs b/API/Controllers/DownloadController.csindex 5ae577f5e..cbf491c02 100644--- a/API/Controllers/DownloadController.cs+++ b/API/Controllers/DownloadController.cs@@ -65,6 +65,8 @@ namespace API.Controllersreturn Ok(_directoryService.GetTotalSize(files.Select(c => c.FilePath)));}++[Authorize(Policy="RequireDownloadRole")][HttpGet("volume")]public async Task<ActionResult> DownloadVolume(int volumeId)diff --git a/API/Controllers/LibraryController.cs b/API/Controllers/LibraryController.csindex 3084ab352..a5c2ae676 100644--- a/API/Controllers/LibraryController.cs+++ b/API/Controllers/LibraryController.cs@@ -11,6 +11,7 @@ using API.Entities;using API.Entities.Enums;using API.Extensions;using API.Services;+using API.SignalR;using AutoMapper;using Microsoft.AspNetCore.Authorization;using Microsoft.AspNetCore.Mvc;@@ -26,16 +27,18 @@ namespace API.Controllersprivate readonly IMapper _mapper;private readonly ITaskScheduler _taskScheduler;private readonly IUnitOfWork _unitOfWork;+ private readonly IEventHub _eventHub;public LibraryController(IDirectoryService directoryService,ILogger<LibraryController> logger, IMapper mapper, ITaskScheduler taskScheduler,- IUnitOfWork unitOfWork)+ IUnitOfWork unitOfWork, IEventHub eventHub){_directoryService = directoryService;_logger = logger;_mapper = mapper;_taskScheduler = taskScheduler;_unitOfWork = unitOfWork;+ _eventHub = eventHub;}/// <summary>@@ -73,6 +76,8 @@ namespace API.Controllers_logger.LogInformation("Created a new library: {LibraryName}", library.Name);_taskScheduler.ScanLibrary(library.Id);+ await _eventHub.SendMessageAsync(MessageFactory.LibraryModified,+ MessageFactory.LibraryModifiedEvent(library.Id, "create"), false);return Ok();}@@ -191,6 +196,9 @@ namespace API.Controllersawait _unitOfWork.CommitAsync();_taskScheduler.CleanupChapters(chapterIds);}++ await _eventHub.SendMessageAsync(MessageFactory.LibraryModified,+ MessageFactory.LibraryModifiedEvent(libraryId, "delete"), false);return Ok(true);}catch (Exception ex)diff --git a/API/Controllers/OPDSController.cs b/API/Controllers/OPDSController.csindex b81075c6a..5cef859a4 100644--- a/API/Controllers/OPDSController.cs+++ b/API/Controllers/OPDSController.cs@@ -745,9 +745,18 @@ public class OpdsController : BaseApiControllervar fileType = _downloadService.GetContentTypeFromFile(mangaFile.FilePath);var filename = Uri.EscapeDataString(Path.GetFileName(mangaFile.FilePath) ?? string.Empty);var libraryType = await _unitOfWork.LibraryRepository.GetLibraryTypeAsync(series.LibraryId);+ var volume = await _unitOfWork.VolumeRepository.GetVolumeDtoAsync(volumeId, await GetUser(apiKey));-- var title = $"{series.Name} - {SeriesService.FormatChapterTitle(chapter, libraryType)}";+ var title = $"{series.Name} - ";+ if (volume.Chapters.Count == 1)+ {+ SeriesService.RenameVolumeName(volume.Chapters.First(), volume, libraryType);+ title += $"{volume.Name}";+ }+ else+ {+ title = $"{series.Name} - {SeriesService.FormatChapterTitle(chapter, libraryType)}";+ }// Chunky requires a file at the end. Our API ignores thisvar accLink =diff --git a/API/Controllers/ReaderController.cs b/API/Controllers/ReaderController.csindex 9bcce9591..e2d067abd 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/Controllers/UploadController.cs b/API/Controllers/UploadController.csindex 225d6be9a..3dd23db1a 100644--- a/API/Controllers/UploadController.cs+++ b/API/Controllers/UploadController.cs@@ -46,7 +46,7 @@ namespace API.Controllerspublic async Task<ActionResult<string>> GetImageFromFile(UploadUrlDto dto){var dateString = $"{DateTime.Now.ToShortDateString()}_{DateTime.Now.ToLongTimeString()}".Replace("/", "_").Replace(":", "_");- var format = _directoryService.FileSystem.Path.GetExtension(dto.Url).Replace(".", "");+ var format = _directoryService.FileSystem.Path.GetExtension(dto.Url.Split('?')[0]).Replace(".", "");var path = await dto.Url.DownloadFileAsync(_directoryService.TempDirectory, $"coverupload_{dateString}.{format}");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..1a8d9fc8b 100644--- a/API/DTOs/Filtering/FilterDto.cs+++ b/API/DTOs/Filtering/FilterDto.cs@@ -1,4 +1,5 @@using System.Collections.Generic;+using System.Runtime.InteropServices;using API.Entities;using API.Entities.Enums;@@ -25,51 +26,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>@@ -94,5 +95,10 @@ namespace API.DTOs.Filtering/// </summary>public IList<PublicationStatus> PublicationStatus { get; init; } = new List<PublicationStatus>();+ /// <summary>+ /// An optional name string to filter by. Empty string will ignore.+ /// </summary>+ public string SeriesNameQuery { get; init; } = string.Empty;+}}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..16845ad59 100644--- a/API/Data/Repositories/SeriesRepository.cs+++ b/API/Data/Repositories/SeriesRepository.cs@@ -2,6 +2,7 @@using System.Collections.Generic;using System.Globalization;using System.Linq;+using System.Text.RegularExpressions;using System.Threading.Tasks;using API.Data.Scanner;using API.DTOs;@@ -79,8 +80,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);@@ -283,17 +284,22 @@ public class SeriesRepository : ISeriesRepositoryresult.Libraries = await _context.Library.Where(l => libraryIds.Contains(l.Id))- .Where(s => EF.Functions.Like(s.Name, $"%{searchQuery}%"))+ .Where(l => EF.Functions.Like(l.Name, $"%{searchQuery}%")).OrderBy(l => l.Name).AsSplitQuery().ProjectTo<LibraryDto>(_mapper.ConfigurationProvider).ToListAsync();+ var justYear = Regex.Match(searchQuery, @"\d{4}").Value;+ var hasYearInQuery = !string.IsNullOrEmpty(justYear);+ var yearComparison = hasYearInQuery ? int.Parse(justYear) : 0;+result.Series = await _context.Series.Where(s => libraryIds.Contains(s.LibraryId)).Where(s => EF.Functions.Like(s.Name, $"%{searchQuery}%")|| EF.Functions.Like(s.OriginalName, $"%{searchQuery}%")- || EF.Functions.Like(s.LocalizedName, $"%{searchQuery}%"))+ || EF.Functions.Like(s.LocalizedName, $"%{searchQuery}%")+ || (hasYearInQuery && s.Metadata.ReleaseYear == yearComparison)).Include(s => s.Library).OrderBy(s => s.SortName).AsNoTracking()@@ -301,6 +307,7 @@ public class SeriesRepository : ISeriesRepository.ProjectTo<SearchResultDto>(_mapper.ConfigurationProvider).ToListAsync();+result.ReadingLists = await _context.ReadingList.Where(rl => rl.AppUserId == userId || rl.Promoted).Where(rl => EF.Functions.Like(rl.Title, $"%{searchQuery}%"))@@ -466,10 +473,16 @@ public class SeriesRepository : ISeriesRepository{s.PagesRead = userProgress.Where(p => p.SeriesId == s.Id).Sum(p => p.PagesRead);var rating = userRatings.SingleOrDefault(r => r.SeriesId == s.Id);- if (rating == null) continue;- s.UserRating = rating.Rating;- s.UserReview = rating.Review;- s.LatestReadDate = userProgress.Max(p => p.LastModified);+ if (rating != null)+ {+ s.UserRating = rating.Rating;+ s.UserReview = rating.Review;+ }++ if (userProgress.Count > 0)+ {+ s.LatestReadDate = userProgress.Max(p => p.LastModified);+ }}}@@ -508,7 +521,7 @@ public class SeriesRepository : ISeriesRepositoryprivate IList<MangaFormat> ExtractFilters(int libraryId, int userId, FilterDto filter, ref List<int> userLibraries,out List<int> allPeopleIds, out bool hasPeopleFilter, out bool hasGenresFilter, out bool hasCollectionTagFilter,out bool hasRatingFilter, out bool hasProgressFilter, out IList<int> seriesIds, out bool hasAgeRating, out bool hasTagsFilter,- out bool hasLanguageFilter, out bool hasPublicationFilter)+ out bool hasLanguageFilter, out bool hasPublicationFilter, out bool hasSeriesNameFilter){var formats = filter.GetSqlFilter();@@ -581,6 +594,8 @@ public class SeriesRepository : ISeriesRepository.ToList();}+ hasSeriesNameFilter = !string.IsNullOrEmpty(filter.SeriesNameQuery);+return formats;}@@ -593,11 +608,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 +627,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 progress@@ -638,7 +657,7 @@ public class SeriesRepository : ISeriesRepositoryvar formats = ExtractFilters(libraryId, userId, filter, ref userLibraries,out var allPeopleIds, out var hasPeopleFilter, out var hasGenresFilter,out var hasCollectionTagFilter, out var hasRatingFilter, out var hasProgressFilter,- out var seriesIds, out var hasAgeRating, out var hasTagsFilter, out var hasLanguageFilter, out var hasPublicationFilter);+ out var seriesIds, out var hasAgeRating, out var hasTagsFilter, out var hasLanguageFilter, out var hasPublicationFilter, out var hasSeriesNameFilter);var query = _context.Series.Where(s => userLibraries.Contains(s.LibraryId)@@ -652,8 +671,11 @@ public class SeriesRepository : ISeriesRepository&& (!hasAgeRating || filter.AgeRating.Contains(s.Metadata.AgeRating))&& (!hasTagsFilter || s.Metadata.Tags.Any(t => filter.Tags.Contains(t.Id)))&& (!hasLanguageFilter || filter.Languages.Contains(s.Metadata.Language))- && (!hasPublicationFilter || filter.PublicationStatus.Contains(s.Metadata.PublicationStatus))- )+ && (!hasPublicationFilter || filter.PublicationStatus.Contains(s.Metadata.PublicationStatus)))+ .Where(s => !hasSeriesNameFilter ||+ EF.Functions.Like(s.Name, $"%{filter.SeriesNameQuery}%")+ || EF.Functions.Like(s.OriginalName, $"%{filter.SeriesNameQuery}%")+ || EF.Functions.Like(s.LocalizedName, $"%{filter.SeriesNameQuery}%")).AsNoTracking();// If no sort options, default to using SortNamediff --git a/API/Data/Repositories/UserRepository.cs b/API/Data/Repositories/UserRepository.csindex e41849c92..60c72a77c 100644--- a/API/Data/Repositories/UserRepository.cs+++ b/API/Data/Repositories/UserRepository.cs@@ -220,7 +220,8 @@ public class UserRepository : IUserRepositorypublic async Task<AppUser> GetUserByEmailAsync(string email){- return await _context.AppUser.SingleOrDefaultAsync(u => u.Email.ToLower().Equals(email.ToLower()));+ var lowerEmail = email.ToLower();+ return await _context.AppUser.SingleOrDefaultAsync(u => u.Email.ToLower().Equals(lowerEmail));}public async Task<IEnumerable<AppUser>> GetAllUsers()diff --git a/API/Parser/Parser.cs b/API/Parser/Parser.csindex 1b8557f73..cc237eae7 100644--- a/API/Parser/Parser.cs+++ b/API/Parser/Parser.cs@@ -57,7 +57,7 @@ namespace API.Parserprivate static readonly Regex CoverImageRegex = new Regex(@"(?<![[a-z]\d])(?:!?)((?<!back)cover|folder)(?![\w\d])",MatchOptions, RegexTimeout);- private static readonly Regex NormalizeRegex = new Regex(@"[^a-zA-Z0-9\+]",+ private static readonly Regex NormalizeRegex = new Regex(@"[^\p{L}0-9\+]",MatchOptions, RegexTimeout);@@ -966,8 +966,7 @@ namespace API.Parserpublic static string Normalize(string name){- var normalized = NormalizeRegex.Replace(name, string.Empty).ToLower();- return string.IsNullOrEmpty(normalized) ? name : normalized;+ return NormalizeRegex.Replace(name, string.Empty).ToLower();}/// <summary>@@ -1009,12 +1008,12 @@ namespace API.Parserpublic static bool IsEpub(string filePath){- return Path.GetExtension(filePath).ToLower() == ".epub";+ return Path.GetExtension(filePath).Equals(".epub", StringComparison.InvariantCultureIgnoreCase);}public static bool IsPdf(string filePath){- return Path.GetExtension(filePath).ToLower() == ".pdf";+ return Path.GetExtension(filePath).Equals(".pdf", StringComparison.InvariantCultureIgnoreCase);}/// <summary>@@ -1025,8 +1024,7 @@ namespace API.Parser/// <returns></returns>public static string CleanAuthor(string author){- if (string.IsNullOrEmpty(author)) return string.Empty;- return author.Trim();+ return string.IsNullOrEmpty(author) ? string.Empty : author.Trim();}/// <summary>diff --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 f5437e7bc..0c989900e 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>@@ -367,7 +403,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/API/Services/SeriesService.cs b/API/Services/SeriesService.csindex 14969884f..3f82af55d 100644--- a/API/Services/SeriesService.cs+++ b/API/Services/SeriesService.cs@@ -445,20 +445,7 @@ public class SeriesService : ISeriesServicevar firstChapter = volume.Chapters.First();// On Books, skip volumes that are specials, since these will be shownif (firstChapter.IsSpecial) continue;- if (string.IsNullOrEmpty(firstChapter.TitleName))- {- if (!firstChapter.Range.Equals(Parser.Parser.DefaultVolume))- {- var title = Path.GetFileNameWithoutExtension(firstChapter.Range);- if (string.IsNullOrEmpty(title)) continue;- volume.Name += $" - {title}";- }- }- else- {- volume.Name += $" - {firstChapter.TitleName}";- }-+ RenameVolumeName(firstChapter, volume, libraryType);processedVolumes.Add(volume);}}@@ -517,48 +504,64 @@ public class SeriesService : ISeriesServicereturn !c.IsSpecial && !c.Number.Equals(Parser.Parser.DefaultChapter);}- public static string FormatChapterTitle(ChapterDto chapter, LibraryType libraryType)+ public static void RenameVolumeName(ChapterDto firstChapter, VolumeDto volume, LibraryType libraryType){- if (chapter.IsSpecial)+ if (libraryType == LibraryType.Book){- return Parser.Parser.CleanSpecialTitle(chapter.Title);+ if (string.IsNullOrEmpty(firstChapter.TitleName))+ {+ if (firstChapter.Range.Equals(Parser.Parser.DefaultVolume)) return;+ var title = Path.GetFileNameWithoutExtension(firstChapter.Range);+ if (string.IsNullOrEmpty(title)) return;+ volume.Name += $" - {title}";+ }+ else+ {+ volume.Name += $" - {firstChapter.TitleName}";+ }++ return;}- return libraryType switch- {- LibraryType.Book => $"Book {chapter.Title}",- LibraryType.Comic => $"Issue #{chapter.Title}",- LibraryType.Manga => $"Chapter {chapter.Title}",- _ => "Chapter "- };++ volume.Name = $"Volume {volume.Name}";}- public static string FormatChapterTitle(Chapter chapter, LibraryType libraryType)++ private static string FormatChapterTitle(bool isSpecial, LibraryType libraryType, string chapterTitle, bool withHash){- if (chapter.IsSpecial)+ if (isSpecial){- return Parser.Parser.CleanSpecialTitle(chapter.Title);+ return Parser.Parser.CleanSpecialTitle(chapterTitle);}++ var hashSpot = withHash ? "#" : string.Empty;return libraryType switch{- LibraryType.Book => $"Book {chapter.Title}",- LibraryType.Comic => $"Issue #{chapter.Title}",- LibraryType.Manga => $"Chapter {chapter.Title}",+ LibraryType.Book => $"Book {chapterTitle}",+ LibraryType.Comic => $"Issue {hashSpot}{chapterTitle}",+ LibraryType.Manga => $"Chapter {chapterTitle}",_ => "Chapter "};}+ public static string FormatChapterTitle(ChapterDto chapter, LibraryType libraryType, bool withHash = true)+ {+ return FormatChapterTitle(chapter.IsSpecial, libraryType, chapter.Title, withHash);+ }++ public static string FormatChapterTitle(Chapter chapter, LibraryType libraryType, bool withHash = true)+ {+ return FormatChapterTitle(chapter.IsSpecial, libraryType, chapter.Title, withHash);+ }+public static string FormatChapterName(LibraryType libraryType, bool withHash = false){- switch (libraryType)+ return libraryType switch{- case LibraryType.Manga:- return "Chapter";- case LibraryType.Comic:- return withHash ? "Issue #" : "Issue";- case LibraryType.Book:- return "Book";- default:- throw new ArgumentOutOfRangeException(nameof(libraryType), libraryType, null);- }+ LibraryType.Manga => "Chapter",+ LibraryType.Comic => withHash ? "Issue #" : "Issue",+ LibraryType.Book => "Book",+ _ => "Chapter"+ };}}diff --git a/API/SignalR/MessageFactory.cs b/API/SignalR/MessageFactory.csindex f0bc2f2a8..6fc6560c2 100644--- a/API/SignalR/MessageFactory.cs+++ b/API/SignalR/MessageFactory.cs@@ -74,6 +74,10 @@ namespace API.SignalR/// When DB updates are occuring during a library/series scan/// </summary>private const string ScanProgress = "ScanProgress";+ /// <summary>+ /// When a library is created/deleted in the Server+ /// </summary>+ public const string LibraryModified = "LibraryModified";public static SignalRMessage ScanSeriesEvent(int seriesId, string seriesName)@@ -225,6 +229,22 @@ namespace API.SignalR};}+ public static SignalRMessage LibraryModifiedEvent(int libraryId, string action)+ {+ return new SignalRMessage+ {+ Name = LibraryModified,+ Title = "Library modified",+ Progress = ProgressType.None,+ EventType = ProgressEventType.Single,+ Body = new+ {+ LibrayId = libraryId,+ Action = action,+ }+ };+ }+public static SignalRMessage DownloadProgressEvent(string username, string downloadName, float progress, string eventType = "updated"){return new SignalRMessage()@@ -270,27 +290,8 @@ namespace API.SignalR};}- public static SignalRMessage DbUpdateProgressEvent(Series series, string eventType)- {- // TODO: I want this as a detail of a Scanning Series and we can put more information like Volume or Chapter here- return new SignalRMessage()- {- Name = ScanProgress,- Title = $"Scanning {series.Library.Name}",- SubTitle = series.Name,- EventType = eventType,- Progress = ProgressType.Indeterminate,- Body = new- {- Title = "Updating Series",- SubTitle = series.Name- }- };- }-public static SignalRMessage LibraryScanProgressEvent(string libraryName, string eventType, string seriesName = ""){- // TODO: I want this as a detail of a Scanning Series and we can put more information like Volume or Chapter herereturn new SignalRMessage(){Name = ScanProgress,diff --git a/UI/Web/src/app/_models/events/library-modified-event.ts b/UI/Web/src/app/_models/events/library-modified-event.tsnew file mode 100644index 000000000..d09055401--- /dev/null+++ b/UI/Web/src/app/_models/events/library-modified-event.ts@@ -0,0 +1,4 @@+export interface LibraryModifiedEvent {+ libraryId: number;+ action: 'create' | 'delelte';+}\ No newline at end of filediff --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/_models/series-filter.ts b/UI/Web/src/app/_models/series-filter.tsindex a370266f5..aeafb3331 100644--- a/UI/Web/src/app/_models/series-filter.ts+++ b/UI/Web/src/app/_models/series-filter.ts@@ -29,6 +29,7 @@ export interface SeriesFilter {tags: Array<number>;languages: Array<string>;publicationStatus: Array<number>;+ seriesNameQuery: string;}export interface SortOptions {diff --git a/UI/Web/src/app/_services/account.service.ts b/UI/Web/src/app/_services/account.service.tsindex 419dec77d..3057704cb 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'@@ -130,8 +131,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/_services/message-hub.service.ts b/UI/Web/src/app/_services/message-hub.service.tsindex bf79902f5..f53b9681f 100644--- a/UI/Web/src/app/_services/message-hub.service.ts+++ b/UI/Web/src/app/_services/message-hub.service.ts@@ -4,6 +4,7 @@ import { HubConnection, HubConnectionBuilder } from '@microsoft/signalr';import { ToastrService } from 'ngx-toastr';import { BehaviorSubject, ReplaySubject } from 'rxjs';import { environment } from 'src/environments/environment';+import { LibraryModifiedEvent } from '../_models/events/library-modified-event';import { NotificationProgressEvent } from '../_models/events/notification-progress-event';import { SiteThemeProgressEvent } from '../_models/events/site-theme-progress-event';import { User } from '../_models/user';@@ -49,6 +50,10 @@ export enum EVENTS {* A subtype of NotificationProgress that represents a file being processed for cover image extraction*/CoverUpdateProgress = 'CoverUpdateProgress',+ /**+ * A library is created or removed from the instance+ */+ LibraryModified = 'LibraryModified'}export interface Message<T> {@@ -130,6 +135,13 @@ export class MessageHubService {});});+ this.hubConnection.on(EVENTS.LibraryModified, resp => {+ this.messagesSource.next({+ event: EVENTS.LibraryModified,+ payload: resp.body as LibraryModifiedEvent+ });+ });+this.hubConnection.on(EVENTS.NotificationProgress, (resp: NotificationProgressEvent) => {this.messagesSource.next({diff --git a/UI/Web/src/app/_services/series.service.ts b/UI/Web/src/app/_services/series.service.tsindex 1b7c91405..ed6be1b89 100644--- a/UI/Web/src/app/_services/series.service.ts+++ b/UI/Web/src/app/_services/series.service.ts@@ -226,6 +226,7 @@ export class SeriesService {tags: [],languages: [],publicationStatus: [],+ seriesNameQuery: '',};if (filter === undefined) return data;diff --git a/UI/Web/src/app/admin/admin.module.ts b/UI/Web/src/app/admin/admin.module.tsindex 0f042a097..a76eefdf5 100644--- a/UI/Web/src/app/admin/admin.module.ts+++ b/UI/Web/src/app/admin/admin.module.ts@@ -13,12 +13,12 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';import { ResetPasswordModalComponent } from './_modals/reset-password-modal/reset-password-modal.component';import { ManageSettingsComponent } from './manage-settings/manage-settings.component';import { ManageSystemComponent } from './manage-system/manage-system.component';-import { ChangelogComponent } from '../announcements/changelog/changelog.component';import { PipeModule } from '../pipe/pipe.module';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';import { SidenavModule } from '../sidenav/sidenav.module';@@ -50,7 +50,8 @@ import { SidenavModule } from '../sidenav/sidenav.module';NgbDropdownModule,SharedModule,PipeModule,- SidenavModule+ SidenavModule,+ 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.html b/UI/Web/src/app/all-series/all-series.component.htmlindex f999be269..e10933be9 100644--- a/UI/Web/src/app/all-series/all-series.component.html+++ b/UI/Web/src/app/all-series/all-series.component.html@@ -3,7 +3,7 @@<app-card-actionables [actions]="actions"></app-card-actionables>All Series</h2>- <h6 subtitle style="margin-left:40px;">{{pagination?.totalItems}} Series</h6>+ <h6 subtitle>{{pagination?.totalItems}} Series</h6></app-side-nav-companion-bar><app-bulk-operations [actionCallback]="bulkActionCallback"></app-bulk-operations><app-card-detail-layoutdiff --git a/UI/Web/src/app/all-series/all-series.component.ts b/UI/Web/src/app/all-series/all-series.component.tsindex 1268005d4..cfaeba6e2 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 '../metadata-filter/filter-settings';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/announcements/announcements.component.html b/UI/Web/src/app/announcements/announcements.component.htmlindex b4e053264..1240023a8 100644--- a/UI/Web/src/app/announcements/announcements.component.html+++ b/UI/Web/src/app/announcements/announcements.component.html@@ -1,3 +1,7 @@-<h1>Announcements</h1>+<app-side-nav-companion-bar>+ <h2 title>+ Announcements+ </h2>+</app-side-nav-companion-bar><app-changelog></app-changelog>\ No newline at end of filediff --git a/UI/Web/src/app/announcements/announcements.module.ts b/UI/Web/src/app/announcements/announcements.module.tsindex 32323aa9b..e601e38a9 100644--- a/UI/Web/src/app/announcements/announcements.module.ts+++ b/UI/Web/src/app/announcements/announcements.module.ts@@ -5,6 +5,7 @@ import { ChangelogComponent } from './changelog/changelog.component';import { AnnouncementsRoutingModule } from './announcements-routing.module';import { SharedModule } from '../shared/shared.module';import { PipeModule } from '../pipe/pipe.module';+import { SidenavModule } from '../sidenav/sidenav.module';@@ -17,7 +18,8 @@ import { PipeModule } from '../pipe/pipe.module';CommonModule,AnnouncementsRoutingModule,SharedModule,- PipeModule+ PipeModule,+ SidenavModule]})export class AnnouncementsModule { }diff --git a/UI/Web/src/app/app-routing.module.ts b/UI/Web/src/app/app-routing.module.tsindex dc24f98bd..0ea1e0fa0 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';@@ -70,7 +69,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 28993559b..d790f027c 100644--- a/UI/Web/src/app/app.module.ts+++ b/UI/Web/src/app/app.module.ts@@ -23,7 +23,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';@@ -50,7 +49,6 @@ import { SidenavModule } from './sidenav/sidenav.module';SeriesDetailComponent,ReviewSeriesModalComponent,RecentlyAddedComponent,- OnDeckComponent,DashboardComponent,EventsWidgetComponent,SeriesMetadataDetailComponent,@@ -104,7 +102,6 @@ import { SidenavModule } from './sidenav/sidenav.module';{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 2f319a803..4acda1413 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@@ -89,7 +89,7 @@ export class EditSeriesModalComponent implements OnInit, OnDestroy {private seriesService: SeriesService,public utilityService: UtilityService,private fb: FormBuilder,- public imageService: ImageService,+ public imageService: ImageService,private libraryService: LibraryService,private collectionService: CollectionTagService,private uploadService: UploadService,@@ -98,8 +98,6 @@ export class EditSeriesModalComponent implements OnInit, OnDestroy {ngOnInit(): void {this.imageUrls.push(this.imageService.getSeriesCoverImage(this.series.id));- this.initSeries = Object.assign({}, this.series);-this.libraryService.getLibraryNames().pipe(takeUntil(this.onDestroy)).subscribe(names => {this.libraryName = names[this.series.libraryId];});@@ -107,7 +105,7 @@ export class EditSeriesModalComponent implements OnInit, OnDestroy {this.editSeriesForm = this.fb.group({id: new FormControl(this.series.id, []),- summary: new FormControl('', []),+ summary: new FormControl('', []),name: new FormControl(this.series.name, []),localizedName: new FormControl(this.series.localizedName, []),sortName: new FormControl(this.series.sortName, []),@@ -125,7 +123,7 @@ export class EditSeriesModalComponent implements OnInit, OnDestroy {this.metadataService.getAllAgeRatings().subscribe(ratings => {this.ageRatings = ratings;});-+this.metadataService.getAllPublicationStatus().subscribe(statuses => {this.publicationStatuses = statuses;});@@ -166,7 +164,7 @@ export class EditSeriesModalComponent implements OnInit, OnDestroy {this.metadata.ageRating = parseInt(val + '', 10);this.metadata.ageRatingLocked = true;});-+this.editSeriesForm.get('publicationStatus')?.valueChanges.pipe(takeUntil(this.onDestroy)).subscribe(val => {this.metadata.publicationStatus = parseInt(val + '', 10);this.metadata.publicationStatusLocked = true;@@ -245,8 +243,8 @@ export class EditSeriesModalComponent implements OnInit, OnDestroy {return options.filter(m => this.utilityService.filter(m.title, filter));}this.tagsSettings.fetchFn = (filter: string) => this.metadataService.getAllTags()- .pipe(map(items => this.tagsSettings.compareFn(items, filter)));-+ .pipe(map(items => this.tagsSettings.compareFn(items, filter)));+this.tagsSettings.addTransformFn = ((title: string) => {return {id: 0, title: title };});@@ -269,7 +267,7 @@ export class EditSeriesModalComponent implements OnInit, OnDestroy {this.genreSettings.addIfNonExisting = true;this.genreSettings.fetchFn = (filter: string) => {return this.metadataService.getAllGenres()- .pipe(map(items => this.genreSettings.compareFn(items, filter)));+ .pipe(map(items => this.genreSettings.compareFn(items, filter)));};this.genreSettings.compareFn = (options: Genre[], filter: string) => {return options.filter(m => this.utilityService.filter(m.title, filter));@@ -336,7 +334,7 @@ export class EditSeriesModalComponent implements OnInit, OnDestroy {return forkJoin([this.updateFromPreset('writer', this.metadata.writers, PersonRole.Writer),- this.updateFromPreset('character', this.metadata.characters, PersonRole.Character),+ this.updateFromPreset('character', this.metadata.characters, PersonRole.Character),this.updateFromPreset('colorist', this.metadata.colorists, PersonRole.Colorist),this.updateFromPreset('cover-artist', this.metadata.coverArtists, PersonRole.CoverArtist),this.updateFromPreset('editor', this.metadata.editors, PersonRole.Editor),@@ -350,7 +348,7 @@ export class EditSeriesModalComponent implements OnInit, OnDestroy {}));}- fetchPeople(role: PersonRole, filter: string) {+ fetchPeople(role: PersonRole, filter: string) {return this.metadataService.getAllPeople().pipe(map(people => {return people.filter(p => p.role == role && this.utilityService.filter(p.name, filter));}));@@ -415,7 +413,7 @@ export class EditSeriesModalComponent implements OnInit, OnDestroy {apis.push(this.seriesService.updateSeries(model));}-+if (selectedIndex > 0 && this.selectedCover !== '') {apis.push(this.uploadService.updateSeriesCoverImage(model.id, this.selectedCover));}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 6de989b21..7487d71fa 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@@ -14,7 +14,7 @@</div><app-metadata-filter [filterSettings]="filterSettings" [filterOpen]="filterOpen" (applyFilter)="applyMetadataFilter($event)"></app-metadata-filter>-+<ng-container [ngTemplateOutlet]="paginationTemplate" [ngTemplateOutletContext]="{ id: 'top' }"></ng-container>@@ -22,7 +22,7 @@<div class="col-auto ps-1 pe-1 mt-2 mb-2" *ngFor="let item of items; trackBy:trackByIdentity; index as i"><ng-container [ngTemplateOutlet]="itemTemplate" [ngTemplateOutletContext]="{ $implicit: item, idx: i }"></ng-container></div>-+<p *ngIf="items.length === 0 && !isLoading">There is no data</p>@@ -68,7 +68,7 @@</div></li></ng-template>-+</ngb-pagination></div></ng-template>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 e6f5c2e89..9165d215d 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@@ -20,7 +20,7 @@ const ANIMATION_SPEED = 300;export class CardDetailLayoutComponent implements OnInit, OnDestroy {@Input() header: string = '';- @Input() isLoading: boolean = false;+ @Input() isLoading: boolean = false;@Input() items: any[] = [];@Input() pagination!: Pagination;/**@@ -36,7 +36,7 @@ export class CardDetailLayoutComponent implements OnInit, OnDestroy {@Output() itemClicked: EventEmitter<any> = new EventEmitter();@Output() pageChange: EventEmitter<Pagination> = new EventEmitter();@Output() applyFilter: EventEmitter<FilterEvent> = new EventEmitter();-+@ContentChild('cardItem') itemTemplate!: TemplateRef<any>;diff --git a/UI/Web/src/app/carousel/carousel-reel/carousel-reel.component.html b/UI/Web/src/app/carousel/carousel-reel/carousel-reel.component.htmlindex 98d466c35..0857e8eff 100644--- a/UI/Web/src/app/carousel/carousel-reel/carousel-reel.component.html+++ b/UI/Web/src/app/carousel/carousel-reel/carousel-reel.component.html@@ -1,6 +1,6 @@<div class="carousel-container" *ngIf="items.length > 0"><div>- <h2 style="display: inline-block;"><a href="javascript:void(0)" (click)="sectionClicked($event)" class="section-title">{{title}}</a></h2>+ <h3 style="display: inline-block;"><a href="javascript:void(0)" (click)="sectionClicked($event)" class="section-title" [ngClass]="{'non-selectable': !clickableTitle}">{{title}}</a></h3><div class="float-end"><button class="btn btn-icon" [disabled]="isBeginning" (click)="prevPage()"><i class="fa fa-angle-left" aria-hidden="true"></i><span class="visually-hidden">Previous Items</span></button><button class="btn btn-icon" [disabled]="isEnd" (click)="nextPage()"><i class="fa fa-angle-right" aria-hidden="true"></i><span class="visually-hidden">Next Items</span></button>diff --git a/UI/Web/src/app/carousel/carousel-reel/carousel-reel.component.scss b/UI/Web/src/app/carousel/carousel-reel/carousel-reel.component.scssindex 287588465..c6bf119ac 100644--- a/UI/Web/src/app/carousel/carousel-reel/carousel-reel.component.scss+++ b/UI/Web/src/app/carousel/carousel-reel/carousel-reel.component.scss@@ -17,6 +17,10 @@text-decoration: var(--carousel-hover-header-text-decoration);}}++ .non-selectable {+ cursor: default;+ }}diff --git a/UI/Web/src/app/carousel/carousel-reel/carousel-reel.component.ts b/UI/Web/src/app/carousel/carousel-reel/carousel-reel.component.tsindex 995ea6c0c..0b00a1e07 100644--- a/UI/Web/src/app/carousel/carousel-reel/carousel-reel.component.ts+++ b/UI/Web/src/app/carousel/carousel-reel/carousel-reel.component.ts@@ -12,6 +12,7 @@ export class CarouselReelComponent implements OnInit {@ContentChild('carouselItem') carouselItemTemplate!: TemplateRef<any>;@Input() items: any[] = [];@Input() title = '';+ @Input() clickableTitle: boolean = true;@Output() sectionClick = new EventEmitter<string>();swiper: Swiper | undefined;diff --git a/UI/Web/src/app/library/library.component.html b/UI/Web/src/app/library/library.component.htmlindex 6d2692741..e05363698 100644--- a/UI/Web/src/app/library/library.component.html+++ b/UI/Web/src/app/library/library.component.html@@ -1,9 +1,13 @@-<div *ngIf="libraries.length === 0 && !isLoading && isAdmin" class="d-flex justify-content-center">- <p>There are no libraries setup yet. Configure some in <a href="/admin/dashboard#libraries">Server settings</a>.</p>-</div>-<div *ngIf="libraries.length === 0 && !isLoading && !isAdmin" class="d-flex justify-content-center">- <p>You haven't been granted access to any libraries.</p>-</div>+<ng-container *ngIf="libraries.length === 0 && !isLoading">+ <div class="mt-3">+ <div *ngIf="isAdmin" class="d-flex justify-content-center">+ <p>There are no libraries setup yet. Configure some in <a routerLink="/admin/dashboard" fragment="libraries">Server settings</a>.</p>+ </div>+ <div *ngIf="!isAdmin" class="d-flex justify-content-center">+ <p>You haven't been granted access to any libraries.</p>+ </div>+ </div>+</ng-container><app-carousel-reel [items]="inProgress" title="On Deck" (sectionClick)="handleSectionClick($event)"><ng-template #carouselItem let-item let-position="idx">@@ -12,14 +16,14 @@</app-carousel-reel><!-- TODO: Refactor this so we can use series actions here -->-<app-carousel-reel [items]="recentlyUpdatedSeries" title="Recently Updated Series" (sectionClick)="handleSectionClick($event)">+<app-carousel-reel [items]="recentlyUpdatedSeries" title="Recently Updated Series" (sectionClick)="handleSectionClick($event)"><ng-template #carouselItem let-item let-position="idx"><app-card-item [entity]="item" [title]="item.seriesName" [imageUrl]="imageService.getSeriesCoverImage(item.seriesId)"[supressArchiveWarning]="true" (clicked)="handleRecentlyAddedChapterClick(item)" [count]="item.count"></app-card-item></ng-template></app-carousel-reel>-<app-carousel-reel [items]="recentlyAddedSeries" title="Newly Added Series">+<app-carousel-reel [items]="recentlyAddedSeries" title="Newly Added Series" [clickableTitle]="false"><ng-template #carouselItem let-item let-position="idx"><app-series-card [data]="item" [libraryId]="item.libraryId" (dataChanged)="loadRecentlyAddedSeries()"></app-series-card></ng-template>diff --git a/UI/Web/src/app/library/library.component.ts b/UI/Web/src/app/library/library.component.tsindex dade32f8b..226f56faa 100644--- a/UI/Web/src/app/library/library.component.ts+++ b/UI/Web/src/app/library/library.component.ts@@ -141,7 +141,10 @@ 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});} 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 a59d7115a..64e355699 100644--- a/UI/Web/src/app/manga-reader/manga-reader.component.html+++ b/UI/Web/src/app/manga-reader/manga-reader.component.html@@ -37,12 +37,12 @@ondragstart="return false;" onselectstart="return false;"></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,+ <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)">@@ -132,27 +132,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>@@ -161,11 +153,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">@@ -177,17 +172,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 0770fe344..559fbda56 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.@@ -339,7 +342,7 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {return;}-+this.libraryId = parseInt(libraryId, 10);this.seriesId = parseInt(seriesId, 10);@@ -534,11 +537,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;@@ -660,14 +660,19 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {return FITTING_OPTION.WIDTH;}-if (this.isCoverImage() && this.layoutMode !== LayoutMode.Single) {return val + ' cover double';}- if (!this.isCoverImage() && this.layoutMode !== LayoutMode.Single) {- return val + ' double';- }+ // Code from feature/manga-reader. Validate which fix is better+ // 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;+ // }+return val;}diff --git a/UI/Web/src/app/metadata-filter/metadata-filter.component.html b/UI/Web/src/app/metadata-filter/metadata-filter.component.htmlindex c13248251..9e661805c 100644--- a/UI/Web/src/app/metadata-filter/metadata-filter.component.html+++ b/UI/Web/src/app/metadata-filter/metadata-filter.component.html@@ -5,14 +5,11 @@</div><div class="not-phone-hidden">- <app-drawer #commentDrawer="drawer" [isOpen]="!filteringCollapsed" [style.--drawer-width]="'300px'" [style.--drawer-background-color]="'#010409'" (drawerClosed)="filteringCollapsed = !filteringCollapsed">+ <app-drawer #commentDrawer="drawer" [isOpen]="!filteringCollapsed" [style.--drawer-width]="'300px'" [style.--drawer-background-color]="'#010409'" [options]="{topOffset: 56}" (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><div body class="drawer-body"><ng-container [ngTemplateOutlet]="filterSection"></ng-container>@@ -306,6 +303,16 @@<div class="col-md-2 me-3"></div></div><div class="row justify-content-center g-0">+ <div class="col-md-2 me-3">+ <form [formGroup]="seriesNameGroup">+ <div class="mb-3">+ <label for="series-name" class="form-label">Series Name</label> <i class="fa fa-info-circle" aria-hidden="true" placement="right" [ngbTooltip]="seriesNameFilterTooltip" role="button" tabindex="0"></i>+ <span class="visually-hidden" id="filter-series-name-help"><ng-container [ngTemplateOutlet]="seriesNameFilterTooltip"></ng-container></span>+ <ng-template #seriesNameFilterTooltip>Series name will filter against Name, Sort Name, or Localized Name</ng-template>+ <input type="text" id="series-name" formControlName="seriesNameQuery" class="form-control" aria-describedby="filter-series-name-help">+ </div>+ </form>+ </div><div class="col-md-2 me-3" *ngIf="!filterSettings.sortDisabled"><form [formGroup]="sortGroup"><div class="mb-3">@@ -326,11 +333,10 @@</div><div class="col-md-2 me-3" *ngIf="filterSettings.sortDisabled"></div><div class="col-md-2 me-3"></div>- <div class="col-md-2 me-3"></div>- <div class="col-md-2 me-3">+ <div class="col-md-2 me-3 mt-4"><button class="btn btn-secondary col-12" (click)="clear()">Clear</button></div>- <div class="col-md-2 me-3">+ <div class="col-md-2 me-3 mt-4"><button class="btn btn-primary col-12" (click)="apply()">Apply</button></div></div>diff --git a/UI/Web/src/app/metadata-filter/metadata-filter.component.ts b/UI/Web/src/app/metadata-filter/metadata-filter.component.tsindex f7f19a873..e73b224f2 100644--- a/UI/Web/src/app/metadata-filter/metadata-filter.component.ts+++ b/UI/Web/src/app/metadata-filter/metadata-filter.component.ts@@ -1,8 +1,8 @@import { Component, ContentChild, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';import { FormControl, FormGroup } from '@angular/forms';import { NgbCollapse } from '@ng-bootstrap/ng-bootstrap';-import { forkJoin, map, Observable, of, ReplaySubject, Subject, takeUntil } from 'rxjs';-import { UtilityService } from '../shared/_services/utility.service';+import { distinctUntilChanged, forkJoin, map, Observable, of, ReplaySubject, Subject, takeUntil } from 'rxjs';+import { Breakpoint, UtilityService } from '../shared/_services/utility.service';import { TypeaheadSettings } from '../typeahead/typeahead-settings';import { CollectionTag } from '../_models/collection-tag';import { Genre } from '../_models/genre';@@ -66,6 +66,7 @@ export class MetadataFilterComponent implements OnInit, OnDestroy {readProgressGroup!: FormGroup;sortGroup!: FormGroup;+ seriesNameGroup!: FormGroup;isAscendingSort: boolean = true;updateApplied: number = 0;@@ -83,7 +84,8 @@ export class MetadataFilterComponent 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.filter = this.seriesService.createSeriesFilter();this.readProgressGroup = new FormGroup({read: new FormControl(this.filter.readStatus.read, []),notRead: new FormControl(this.filter.readStatus.notRead, []),@@ -94,6 +96,10 @@ export class MetadataFilterComponent implements OnInit, OnDestroy {sortField: new FormControl(this.filter.sortOptions?.sortField || SortField.SortName, []),});+ this.seriesNameGroup = new FormGroup({+ seriesNameQuery: new FormControl(this.filter.seriesNameQuery || '', [])+ });+this.readProgressGroup.valueChanges.pipe(takeUntil(this.onDestory)).subscribe(changes => {this.filter.readStatus.read = this.readProgressGroup.get('read')?.value;this.filter.readStatus.inProgress = this.readProgressGroup.get('inProgress')?.value;@@ -124,6 +130,13 @@ export class MetadataFilterComponent implements OnInit, OnDestroy {}this.filter.sortOptions.sortField = parseInt(this.sortGroup.get('sortField')?.value, 10);});++ this.seriesNameGroup.get('seriesNameQuery')?.valueChanges.pipe(+ map(val => (val || '').trim()),+ distinctUntilChanged(),+ takeUntil(this.onDestory)).subscribe(changes => {+ this.filter.seriesNameQuery = changes;+ });}ngOnInit(): void {@@ -137,6 +150,12 @@ export class MetadataFilterComponent implements OnInit, OnDestroy {});}+ 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();}@@ -443,8 +462,8 @@ export class MetadataFilterComponent implements OnInit, OnDestroy {return personSettings;}- updateFormatFilters(formats: MangaFormat[]) {- this.filter.formats = formats.map(item => item) || [];+ updateFormatFilters(formats: FilterItem<MangaFormat>[]) {+ this.filter.formats = formats.map(item => item.value) || [];}updateLibraryFilters(libraries: Library[]) {diff --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 f1b617054..000000000--- a/UI/Web/src/app/on-deck/on-deck.component.html+++ /dev/null@@ -1,19 +0,0 @@-<app-side-nav-companion-bar [hasFilter]="true" (filterOpen)="filterOpen.emit($event)">- <h2 title>- On Deck- </h2>-</app-side-nav-companion-bar>-<app-bulk-operations [actionCallback]="bulkActionCallback"></app-bulk-operations>-<app-card-detail-layout- [isLoading]="isLoading"- [items]="series"- [pagination]="pagination"- [filterSettings]="filterSettings"- [filterOpen]="filterOpen"- (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 50b775120..000000000--- a/UI/Web/src/app/on-deck/on-deck.component.ts+++ /dev/null@@ -1,133 +0,0 @@-import { Component, EventEmitter, 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 '../metadata-filter/filter-settings';-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();- filterOpen: EventEmitter<boolean> = new EventEmitter();-- 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/reading-list/reading-list-detail/reading-list-detail.component.html b/UI/Web/src/app/reading-list/reading-list-detail/reading-list-detail.component.htmlindex 2e57203aa..682dfe6d4 100644--- a/UI/Web/src/app/reading-list/reading-list-detail/reading-list-detail.component.html+++ b/UI/Web/src/app/reading-list/reading-list-detail/reading-list-detail.component.html@@ -1,4 +1,4 @@-<app-side-nav-companion-bar [showGoBack]="true">+<app-side-nav-companion-bar><h2 title><span *ngIf="actions.length > 0"><app-card-actionables (actionHandler)="performAction($event)" [actions]="actions" [labelBy]="readingList.title"></app-card-actionables>diff --git a/UI/Web/src/app/reading-list/reading-lists/reading-lists.component.html b/UI/Web/src/app/reading-list/reading-lists/reading-lists.component.htmlindex c10d8c95a..b3c62228f 100644--- a/UI/Web/src/app/reading-list/reading-lists/reading-lists.component.html+++ b/UI/Web/src/app/reading-list/reading-lists/reading-lists.component.html@@ -1,4 +1,4 @@-<app-side-nav-companion-bar [showGoBack]="true" pageHeader="Home">+<app-side-nav-companion-bar pageHeader="Home"><h2 title><app-card-actionables [actions]="actions"></app-card-actionables>Reading Listsdiff --git a/UI/Web/src/app/series-detail/series-detail.component.ts b/UI/Web/src/app/series-detail/series-detail.component.tsindex e8be95fb6..5471b9573 100644--- a/UI/Web/src/app/series-detail/series-detail.component.ts+++ b/UI/Web/src/app/series-detail/series-detail.component.ts@@ -498,7 +498,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;}@@ -511,7 +516,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/series-metadata-detail/series-metadata-detail.component.html b/UI/Web/src/app/series-metadata-detail/series-metadata-detail.component.htmlindex 86cda81c2..02a554d44 100644--- a/UI/Web/src/app/series-metadata-detail/series-metadata-detail.component.html+++ b/UI/Web/src/app/series-metadata-detail/series-metadata-detail.component.html@@ -6,8 +6,6 @@<div class="row g-0 mb-2"><app-tag-badge title="Age Rating" *ngIf="seriesMetadata.ageRating" a11y-click="13,32" class="clickable col-auto" (click)="goTo('ageRating', seriesMetadata.ageRating)" [selectionMode]="TagBadgeCursor.Clickable">{{metadataService.getAgeRating(this.seriesMetadata.ageRating) | async}}</app-tag-badge><ng-container *ngIf="series">- <!-- Maybe we can put the library this resides in to make it easier to get back -->- <!-- tooltip here explaining how this is year of first issue --><app-tag-badge *ngIf="seriesMetadata.releaseYear > 0" title="Release date" class="col-auto">{{seriesMetadata.releaseYear}}</app-tag-badge><app-tag-badge *ngIf="seriesMetadata.language !== null && seriesMetadata.language !== ''" title="Language" a11y-click="13,32" class="col-auto" (click)="goTo('languages', seriesMetadata.language)" [selectionMode]="TagBadgeCursor.Clickable">{{seriesMetadata.language}}</app-tag-badge><app-tag-badge title="Publication Status" a11y-click="13,32" class="col-auto" (click)="goTo('publicationStatus', seriesMetadata.publicationStatus)" [selectionMode]="TagBadgeCursor.Clickable">{{seriesMetadata.publicationStatus | publicationStatus}}</app-tag-badge>diff --git a/UI/Web/src/app/shared/_services/utility.service.ts b/UI/Web/src/app/shared/_services/utility.service.tsindex 07ec9d44f..5bb8646f7 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/sidenav/side-nav-companion-bar/side-nav-companion-bar.component.ts b/UI/Web/src/app/sidenav/side-nav-companion-bar/side-nav-companion-bar.component.tsindex 3e03e77ca..fd6f7fb02 100644--- a/UI/Web/src/app/sidenav/side-nav-companion-bar/side-nav-companion-bar.component.ts+++ b/UI/Web/src/app/sidenav/side-nav-companion-bar/side-nav-companion-bar.component.ts@@ -10,11 +10,6 @@ import { Component, ContentChild, EventEmitter, Input, OnInit, Output, TemplateRstyleUrls: ['./side-nav-companion-bar.component.scss']})export class SideNavCompanionBarComponent implements OnInit {-- /**- * Show a dedicated button to go back one history event.- */- @Input() showGoBack: boolean = false;/*** If the page should show a filter*/diff --git a/UI/Web/src/app/sidenav/side-nav/side-nav.component.html b/UI/Web/src/app/sidenav/side-nav/side-nav.component.htmlindex 3da017a47..91f4b99b6 100644--- a/UI/Web/src/app/sidenav/side-nav/side-nav.component.html+++ b/UI/Web/src/app/sidenav/side-nav/side-nav.component.html@@ -1,14 +1,13 @@<ng-container><div class="side-nav" [ngClass]="{'closed' : !(navService?.sideNavCollapsed$ | async), 'hidden' :!(navService?.sideNavVisibility$ | async)}" *ngIf="accountService.currentUser$ | async as user">- <app-side-nav-item icon="fa-user-circle align-self-center phone-hidden" [title]="user.username | sentenceCase" link="/preferences/">+ <!-- <app-side-nav-item icon="fa-user-circle align-self-center phone-hidden" [title]="user.username | sentenceCase" link="/preferences/"><ng-container actions>- <!-- Todo: This will be customize dashboard/side nav controls-->+ Todo: This will be customize dashboard/side nav controls<a href="/preferences/" title="User Settings"><span class="visually-hidden">User Settings</span></a></ng-container>- </app-side-nav-item>+ </app-side-nav-item> -->- <div class="mt-3">- <app-side-nav-item icon="fa-home" title="Home" link="/library/"></app-side-nav-item>+ <app-side-nav-item icon="fa-home" title="Home" link="/library/"></app-side-nav-item><app-side-nav-item icon="fa-list" title="Collections" link="/collections/"></app-side-nav-item><app-side-nav-item icon="fa-list-ol" title="Reading Lists" link="/lists/"></app-side-nav-item><app-side-nav-item icon="fa-regular fa-rectangle-list" title="All Series" link="/all-series/"></app-side-nav-item>@@ -24,8 +23,7 @@<ng-container actions><app-card-actionables [actions]="actions" [labelBy]="library.name" iconClass="fa-ellipsis-v" (actionHandler)="performAction($event, library)"></app-card-actionables></ng-container>- </app-side-nav-item>- </div>+ </app-side-nav-item></div>- <div class="side-nav-overlay" [ngClass]="{'closed' : !(navService?.sideNavCollapsed$ | async)}"></div>+ <div class="side-nav-overlay" (click)="navService?.toggleSideNav()" [ngClass]="{'closed' : !(navService?.sideNavCollapsed$ | async)}"></div></ng-container>\ No newline at end of filediff --git a/UI/Web/src/app/sidenav/side-nav/side-nav.component.scss b/UI/Web/src/app/sidenav/side-nav/side-nav.component.scssindex c5dc0ac7f..7bcee8f08 100644--- a/UI/Web/src/app/sidenav/side-nav/side-nav.component.scss+++ b/UI/Web/src/app/sidenav/side-nav/side-nav.component.scss@@ -1,5 +1,5 @@.side-nav {- padding: 10px 0;+ padding-bottom: 10px;width: 190px;background-color: var(--side-nav-bg-color);height: calc(100vh - 85px);@@ -24,12 +24,17 @@background-color: var(--side-nav-closed-bg-color);border: var(--side-nav-border-closed);}++ .side-nav-item:first() {+ border-top-left-radius: var(--side-nav-border-radius);+ border-top-right-radius: var(--side-nav-border-radius);+ }}@media (max-width: 576px) {.side-nav {padding: 10px 0;- width: 90vw;+ width: 55vw;background-color: var(--side-nav-mobile-bg-color);height: calc(100vh - 56px);position: fixed;@@ -46,6 +51,11 @@overflow: hidden;box-shadow: none;}++ .side-nav-item:first() {+ border-top-left-radius: var(--side-nav-border-radius);+ border-top-right-radius: var(--side-nav-border-radius);+ }}.side-nav-overlay {diff --git a/UI/Web/src/app/sidenav/side-nav/side-nav.component.ts b/UI/Web/src/app/sidenav/side-nav/side-nav.component.tsindex 42bdf2584..5ce818d87 100644--- a/UI/Web/src/app/sidenav/side-nav/side-nav.component.ts+++ b/UI/Web/src/app/sidenav/side-nav/side-nav.component.ts@@ -1,6 +1,8 @@-import { Component, OnInit } from '@angular/core';+import { Component, OnDestroy, OnInit } from '@angular/core';import { Router } from '@angular/router';-import { take } from 'rxjs/operators';+import { Observable, Subject } from 'rxjs';+import { take, takeUntil, takeWhile } from 'rxjs/operators';+import { EVENTS, MessageHubService } from 'src/app/_services/message-hub.service';import { UtilityService } from '../../shared/_services/utility.service';import { Library } from '../../_models/library';import { User } from '../../_models/user';@@ -15,7 +17,7 @@ import { NavService } from '../../_services/nav.service';templateUrl: './side-nav.component.html',styleUrls: ['./side-nav.component.scss']})-export class SideNavComponent implements OnInit {+export class SideNavComponent implements OnInit, OnDestroy {user: User | undefined;libraries: Library[] = [];@@ -27,9 +29,11 @@ export class SideNavComponent implements OnInit {return library.name.toLowerCase().indexOf((this.filterQuery || '').toLowerCase()) >= 0;}+ private onDestory: Subject<void> = new Subject();+constructor(public accountService: AccountService, private libraryService: LibraryService,- public utilityService: UtilityService, private router: Router,+ public utilityService: UtilityService, private messageHub: MessageHubService,private actionFactoryService: ActionFactoryService, private actionService: ActionService, public navService: NavService) { }ngOnInit(): void {@@ -44,9 +48,20 @@ export class SideNavComponent implements OnInit {this.actions = this.actionFactoryService.getLibraryActions(this.handleAction.bind(this));});+ this.messageHub.messages$.pipe(takeUntil(this.onDestory), takeWhile(event => event.event === EVENTS.LibraryModified)).subscribe(event => {+ this.libraryService.getLibrariesForMember().pipe(take(1)).subscribe((libraries: Library[]) => {+ this.libraries = libraries;+ });+ });+}+ ngOnDestroy(): void {+ this.onDestory.next();+ this.onDestory.complete();+ }+handleAction(action: Action, library: Library) {switch (action) {case(Action.ScanLibrary):diff --git a/UI/Web/src/app/typeahead/typeahead.component.html b/UI/Web/src/app/typeahead/typeahead.component.htmlindex c49d5e099..3a6164e99 100644--- a/UI/Web/src/app/typeahead/typeahead.component.html+++ b/UI/Web/src/app/typeahead/typeahead.component.html@@ -15,8 +15,8 @@<div class="spinner-border spinner-border-sm {{settings.multiple ? 'close-offset' : ''}}" role="status" *ngIf="isLoadingOptions"><span class="visually-hidden">Loading...</span></div>- <ng-container *ngIf="settings.multiple">- <button class="btn btn-close float-end mt-2" style="font-size: 0.8rem;" (click)="clearSelections($event)"></button>+ <ng-container *ngIf="settings.multiple && (selectedData | async) as selected">+ <button class="btn btn-close float-end mt-2" *ngIf="selected.length > 0" style="font-size: 0.8rem;" (click)="clearSelections($event)"></button></ng-container></div></div>diff --git a/UI/Web/src/app/typeahead/typeahead.component.scss b/UI/Web/src/app/typeahead/typeahead.component.scssindex e9a1ce65d..dbd61f1f2 100644--- a/UI/Web/src/app/typeahead/typeahead.component.scss+++ b/UI/Web/src/app/typeahead/typeahead.component.scss@@ -106,4 +106,16 @@ input {margin: auto;cursor: pointer;top: 30%;+}++.results {+ .list-group-item {+ cursor: pointer;+ border-left-color: var(--list-group-hover-text-color);+ border-right-color: var(--list-group-hover-text-color);+ }++ .list-group-item:last-child {+ border-bottom-color: var(--list-group-hover-text-color);+ }}\ No newline at end of filediff --git a/UI/Web/src/app/typeahead/typeahead.component.ts b/UI/Web/src/app/typeahead/typeahead.component.tsindex 321958d9e..3f7c152cb 100644--- a/UI/Web/src/app/typeahead/typeahead.component.ts+++ b/UI/Web/src/app/typeahead/typeahead.component.ts@@ -5,8 +5,6 @@ import { debounceTime, filter, map, shareReplay, switchMap, take, takeUntil, tapimport { KEY_CODES } from '../shared/_services/utility.service';import { SelectionCompareFn, TypeaheadSettings } from './typeahead-settings';-//export type SelectionCompareFn<T> = (a: T, b: T) => boolean;-/*** SelectionModel<T> is used for keeping track of multiple selections. Simple interface with ability to toggle.* @param selectedState Optional state to set selectedOptions to. If not passed, defaults to false.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 0a6bb51e6..c2e9c940b 100644--- a/UI/Web/src/app/user-settings/user-settings.module.ts+++ b/UI/Web/src/app/user-settings/user-settings.module.ts@@ -36,7 +36,8 @@ import { ColorPickerModule } from 'ngx-color-picker';ColorPickerModule, // User prefernces background color],exports: [- SiteThemeProviderPipe+ SiteThemeProviderPipe,+ ApiKeyComponent]})export class UserSettingsModule { }