mirror of
https://github.com/C9Glax/tranga.git
synced 2025-10-11 05:09:49 +02:00
Chapter filename is set only when download happens
Some checks failed
Docker Image CI / build (push) Has been cancelled
Some checks failed
Docker Image CI / build (push) Has been cancelled
https://github.com/C9Glax/tranga/issues/466
This commit is contained in:
@@ -22,7 +22,7 @@ public class Chapter : Identifiable, IComparable<Chapter>
|
||||
|
||||
[StringLength(256)] public string? Title { get; private set; }
|
||||
|
||||
[StringLength(256)] public string FileName { get; private set; }
|
||||
[StringLength(256)] public string? FileName { get; private set; }
|
||||
|
||||
public bool Downloaded { get; internal set; }
|
||||
|
||||
@@ -43,7 +43,6 @@ public class Chapter : Identifiable, IComparable<Chapter>
|
||||
this.MangaConnectorIds = [];
|
||||
this.VolumeNumber = volumeNumber;
|
||||
this.Title = title;
|
||||
this.FileName = GetArchiveFilePath().CleanNameForWindows();
|
||||
this.Downloaded = false;
|
||||
this.MangaConnectorIds = [];
|
||||
}
|
||||
@@ -51,7 +50,7 @@ public class Chapter : Identifiable, IComparable<Chapter>
|
||||
/// <summary>
|
||||
/// EF ONLY!!!
|
||||
/// </summary>
|
||||
internal Chapter(string key, int? volumeNumber, string chapterNumber, string? title, string fileName, bool downloaded)
|
||||
internal Chapter(string key, int? volumeNumber, string chapterNumber, string? title, string? fileName, bool downloaded)
|
||||
: base(key)
|
||||
{
|
||||
this.VolumeNumber = volumeNumber;
|
||||
@@ -91,6 +90,8 @@ public class Chapter : Identifiable, IComparable<Chapter>
|
||||
|
||||
if (chapter.ParentManga.Library is null)
|
||||
return false;
|
||||
if (chapter.FileName is null)
|
||||
return false;
|
||||
|
||||
this.Downloaded = File.Exists(chapter.FullArchiveFilePath);
|
||||
await context.Sync(token??CancellationToken.None, GetType(), $"CheckDownloaded {this} {this.Downloaded}");
|
||||
@@ -169,7 +170,7 @@ public class Chapter : Identifiable, IComparable<Chapter>
|
||||
{
|
||||
try
|
||||
{
|
||||
return Path.Join(ParentManga.FullDirectoryPath, FileName);
|
||||
return Path.Join(ParentManga.FullDirectoryPath, this.FileName is null ? GetArchiveFilePath() : FileName);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
Reference in New Issue
Block a user