Post Release Shakeout (Hotfix Testing) (#1200)
* Fixed an issue where when falling back to folder parsing, sometimes the folder name wouldn't parse well, like "Foo 50" which parses as "Foo". Now the fallback will check if we have a solid series parsed from filename before we attempt to parse a folder. * Ensure SortName is set during a scan loop even if locked and it's empty string. * Added some null checks for metadata update * Fixed a bug where Updating a series name with a name of an existing series wouldn't properly check for existing series. * Tweaked the logic of OnDeck to consider LastChapterCreated from all chapters in a series, not just those with progress. * Fixed a bug where the hamburger menu was still visible on login/registration page despite not functioning * Tweaked the logic of OnDeck to consider LastChapterCreated from all chapters in a series, not just those with progress. * Removed 2 unused packages from ui * Fixed some bugs around determining what the current installed version is in Announcements * Use AnyAsync for a query to improve performance * Fixed up some fallback code * Tests are finally fixed
This commit is contained in:
parent
f10bc710ce
commit
428516b224
18 changed files with 179 additions and 85 deletions
|
@ -145,13 +145,20 @@ namespace API.Controllers
|
|||
|
||||
if (series == null) return BadRequest("Series does not exist");
|
||||
|
||||
if (series.Name != updateSeries.Name && await _unitOfWork.SeriesRepository.DoesSeriesNameExistInLibrary(updateSeries.Name, series.Format))
|
||||
var seriesExists =
|
||||
await _unitOfWork.SeriesRepository.DoesSeriesNameExistInLibrary(updateSeries.Name.Trim(), series.LibraryId,
|
||||
series.Format);
|
||||
if (series.Name != updateSeries.Name && seriesExists)
|
||||
{
|
||||
return BadRequest("A series already exists in this library with this name. Series Names must be unique to a library.");
|
||||
}
|
||||
|
||||
series.Name = updateSeries.Name.Trim();
|
||||
series.SortName = updateSeries.SortName.Trim();
|
||||
if (!string.IsNullOrEmpty(updateSeries.SortName.Trim()))
|
||||
{
|
||||
series.SortName = updateSeries.SortName.Trim();
|
||||
}
|
||||
|
||||
series.LocalizedName = updateSeries.LocalizedName.Trim();
|
||||
|
||||
series.NameLocked = updateSeries.NameLocked;
|
||||
|
|
|
@ -47,7 +47,7 @@ public interface ISeriesRepository
|
|||
void Update(Series series);
|
||||
void Remove(Series series);
|
||||
void Remove(IEnumerable<Series> series);
|
||||
Task<bool> DoesSeriesNameExistInLibrary(string name, MangaFormat format);
|
||||
Task<bool> DoesSeriesNameExistInLibrary(string name, int libraryId, MangaFormat format);
|
||||
/// <summary>
|
||||
/// Adds user information like progress, ratings, etc
|
||||
/// </summary>
|
||||
|
@ -135,17 +135,12 @@ public class SeriesRepository : ISeriesRepository
|
|||
/// <param name="name">Name of series</param>
|
||||
/// <param name="format">Format of series</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DoesSeriesNameExistInLibrary(string name, MangaFormat format)
|
||||
public async Task<bool> DoesSeriesNameExistInLibrary(string name, int libraryId, MangaFormat format)
|
||||
{
|
||||
var libraries = _context.Series
|
||||
.AsNoTracking()
|
||||
.Where(x => x.Name.Equals(name) && x.Format == format)
|
||||
.Select(s => s.LibraryId);
|
||||
|
||||
return await _context.Series
|
||||
.AsNoTracking()
|
||||
.Where(s => libraries.Contains(s.LibraryId) && s.Name.Equals(name) && s.Format == format)
|
||||
.CountAsync() > 1;
|
||||
.Where(s => s.LibraryId == libraryId && s.Name.Equals(name) && s.Format == format)
|
||||
.AnyAsync();
|
||||
}
|
||||
|
||||
|
||||
|
@ -624,13 +619,13 @@ public class SeriesRepository : ISeriesRepository
|
|||
LastReadingProgress = _context.AppUserProgresses
|
||||
.Where(p => p.Id == progress.Id && p.AppUserId == userId)
|
||||
.Max(p => p.LastModified),
|
||||
// BUG: This is only taking into account chapters that have progress on them, not all chapters in said series
|
||||
LastChapterCreated = _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)
|
||||
// This is only taking into account chapters that have progress on them, not all chapters in said series
|
||||
//LastChapterCreated = _context.Chapter.Where(c => progress.ChapterId == c.Id).Max(c => c.Created),
|
||||
LastChapterCreated = s.Volumes.SelectMany(v => v.Chapters).Max(c => c.Created)
|
||||
});
|
||||
if (cutoffOnDate)
|
||||
{
|
||||
query = query.Where(d => d.LastReadingProgress >= cutoffProgressPoint);
|
||||
query = query.Where(d => d.LastReadingProgress >= cutoffProgressPoint || d.LastChapterCreated >= cutoffProgressPoint);
|
||||
}
|
||||
|
||||
// I think I need another Join statement. The problem is the chapters are still limited to progress
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace API.Entities.Metadata
|
|||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Summary { get; set; }
|
||||
public string Summary { get; set; } = string.Empty;
|
||||
|
||||
public ICollection<CollectionTag> CollectionTags { get; set; }
|
||||
|
||||
|
|
|
@ -142,18 +142,22 @@ public class DefaultParser
|
|||
}
|
||||
}
|
||||
|
||||
var series = Parser.ParseSeries(folder);
|
||||
|
||||
if ((string.IsNullOrEmpty(series) && i == fallbackFolders.Count - 1))
|
||||
// Generally users group in series folders. Let's try to parse series from the top folder
|
||||
if (!folder.Equals(ret.Series) && i == fallbackFolders.Count - 1)
|
||||
{
|
||||
ret.Series = Parser.CleanTitle(folder, type is LibraryType.Comic);
|
||||
break;
|
||||
}
|
||||
var series = Parser.ParseSeries(folder);
|
||||
|
||||
if (!string.IsNullOrEmpty(series))
|
||||
{
|
||||
ret.Series = series;
|
||||
break;
|
||||
if (string.IsNullOrEmpty(series))
|
||||
{
|
||||
ret.Series = Parser.CleanTitle(folder, type is LibraryType.Comic);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(series) && (string.IsNullOrEmpty(ret.Series) || !folder.Contains(ret.Series)))
|
||||
{
|
||||
ret.Series = series;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,6 +67,17 @@ public class SeriesService : ISeriesService
|
|||
series.Metadata.PublicationStatusLocked = true;
|
||||
}
|
||||
|
||||
// This shouldn't be needed post v0.5.3 release
|
||||
if (string.IsNullOrEmpty(series.Metadata.Summary))
|
||||
{
|
||||
series.Metadata.Summary = string.Empty;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(updateSeriesMetadataDto.SeriesMetadata.Summary))
|
||||
{
|
||||
updateSeriesMetadataDto.SeriesMetadata.Summary = string.Empty;
|
||||
}
|
||||
|
||||
if (series.Metadata.Summary != updateSeriesMetadataDto.SeriesMetadata.Summary.Trim())
|
||||
{
|
||||
series.Metadata.Summary = updateSeriesMetadataDto.SeriesMetadata?.Summary.Trim();
|
||||
|
|
|
@ -523,13 +523,17 @@ public class ScannerService : IScannerService
|
|||
series.Format = parsedInfos[0].Format;
|
||||
}
|
||||
series.OriginalName ??= parsedInfos[0].Series;
|
||||
if (string.IsNullOrEmpty(series.SortName))
|
||||
{
|
||||
series.SortName = series.Name;
|
||||
}
|
||||
if (!series.SortNameLocked)
|
||||
{
|
||||
series.SortName = series.Name;
|
||||
if (!string.IsNullOrEmpty(parsedInfos[0].SeriesSort))
|
||||
{
|
||||
series.SortName = parsedInfos[0].SeriesSort;
|
||||
}
|
||||
series.SortName = series.Name;
|
||||
}
|
||||
|
||||
await _eventHub.SendMessageAsync(MessageFactory.NotificationProgress, MessageFactory.LibraryScanProgressEvent(library.Name, ProgressEventType.Ended, series.Name));
|
||||
|
|
|
@ -92,12 +92,7 @@ public class VersionUpdaterService : IVersionUpdaterService
|
|||
{
|
||||
if (update == null || string.IsNullOrEmpty(update.Tag_Name)) return null;
|
||||
var updateVersion = new Version(update.Tag_Name.Replace("v", string.Empty));
|
||||
var currentVersion = BuildInfo.Version.ToString();
|
||||
|
||||
if (updateVersion.Revision == -1)
|
||||
{
|
||||
currentVersion = currentVersion.Substring(0, currentVersion.LastIndexOf(".", StringComparison.Ordinal));
|
||||
}
|
||||
var currentVersion = BuildInfo.Version.ToString(4);
|
||||
|
||||
return new UpdateNotificationDto()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue