diff --git a/Tranga/Connectors/MangaDex.cs b/Tranga/Connectors/MangaDex.cs index a2477cc..625f34b 100644 --- a/Tranga/Connectors/MangaDex.cs +++ b/Tranga/Connectors/MangaDex.cs @@ -180,9 +180,7 @@ public class MangaDex : Connector foreach (JsonNode? image in imageFileNames) imageUrls.Add($"{baseUrl}/data/{hash}/{image!.GetValue()}"); - string seriesFolder = string.Concat(publication.sortName.Split(Path.GetInvalidPathChars())); - - DownloadChapter(imageUrls.ToArray(), Path.Join(downloadLocation, seriesFolder, chapter.relativeFilePath)); + DownloadChapter(imageUrls.ToArray(), Path.Join(downloadLocation, publication.folderName, chapter.fileName)); } protected override void DownloadImage(string url, string path) diff --git a/Tranga/Publication.cs b/Tranga/Publication.cs index 36c30bb..ef0ec8f 100644 --- a/Tranga/Publication.cs +++ b/Tranga/Publication.cs @@ -11,7 +11,7 @@ public struct Publication public int? year { get; } public string? originalLanguage { get; } public string status { get; } - + public string folderName { get; } public Connector connector { get; } public string downloadUrl { get; } @@ -28,5 +28,6 @@ public struct Publication this.status = status; this.connector = connector; this.downloadUrl = downloadUrl; + this.folderName = string.Concat(sortName.Split(Path.GetInvalidPathChars())); } } \ No newline at end of file