2
0

#113 old formatting of fileNames

This commit is contained in:
Glax 2024-02-07 15:34:20 +01:00
parent 2eaeadb92c
commit 5bc414fd59

View File

@ -28,14 +28,19 @@ public readonly struct Chapter : IComparable
this.chapterNumber = chapterNumber; this.chapterNumber = chapterNumber;
this.url = url; this.url = url;
List<string> chapterNameStrings = new(); string chapterVolNumStr;
if (volumeNumber is not null && volumeNumber.Length > 0) if (volumeNumber is not null && volumeNumber.Length > 0)
chapterNameStrings.Add($"Vol.{volumeNumber}"); chapterVolNumStr = $"Vol.{volumeNumber} Ch.{chapterNumber}";
chapterNameStrings.Add($"Ch.{chapterNumber}"); else
if(name is not null && name.Length > 0) //chapterName chapterVolNumStr = $"Ch.{chapterNumber}";
chapterNameStrings.Add(IllegalStrings.Replace(string.Concat(LegalCharacters.Matches(name)), ""));
this.fileName = string.Join(' ', chapterNameStrings); if (name is not null && name.Length > 0)
{
string chapterName = IllegalStrings.Replace(string.Concat(LegalCharacters.Matches(name)), "");
this.fileName = $"{chapterVolNumStr} - {chapterName}";
}
else
this.fileName = chapterVolNumStr;
} }
public override string ToString() public override string ToString()