From 6dd066f82d4180bc19e772194a3d0a79cbd0fbe9 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Sat, 19 Sep 2020 06:55:43 -0500 Subject: [PATCH] =?UTF-8?q?feat(archival):=20=E2=9C=A8=20left=20pad=20arch?= =?UTF-8?q?ive=20filenames=20for=20better=20sorting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FilterLists.Archival.Application/Commands/ArchiveList.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/Archival/FilterLists.Archival.Application/Commands/ArchiveList.cs b/services/Archival/FilterLists.Archival.Application/Commands/ArchiveList.cs index 0b1cb0722..ee5a4a90f 100644 --- a/services/Archival/FilterLists.Archival.Application/Commands/ArchiveList.cs +++ b/services/Archival/FilterLists.Archival.Application/Commands/ArchiveList.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Runtime.CompilerServices; @@ -90,7 +91,7 @@ private IFileToArchive GetFileToArchive( CancellationToken cancellationToken) { var segmentsAsync = GetSegmentsAsync(segmentUrls, cancellationToken); - var target = new FileInfo($"{listId}.txt"); + var target = new FileInfo($"{listId.ToString(CultureInfo.InvariantCulture).PadLeft(5, '0')}.txt"); return new FileToArchive(segmentsAsync, target); } @@ -98,7 +99,7 @@ private async IAsyncEnumerable GetSegmentsAsync( IEnumerable segmentUrls, [EnumeratorCancellation] CancellationToken cancellationToken) { - foreach (var segment in segmentUrls) + foreach (var segment in segmentUrls) { var sourceFileName = Uri.UnescapeDataString(segment.Url.Segments.Last()); var sourceExtension = Path.GetExtension(sourceFileName);