moved fileName to Chapter for future checking if file exists.
This commit is contained in:
parent
57c7f175d9
commit
d191f5dfc7
@ -8,12 +8,15 @@ public struct Chapter
|
|||||||
public string? chapterNumber { get; }
|
public string? chapterNumber { get; }
|
||||||
public string url { get; }
|
public string url { get; }
|
||||||
|
|
||||||
public Chapter(Publication publication, string? name, string? volumeNumber, string? chapterNumber, string url)
|
public string relativeFilePath { get; }
|
||||||
|
|
||||||
|
public Chapter(Publication publication, string? name, string? volumeNumber, string? chapterNumber, string url, string relativeFilePath)
|
||||||
{
|
{
|
||||||
this.publication = publication;
|
this.publication = publication;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.volumeNumber = volumeNumber;
|
this.volumeNumber = volumeNumber;
|
||||||
this.chapterNumber = chapterNumber;
|
this.chapterNumber = chapterNumber;
|
||||||
this.url = url;
|
this.url = url;
|
||||||
|
this.relativeFilePath = relativeFilePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -149,7 +149,10 @@ public class MangaDex : Connector
|
|||||||
? attributes["chapter"]!.GetValue<string>()
|
? attributes["chapter"]!.GetValue<string>()
|
||||||
: null;
|
: 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