mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-06 14:55:19 -04:00
Scan Loop Last Write Time Change (#1492)
* Refactored invite user flow to separate error handling on create user flow and email flow. This should help users that have unique situations. * Switch to using files to check LastWriteTime. Debug code in for Robbie to test on rclone * Updated Parser namespace. Changed the LastWriteTime to check all files and folders.
This commit is contained in:
@@ -44,7 +44,7 @@ public class GenreRepository : IGenreRepository
|
||||
|
||||
public async Task<Genre> FindByNameAsync(string genreName)
|
||||
{
|
||||
var normalizedName = Parser.Parser.Normalize(genreName);
|
||||
var normalizedName = Services.Tasks.Scanner.Parser.Parser.Normalize(genreName);
|
||||
return await _context.Genre
|
||||
.FirstOrDefaultAsync(g => g.NormalizedTitle.Equals(normalizedName));
|
||||
}
|
||||
|
||||
@@ -334,13 +334,13 @@ public class LibraryRepository : ILibraryRepository
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DoAnySeriesFoldersMatch(IEnumerable<string> folders)
|
||||
{
|
||||
var normalized = folders.Select(Parser.Parser.NormalizePath);
|
||||
var normalized = folders.Select(Services.Tasks.Scanner.Parser.Parser.NormalizePath);
|
||||
return await _context.Series.AnyAsync(s => normalized.Contains(s.FolderPath));
|
||||
}
|
||||
|
||||
public Library? GetLibraryByFolder(string folder)
|
||||
{
|
||||
var normalized = Parser.Parser.NormalizePath(folder);
|
||||
var normalized = Services.Tasks.Scanner.Parser.Parser.NormalizePath(folder);
|
||||
return _context.Library
|
||||
.Include(l => l.Folders)
|
||||
.AsSplitQuery()
|
||||
|
||||
@@ -42,7 +42,7 @@ public class PersonRepository : IPersonRepository
|
||||
|
||||
public async Task<Person> FindByNameAsync(string name)
|
||||
{
|
||||
var normalizedName = Parser.Parser.Normalize(name);
|
||||
var normalizedName = Services.Tasks.Scanner.Parser.Parser.Normalize(name);
|
||||
return await _context.Person
|
||||
.Where(p => normalizedName.Equals(p.NormalizedName))
|
||||
.SingleOrDefaultAsync();
|
||||
|
||||
@@ -301,7 +301,7 @@ public class SeriesRepository : ISeriesRepository
|
||||
{
|
||||
const int maxRecords = 15;
|
||||
var result = new SearchResultGroupDto();
|
||||
var searchQueryNormalized = Parser.Parser.Normalize(searchQuery);
|
||||
var searchQueryNormalized = Services.Tasks.Scanner.Parser.Parser.Normalize(searchQuery);
|
||||
|
||||
var seriesIds = _context.Series
|
||||
.Where(s => libraryIds.Contains(s.LibraryId))
|
||||
@@ -1151,7 +1151,7 @@ public class SeriesRepository : ISeriesRepository
|
||||
/// <returns></returns>
|
||||
public async Task<int> GetSeriesIdByFolder(string folder)
|
||||
{
|
||||
var normalized = Parser.Parser.NormalizePath(folder);
|
||||
var normalized = Services.Tasks.Scanner.Parser.Parser.NormalizePath(folder);
|
||||
var series = await _context.Series
|
||||
.Where(s => s.FolderPath.Equals(normalized))
|
||||
.SingleOrDefaultAsync();
|
||||
@@ -1165,7 +1165,7 @@ public class SeriesRepository : ISeriesRepository
|
||||
/// <returns></returns>
|
||||
public async Task<Series> GetSeriesByFolderPath(string folder)
|
||||
{
|
||||
var normalized = Parser.Parser.NormalizePath(folder);
|
||||
var normalized = Services.Tasks.Scanner.Parser.Parser.NormalizePath(folder);
|
||||
return await _context.Series.SingleOrDefaultAsync(s => s.FolderPath.Equals(normalized));
|
||||
}
|
||||
|
||||
@@ -1178,7 +1178,7 @@ public class SeriesRepository : ISeriesRepository
|
||||
/// <returns></returns>
|
||||
public Task<Series> GetFullSeriesByName(string series, int libraryId)
|
||||
{
|
||||
var localizedSeries = Parser.Parser.Normalize(series);
|
||||
var localizedSeries = Services.Tasks.Scanner.Parser.Parser.Normalize(series);
|
||||
return _context.Series
|
||||
.Where(s => (s.NormalizedName.Equals(localizedSeries)
|
||||
|| s.LocalizedName.Equals(series)) && s.LibraryId == libraryId)
|
||||
@@ -1221,8 +1221,8 @@ public class SeriesRepository : ISeriesRepository
|
||||
/// <returns></returns>
|
||||
public Task<Series> GetFullSeriesByAnyName(string seriesName, string localizedName, int libraryId, MangaFormat format, bool withFullIncludes = true)
|
||||
{
|
||||
var normalizedSeries = Parser.Parser.Normalize(seriesName);
|
||||
var normalizedLocalized = Parser.Parser.Normalize(localizedName);
|
||||
var normalizedSeries = Services.Tasks.Scanner.Parser.Parser.Normalize(seriesName);
|
||||
var normalizedLocalized = Services.Tasks.Scanner.Parser.Parser.Normalize(localizedName);
|
||||
var query = _context.Series
|
||||
.Where(s => s.LibraryId == libraryId)
|
||||
.Where(s => s.Format == format && format != MangaFormat.Unknown)
|
||||
|
||||
@@ -43,7 +43,7 @@ public class TagRepository : ITagRepository
|
||||
|
||||
public async Task<Tag> FindByNameAsync(string tagName)
|
||||
{
|
||||
var normalizedName = Parser.Parser.Normalize(tagName);
|
||||
var normalizedName = Services.Tasks.Scanner.Parser.Parser.Normalize(tagName);
|
||||
return await _context.Tag
|
||||
.FirstOrDefaultAsync(g => g.NormalizedTitle.Equals(normalizedName));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user