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)
chapterVolNumStr = $"Vol.{volumeNumber} Ch.{chapterNumber}";
else
chapterVolNumStr = $"Ch.{chapterNumber}";
if(volumeNumber is not null && volumeNumber.Length > 0) if (name is not null && name.Length > 0)
chapterNameStrings.Add($"Vol.{volumeNumber}"); {
chapterNameStrings.Add($"Ch.{chapterNumber}"); string chapterName = IllegalStrings.Replace(string.Concat(LegalCharacters.Matches(name)), "");
if(name is not null && name.Length > 0) //chapterName this.fileName = $"{chapterVolNumStr} - {chapterName}";
chapterNameStrings.Add(IllegalStrings.Replace(string.Concat(LegalCharacters.Matches(name)), "")); }
this.fileName = string.Join(' ', chapterNameStrings); else
this.fileName = chapterVolNumStr;
} }
public override string ToString() public override string ToString()