Refactor GenerateGridCommandHandler and GridPlanner for improved slot management and readability
Updated the GenerateGridCommandHandler to streamline slot removal during grid generation by introducing a new RemoveAllSlots method. Enhanced the GridPlanner class by refactoring the FillDay method to utilize a SlotTarget struct for better clarity and organization. These changes improve code maintainability and readability while ensuring efficient slot handling across grid generation processes.
This commit is contained in:
@@ -152,10 +152,13 @@ public sealed class FileSystemMediaStorage(MediaPathResolver paths) : IMediaStor
|
||||
|
||||
private static void DeleteCompanions(string directory, CompanionMatcher companion)
|
||||
{
|
||||
foreach (var file in Directory.EnumerateFiles(directory))
|
||||
var companions = Directory
|
||||
.EnumerateFiles(directory)
|
||||
.Where(file => companion.Matches(Path.GetFileName(file)))
|
||||
.ToList();
|
||||
|
||||
foreach (var file in companions)
|
||||
{
|
||||
if (!companion.Matches(Path.GetFileName(file)))
|
||||
continue;
|
||||
try
|
||||
{
|
||||
File.Delete(file);
|
||||
|
||||
Reference in New Issue
Block a user