feat: avoid converting already converted chapters

This commit is contained in:
Antoine Aflalo
2024-08-26 23:15:14 -04:00
parent 9631979b94
commit 135db7a1f8
6 changed files with 55 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
package packer
import "time"
type Chapter struct {
// FilePath is the path to the chapter's directory.
FilePath string
@@ -7,4 +9,14 @@ type Chapter struct {
Pages []*Page
// ComicInfo is a string containing information about the chapter.
ComicInfoXml string
// IsConverted is a boolean that indicates whether the chapter has been converted.
IsConverted bool
// ConvertedTime is a pointer to a time.Time object that indicates when the chapter was converted. Nil mean not converted.
ConvertedTime time.Time
}
// SetConverted sets the IsConverted field to true and sets the ConvertedTime field to the current time.
func (chapter *Chapter) SetConverted() {
chapter.IsConverted = true
chapter.ConvertedTime = time.Now()
}