moved fileName to Chapter for future checking if file exists.
This commit is contained in:
parent
57c7f175d9
commit
d191f5dfc7
@ -7,13 +7,16 @@ public struct Chapter
|
||||
public string? volumeNumber { get; }
|
||||
public string? chapterNumber { get; }
|
||||
public string url { get; }
|
||||
|
||||
public string relativeFilePath { get; }
|
||||
|
||||
public Chapter(Publication publication, string? name, string? volumeNumber, string? chapterNumber, string url)
|
||||
public Chapter(Publication publication, string? name, string? volumeNumber, string? chapterNumber, string url, string relativeFilePath)
|
||||
{
|
||||
this.publication = publication;
|
||||
this.name = name;
|
||||
this.volumeNumber = volumeNumber;
|
||||
this.chapterNumber = chapterNumber;
|
||||
this.url = url;
|
||||
this.relativeFilePath = relativeFilePath;
|
||||
}
|
||||
}
|
@ -149,7 +149,10 @@ public class MangaDex : Connector
|
||||
? attributes["chapter"]!.GetValue<string>()
|
||||
: null;
|
||||
|
||||
chapters.Add(new Chapter(publication, title, volume, chapterNum, chapterId));
|
||||
string chapterName = string.Concat((title ?? "").Split(Path.GetInvalidFileNameChars()));
|
||||
string relativeFilePath = $"{chapterName} - V{volume}C{chapterNum}";
|
||||
|
||||
chapters.Add(new Chapter(publication, title, volume, chapterNum, chapterId, relativeFilePath));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user