Updated scanner and table names.
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
using JSMR.Application.Enums;
|
||||
using JSMR.Application.Scanning;
|
||||
using JSMR.Application.Scanning.Ports;
|
||||
using JSMR.Domain.Enums;
|
||||
using JSMR.Infrastructure.Common.Time;
|
||||
using JSMR.Worker.Options;
|
||||
using JSMR.Worker.UI;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Spectre.Console;
|
||||
using System.Globalization;
|
||||
|
||||
namespace JSMR.Worker.Services;
|
||||
@@ -39,7 +42,17 @@ public sealed class PagedScanRunner(
|
||||
using var scope = serviceProvider.CreateScope();
|
||||
ScanVoiceWorksHandler handler = scope.ServiceProvider.GetRequiredService<ScanVoiceWorksHandler>();
|
||||
|
||||
log.LogInformation("Scanning page {Page} (size {Size}, locale {Locale})…", currentPage, pageSize, locale);
|
||||
//log.LogInformation("Scanning page {Page} (size {Size}, locale {Locale})…", currentPage, pageSize, locale);
|
||||
CliUi.PageHeader(currentPage, end);
|
||||
|
||||
//AnsiConsole.Status()
|
||||
//.Start($"[grey]Scanning page[/] [bold]{currentPage}[/] [grey]of[/] [bold]{end}[/][grey]...[/]", ctx =>
|
||||
//{
|
||||
// // Simulate grinding
|
||||
// Thread.Sleep(3000);
|
||||
//});
|
||||
|
||||
//AnsiConsole.MarkupLine($"[green]✓ Scanning page[/] [bold]{currentPage}[/] [grey]of[/] [bold]{end}[/][grey]... DONE[/]");
|
||||
|
||||
ScanVoiceWorksRequest request = new(
|
||||
PageNumber: currentPage,
|
||||
@@ -49,18 +62,21 @@ public sealed class PagedScanRunner(
|
||||
|
||||
ScanVoiceWorksResponse response = await handler.HandleAsync(request, cancellationToken);
|
||||
|
||||
//int newUpcoming = response.Results.Where(x => x.IsNewUpcoming == true).Count();
|
||||
int newUpcoming = response.Results.Count(x => x.UpdateStatus == VoiceWorkStatus.NewAndUpcoming);
|
||||
|
||||
//if (newUpcoming > 0)
|
||||
// updatedInfo.Add($"{newUpcoming} new upcoming work(s)");
|
||||
// AnsiConsole.MarkupLine($" - {newUpcoming} new upcoming work(s)");
|
||||
|
||||
//int newOnSale = result.ScannedVoiceWorks.Where(x => x.IsNewOnSale == true).Count();
|
||||
int newRelease = response.Results.Count(x => x.UpdateStatus == VoiceWorkStatus.NewRelease);
|
||||
|
||||
//if (newOnSale > 0)
|
||||
// updatedInfo.Add($"{newOnSale} new work(s) on sale");
|
||||
//if (newRelease > 0)
|
||||
// updatedInfo.Add($"{newRelease} new work(s) on sale");
|
||||
|
||||
CliUi.PageHighlights(newUpcoming, newRelease);
|
||||
|
||||
IEnumerable<VoiceWorkUpsertResult> resultsWithIssues = response.Results.Where(x => x.Issues.Count > 0);
|
||||
|
||||
// TODO: Later
|
||||
//foreach (VoiceWorkUpsertResult resultWithIssues in resultsWithIssues)
|
||||
//{
|
||||
// log.LogWarning($"PRoblem with {resultWithIssues.}")
|
||||
|
||||
Reference in New Issue
Block a user