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:
parent
521b2adc14
commit
85790dd71c
59 changed files with 283 additions and 264 deletions
|
@ -22,7 +22,7 @@ public static class GenreHelper
|
|||
{
|
||||
if (string.IsNullOrEmpty(name.Trim())) continue;
|
||||
|
||||
var normalizedName = Parser.Parser.Normalize(name);
|
||||
var normalizedName = Services.Tasks.Scanner.Parser.Parser.Normalize(name);
|
||||
var genre = allGenres.FirstOrDefault(p =>
|
||||
p.NormalizedTitle.Equals(normalizedName) && p.ExternalTag == isExternal);
|
||||
if (genre == null)
|
||||
|
@ -57,7 +57,7 @@ public static class GenreHelper
|
|||
public static void AddGenreIfNotExists(ICollection<Genre> metadataGenres, Genre genre)
|
||||
{
|
||||
var existingGenre = metadataGenres.FirstOrDefault(p =>
|
||||
p.NormalizedTitle == Parser.Parser.Normalize(genre.Title));
|
||||
p.NormalizedTitle == Services.Tasks.Scanner.Parser.Parser.Normalize(genre.Title));
|
||||
if (existingGenre == null)
|
||||
{
|
||||
metadataGenres.Add(genre);
|
||||
|
@ -67,7 +67,7 @@ public static class GenreHelper
|
|||
public static void AddGenreIfNotExists(BlockingCollection<Genre> metadataGenres, Genre genre)
|
||||
{
|
||||
var existingGenre = metadataGenres.FirstOrDefault(p =>
|
||||
p.NormalizedTitle == Parser.Parser.Normalize(genre.Title));
|
||||
p.NormalizedTitle == Services.Tasks.Scanner.Parser.Parser.Normalize(genre.Title));
|
||||
if (existingGenre == null)
|
||||
{
|
||||
metadataGenres.Add(genre);
|
||||
|
|
|
@ -22,14 +22,14 @@ public static class ParserInfoHelpers
|
|||
foreach (var pSeries in parsedSeries.Keys)
|
||||
{
|
||||
var name = pSeries.Name;
|
||||
var normalizedName = Parser.Parser.Normalize(name);
|
||||
var normalizedName = Services.Tasks.Scanner.Parser.Parser.Normalize(name);
|
||||
|
||||
//if (series.NameInParserInfo(pSeries.))
|
||||
if (normalizedName == series.NormalizedName ||
|
||||
normalizedName == Parser.Parser.Normalize(series.Name) ||
|
||||
normalizedName == Services.Tasks.Scanner.Parser.Parser.Normalize(series.Name) ||
|
||||
name == series.Name || name == series.LocalizedName ||
|
||||
name == series.OriginalName ||
|
||||
normalizedName == Parser.Parser.Normalize(series.OriginalName))
|
||||
normalizedName == Services.Tasks.Scanner.Parser.Parser.Normalize(series.OriginalName))
|
||||
{
|
||||
format = pSeries.Format;
|
||||
if (format == series.Format)
|
||||
|
|
|
@ -26,7 +26,7 @@ public static class PersonHelper
|
|||
|
||||
foreach (var name in names)
|
||||
{
|
||||
var normalizedName = Parser.Parser.Normalize(name);
|
||||
var normalizedName = Services.Tasks.Scanner.Parser.Parser.Normalize(name);
|
||||
var person = allPeopleTypeRole.FirstOrDefault(p =>
|
||||
p.NormalizedName.Equals(normalizedName));
|
||||
if (person == null)
|
||||
|
@ -49,7 +49,7 @@ public static class PersonHelper
|
|||
/// <param name="action">Callback which will be executed for each person removed</param>
|
||||
public static void RemovePeople(ICollection<Person> existingPeople, IEnumerable<string> people, PersonRole role, Action<Person> action = null)
|
||||
{
|
||||
var normalizedPeople = people.Select(Parser.Parser.Normalize).ToList();
|
||||
var normalizedPeople = people.Select(Services.Tasks.Scanner.Parser.Parser.Normalize).ToList();
|
||||
if (normalizedPeople.Count == 0)
|
||||
{
|
||||
var peopleToRemove = existingPeople.Where(p => p.Role == role).ToList();
|
||||
|
@ -99,7 +99,7 @@ public static class PersonHelper
|
|||
public static void AddPersonIfNotExists(ICollection<Person> metadataPeople, Person person)
|
||||
{
|
||||
var existingPerson = metadataPeople.SingleOrDefault(p =>
|
||||
p.NormalizedName == Parser.Parser.Normalize(person.Name) && p.Role == person.Role);
|
||||
p.NormalizedName == Services.Tasks.Scanner.Parser.Parser.Normalize(person.Name) && p.Role == person.Role);
|
||||
if (existingPerson == null)
|
||||
{
|
||||
metadataPeople.Add(person);
|
||||
|
@ -114,7 +114,7 @@ public static class PersonHelper
|
|||
public static void AddPersonIfNotExists(BlockingCollection<Person> metadataPeople, Person person)
|
||||
{
|
||||
var existingPerson = metadataPeople.SingleOrDefault(p =>
|
||||
p.NormalizedName == Parser.Parser.Normalize(person.Name) && p.Role == person.Role);
|
||||
p.NormalizedName == Services.Tasks.Scanner.Parser.Parser.Normalize(person.Name) && p.Role == person.Role);
|
||||
if (existingPerson == null)
|
||||
{
|
||||
metadataPeople.Add(person);
|
||||
|
|
|
@ -17,8 +17,8 @@ public static class SeriesHelper
|
|||
public static bool FindSeries(Series series, ParsedSeries parsedInfoKey)
|
||||
{
|
||||
return (series.NormalizedName.Equals(parsedInfoKey.NormalizedName) ||
|
||||
Parser.Parser.Normalize(series.LocalizedName).Equals(parsedInfoKey.NormalizedName) ||
|
||||
Parser.Parser.Normalize(series.OriginalName).Equals(parsedInfoKey.NormalizedName))
|
||||
Services.Tasks.Scanner.Parser.Parser.Normalize(series.LocalizedName).Equals(parsedInfoKey.NormalizedName) ||
|
||||
Services.Tasks.Scanner.Parser.Parser.Normalize(series.OriginalName).Equals(parsedInfoKey.NormalizedName))
|
||||
&& (series.Format == parsedInfoKey.Format || series.Format == MangaFormat.Unknown);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ public static class TagHelper
|
|||
if (string.IsNullOrEmpty(name.Trim())) continue;
|
||||
|
||||
var added = false;
|
||||
var normalizedName = Parser.Parser.Normalize(name);
|
||||
var normalizedName = Services.Tasks.Scanner.Parser.Parser.Normalize(name);
|
||||
|
||||
var genre = allTags.FirstOrDefault(p =>
|
||||
p.NormalizedTitle.Equals(normalizedName) && p.ExternalTag == isExternal);
|
||||
|
@ -59,7 +59,7 @@ public static class TagHelper
|
|||
public static void AddTagIfNotExists(ICollection<Tag> metadataTags, Tag tag)
|
||||
{
|
||||
var existingGenre = metadataTags.FirstOrDefault(p =>
|
||||
p.NormalizedTitle == Parser.Parser.Normalize(tag.Title));
|
||||
p.NormalizedTitle == Services.Tasks.Scanner.Parser.Parser.Normalize(tag.Title));
|
||||
if (existingGenre == null)
|
||||
{
|
||||
metadataTags.Add(tag);
|
||||
|
@ -69,7 +69,7 @@ public static class TagHelper
|
|||
public static void AddTagIfNotExists(BlockingCollection<Tag> metadataTags, Tag tag)
|
||||
{
|
||||
var existingGenre = metadataTags.FirstOrDefault(p =>
|
||||
p.NormalizedTitle == Parser.Parser.Normalize(tag.Title));
|
||||
p.NormalizedTitle == Services.Tasks.Scanner.Parser.Parser.Normalize(tag.Title));
|
||||
if (existingGenre == null)
|
||||
{
|
||||
metadataTags.Add(tag);
|
||||
|
@ -86,7 +86,7 @@ public static class TagHelper
|
|||
/// <param name="action">Callback which will be executed for each tag removed</param>
|
||||
public static void RemoveTags(ICollection<Tag> existingTags, IEnumerable<string> tags, bool isExternal, Action<Tag> action = null)
|
||||
{
|
||||
var normalizedTags = tags.Select(Parser.Parser.Normalize).ToList();
|
||||
var normalizedTags = tags.Select(Services.Tasks.Scanner.Parser.Parser.Normalize).ToList();
|
||||
foreach (var person in normalizedTags)
|
||||
{
|
||||
var existingTag = existingTags.FirstOrDefault(p => p.ExternalTag == isExternal && person.Equals(p.NormalizedTitle));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue