From d0540d78f0e5da18bc5f7f1f280ba7a20051d47d Mon Sep 17 00:00:00 2001 From: Alessandro De Angelis Date: Sun, 8 Mar 2020 18:47:46 +0100 Subject: [PATCH] Updated mangadex --- .github/workflows/go.yml | 32 -------------------------------- go.mod | 2 +- go.sum | 8 ++++---- internal/version/version.go | 2 +- pkg/sites/mangadex.go | 5 +++-- pkg/sites/mangadex_test.go | 8 ++++---- 6 files changed, 13 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index a3b387a6..00000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Go -on: [push, pull_request] -jobs: - - build: - name: Build - runs-on: ubuntu-latest - steps: - - - name: Requirements setup - run: | - sudo apt-get install -y -q --no-install-recommends \ - libgl1-mesa-dev \ - xorg-dev \ - gosu - - - name: Set up Go 1.13 - uses: actions/setup-go@v1 - with: - go-version: 1.13 - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v1 - - - name: Get dependencies - run: | - go get -v -t -d ./... - - - name: Run test - run: | - go test -v ./... diff --git a/go.mod b/go.mod index 03da8daf..cad39def 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 95560390..cc66a218 100644 --- a/go.sum +++ b/go.sum @@ -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= @@ -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= @@ -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= diff --git a/internal/version/version.go b/internal/version/version.go index c530d18d..c2516e95 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -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" diff --git a/pkg/sites/mangadex.go b/pkg/sites/mangadex.go index 164cdde3..8a37501b 100644 --- a/pkg/sites/mangadex.go +++ b/pkg/sites/mangadex.go @@ -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, @@ -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 "", "" } diff --git a/pkg/sites/mangadex_test.go b/pkg/sites/mangadex_test.go index 872b8cba..689bcd3b 100644 --- a/pkg/sites/mangadex_test.go +++ b/pkg/sites/mangadex_test.go @@ -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) } @@ -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) @@ -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) {