Skip to content

Commit

Permalink
Updated mangadex
Browse files Browse the repository at this point in the history
  • Loading branch information
Girbons committed Mar 8, 2020
1 parent 6bb50b2 commit d0540d7
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 44 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/go.yml

This file was deleted.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.14
require (
fyne.io/fyne v1.2.3
github.com/anaskhan96/soup v1.1.1
github.com/bake/mangadex v0.0.0-20200305194006-6360cbcb29d0
github.com/bake/mangadex v0.0.0-20200308152818-cb733691b670
github.com/bmaupin/go-epub v0.5.3
github.com/dsnet/compress v0.0.1 // indirect
github.com/golang/snappy v0.0.1 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkK
github.com/anaskhan96/soup v1.1.1 h1:Duux/0htS2Va7XLJ9qIakCSey790hg9OFRm2FwlMTy0=
github.com/anaskhan96/soup v1.1.1/go.mod h1:pT5vs4HXDwA5y4KQCsKvnkpQd3D+joP7IqpiGskfWW0=
github.com/bake/httpcache v0.0.0-20190425194625-775d0adac809/go.mod h1:4NG8FC+Gt0aSRAFe+GcCsKUGCL63u0doQyQBQffWX90=
github.com/bake/mangadex v0.0.0-20200305194006-6360cbcb29d0 h1:VJgynwYS7PJ5wPyakGa++aLQVuyfL6x8ArPXYdO2jP4=
github.com/bake/mangadex v0.0.0-20200305194006-6360cbcb29d0/go.mod h1:0EIa3RFRprO7Ey+7O0TveUY6epgxsabT82R3bkUjkzU=
github.com/bake/mangadex v0.0.0-20200308152818-cb733691b670 h1:XBQFpSv0pkpT6N/p7vF8VbROw/edBejOiMf7cOVrTwg=
github.com/bake/mangadex v0.0.0-20200308152818-cb733691b670/go.mod h1:bUshzroFkkuGzxrjzwMr/8gcBRFWW6OTNy+PYvtG9zw=
github.com/bmaupin/go-epub v0.5.3 h1:HBOJS2KqsRGGcEzM470/9l5q2l9JwAUxQabEgPMrW90=
github.com/bmaupin/go-epub v0.5.3/go.mod h1:4RBr0Zo03mRGOyGAcc25eLOqIPCkMbfz+tINVmH6clQ=
github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
Expand Down Expand Up @@ -36,7 +36,6 @@ github.com/jung-kurt/gofpdf v1.16.2 h1:jgbatWHfRlPYiK85qgevsZTHviWXKwB1TTiKdz5Pt
github.com/jung-kurt/gofpdf v1.16.2/go.mod h1:1hl7y57EsiPAkLbOwzpzqgx1A30nQCk/YmFV8S2vmK0=
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/mholt/archiver v1.1.2 h1:xukR55YIrnhDHp10lrNtRSsAK5THpWrOCuviweNSBw4=
github.com/mholt/archiver v3.1.1+incompatible h1:1dCVxuqs0dJseYEhi5pl7MYPH9zDa1wBi7mF09cbNkU=
Expand All @@ -52,8 +51,9 @@ github.com/pierrec/lz4 v1.0.1 h1:w6GMGWSsCI04fTM8wQRdnW74MuJISakuUU0onU0TYB4=
github.com/pierrec/lz4 v2.4.1+incompatible h1:mFe7ttWaflA46Mhqh+jUfjp2qTbPYxLB2/OyBppH9dg=
github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w=
Expand Down
2 changes: 1 addition & 1 deletion internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ package version

// Tag specifies the current release tag.
// It needs to be manually updated.
const Tag = "v0.21.2"
const Tag = "v0.21.3"
5 changes: 3 additions & 2 deletions pkg/sites/mangadex.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Mangadex struct {

// NewMangadex returns a Mangadex instance
func NewMangadex(country, source string) *Mangadex {
mangadexBase := "https://"+source+"/"
mangadexBase := "https://" + source + "/"
return &Mangadex{
country: country,
baseURL: mangadexBase,
Expand Down Expand Up @@ -84,7 +84,8 @@ func (m *Mangadex) GetInfo(url string) (string, string) {
return "", ""
}

mangaInfo, _, err := m.Client.Manga(string(chapterInfo.MangaID))
mangaID := chapterInfo.MangaID.Number
mangaInfo, _, err := m.Client.Manga(string(mangaID))
if err != nil {
return "", ""
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/sites/mangadex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
)

const testMangadexBase string = "mangadex.org"
const testMangadexURL string = "https://"+testMangadexBase+"/"
const testMangadexURL string = "https://" + testMangadexBase + "/"

func TestMangadexGetInfo(t *testing.T) {
md := NewMangadex("", testMangadexBase)

name, issueNumber := md.GetInfo(testMangadexURL+"chapter/155061/1")
name, issueNumber := md.GetInfo(testMangadexURL + "chapter/155061/1")
assert.Equal(t, "Naruto", name)
assert.Equal(t, "Vol 60 Chapter 575, A Will of Stone", issueNumber)
}
Expand All @@ -22,7 +22,7 @@ func TestMangadexSetup(t *testing.T) {
md := NewMangadex("", testMangadexBase)
comic := new(core.Comic)

comic.URLSource = testMangadexURL+"chapter/155061/1"
comic.URLSource = testMangadexURL + "chapter/155061/1"

err := md.Initialize(comic)

Expand Down Expand Up @@ -64,7 +64,7 @@ func TestMangadexNoManga(t *testing.T) {
md := NewMangadex("", testMangadexBase)
_, err := md.RetrieveIssueLinks(testMangadexURL+"title/0/", false, false)
assert.Error(t, err)
assert.Contains(t, err.Error(), "Manga ID does not exist")
assert.Contains(t, err.Error(), "could not get manga 0")
}

func TestMangadexNoChapters(t *testing.T) {
Expand Down

0 comments on commit d0540d7

Please sign in to comment.