Compare commits
No commits in common. "cfaec3a4fda29953311ce1ca726693a4eea2dddf" and "b36bc9b0b2a40208a7fffb65dd57f39567003f01" have entirely different histories.
cfaec3a4fd
...
b36bc9b0b2
1 changed files with 5 additions and 18 deletions
23
main.go
23
main.go
|
@ -369,12 +369,6 @@ func DownloadAndProcessEpub(jnovel jnc.Api, serie jnc.SerieAugmented, volume jnc
|
|||
|
||||
zipPath := basePath + "Chapter " + chap.chDisplay + ".cbz"
|
||||
|
||||
if _, err = os.Stat(zipPath); err != nil {
|
||||
err := os.Remove(zipPath)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
newZipFile, err := os.Create(zipPath)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
@ -427,7 +421,7 @@ func DownloadAndProcessEpub(jnovel jnc.Api, serie jnc.SerieAugmented, volume jnc
|
|||
}
|
||||
}
|
||||
|
||||
comicInfo, err := GenerateChapterMetadata(volume, serie, len(chap.pages), language, chap.chDisplay)
|
||||
comicInfo, err := GenerateChapterMetadata(volume, serie, len(chap.pages), language)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
@ -440,8 +434,8 @@ func DownloadAndProcessEpub(jnovel jnc.Api, serie jnc.SerieAugmented, volume jnc
|
|||
epub.Close()
|
||||
newZip.Close()
|
||||
newZipFile.Close()
|
||||
os.Remove(file)
|
||||
}
|
||||
os.Remove(file)
|
||||
}
|
||||
case "novel":
|
||||
{
|
||||
|
@ -542,7 +536,7 @@ func DownloadAndProcessEpub(jnovel jnc.Api, serie jnc.SerieAugmented, volume jnc
|
|||
}
|
||||
}
|
||||
|
||||
func GenerateChapterMetadata(volume jnc.VolumeAugmented, serie jnc.SerieAugmented, pageCount int, language string, chapterNumber string) ([]byte, error) {
|
||||
func GenerateChapterMetadata(volume jnc.VolumeAugmented, serie jnc.SerieAugmented, pageCount int, language string) ([]byte, error) {
|
||||
comicInfo := ComicInfo{
|
||||
XMLName: "ComicInfo",
|
||||
XMLNS: "http://www.w3.org/2001/XMLSchema-instance",
|
||||
|
@ -553,9 +547,7 @@ func GenerateChapterMetadata(volume jnc.VolumeAugmented, serie jnc.SerieAugmente
|
|||
sInfo := serie.Info
|
||||
|
||||
comicInfo.Series = sInfo.Title
|
||||
comicInfo.Title = vInfo.Title
|
||||
comicInfo.Number = chapterNumber
|
||||
comicInfo.Volume = vInfo.Number
|
||||
comicInfo.Number = vInfo.Number
|
||||
|
||||
comicInfo.Count = -1 // TODO somehow fetch actual completion status
|
||||
|
||||
|
@ -603,9 +595,7 @@ type ComicInfo struct {
|
|||
XMLNS string `xml:"xmlns,attr"`
|
||||
XSI string `xml:"xsi,attr"`
|
||||
Series string `xml:"Series"`
|
||||
Title string `xml:"Title"`
|
||||
Volume int `xml:"Volume"`
|
||||
Number string `xml:"Number"`
|
||||
Number int `xml:"Number"`
|
||||
Count int `xml:"Count"`
|
||||
Summary string `xml:"Summary"`
|
||||
Year int `xml:"Year"`
|
||||
|
@ -828,9 +818,6 @@ func GenerateMangaChapterList(navigation FileWrapper) *list.List {
|
|||
r, _ := regexp.Compile(regex)
|
||||
num := r.FindStringSubmatch(label)[1]
|
||||
parse, _ := strconv.ParseInt(num, 10, 8)
|
||||
if parse == 0 {
|
||||
fmt.Printf("Unlikely Chapter Number Detected (0): %s/n", label)
|
||||
}
|
||||
lastMainChapter = int8(parse)
|
||||
subChapter = int8(0)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue