mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
feat(archival): ✨ left pad archive filenames for better sorting
This commit is contained in:
parent
f65f7cb359
commit
6dd066f82d
1 changed files with 3 additions and 2 deletions
|
|
@ -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<IFileToArchiveSegment> GetSegmentsAsync(
|
|||
IEnumerable<ListDetailsViewUrlVm> 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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue