From d7cf18c4eb950ab51c40babaaedb79b958798576 Mon Sep 17 00:00:00 2001 From: Rohit Vardam <46842159+varoOP@users.noreply.github.com> Date: Wed, 20 Sep 2023 01:21:14 -0700 Subject: [PATCH] feat: add tmdb mapping support * feat: add tmdb map support * feat: add ci --- .github/workflows/release.yml | 102 +++++++++ .gitignore | 3 +- .goreleaser.yaml | 55 +++++ cmd/shinkrodb/main.go | 31 ++- for-shinkro.json | 357 +++++++++++++++++++------------ go.mod | 1 + go.sum | 2 + internal/domain/tmdb.go | 45 ++-- malid-anidbid-tvdbid-tmdbid.json | 59 ++++- malid-anidbid-tvdbid.json | 59 ++++- malid-anidbid.json | 57 ++++- malid.json | 54 ++++- 12 files changed, 643 insertions(+), 182 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..472e4e8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,102 @@ +name: build + +on: + push: + branches: + - "main" + tags: + - "v*" + pull_request: + +permissions: + contents: write + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # 1.20 is the last version to support Windows < 10, Server < 2016, and MacOS < 1.15. + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.20.7" + cache: true + + - name: Test + run: go test -v ./... + + goreleaserbuild: + name: Build Go binaries + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + needs: test + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # 1.20 is the last version to support Windows < 10, Server < 2016, and MacOS < 1.15. + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.20.7" + cache: true + + - name: Run GoReleaser build + uses: goreleaser/goreleaser-action@v4 + with: + distribution: goreleaser + version: latest + args: release --clean --skip-validate --skip-publish --parallelism 99 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload assets + uses: actions/upload-artifact@v3 + with: + name: shinkrodb + path: | + dist/*.tar.gz + dist/*.zip + + goreleaser: + name: Build and publish binaries + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + needs: test + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # 1.20 is the last version to support Windows < 10, Server < 2016, and MacOS < 1.15. + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.20.7" + cache: true + + - name: Run GoReleaser build and publish tags + uses: goreleaser/goreleaser-action@v4 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload assets + uses: actions/upload-artifact@v3 + with: + name: shinkrodb + path: | + dist/*.tar.gz + dist/*.zip diff --git a/.gitignore b/.gitignore index 7151ac8..ed04c2d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *secrets.json -*mal_cache \ No newline at end of file +*mal_cache +*dist* \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..58ae26d --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,55 @@ +project_name: shinkrodb +before: + hooks: + - go mod tidy + +builds: + - main: ./cmd/shinkrodb/ + binary: shinkrodb + env: + - CGO_ENABLED=0 + goos: + - linux + goarch: + - amd64 + - arm + - arm64 + goarm: + - "6" + ignore: + - goos: freebsd + goarch: arm + - goos: freebsd + goarch: arm64 + +archives: + - name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" + +checksum: + name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt" + +snapshot: + name_template: "{{ incpatch .Version }}-next" + +changelog: + sort: asc + use: github + filters: + exclude: + - Merge pull request + - Merge remote-tracking branch + - Merge branch + groups: + - title: "New Features" + regexp: "^.*feat[(\\w)]*:+.*$" + order: 0 + - title: "Bug fixes" + regexp: "^.*fix[(\\w)]*:+.*$" + order: 10 + - title: Other work + order: 999 + +release: + prerelease: auto + footer: | + **Full Changelog**: https://github.com/varoOP/shinkrodb/compare/{{ .PreviousTag }}...{{ .Tag }} diff --git a/cmd/shinkrodb/main.go b/cmd/shinkrodb/main.go index af49e83..0de5057 100644 --- a/cmd/shinkrodb/main.go +++ b/cmd/shinkrodb/main.go @@ -1,16 +1,35 @@ package main import ( + "fmt" + "path" + + "github.com/spf13/pflag" "github.com/varoOP/shinkrodb/internal/config" "github.com/varoOP/shinkrodb/internal/domain" ) func main() { cfg := config.NewConfig() - //domain.GetMalIds(cfg) - //domain.ScrapeMal() - //domain.GetTvdbIDs() - domain.GetTmdbIds(cfg) - // a := domain.GetAnime("./malid-anidbid-tvdbid-tmdbid.json") - // fmt.Println("Total number of dupes:", domain.CheckDupes(a)) + var rootPath string + pflag.StringVar(&rootPath, "rootPath", ".", "the path where output is saved") + pflag.Parse() + + switch cmd := pflag.Arg(0); cmd { + case "run": + domain.GetMalIds(cfg) + domain.ScrapeMal() + domain.GetTvdbIDs() + domain.GetTmdbIds(cfg, rootPath) + a := domain.GetAnime("./malid-anidbid-tvdbid-tmdbid.json") + fmt.Println("Total number of dupes:", domain.CheckDupes(a)) + + case "genmap": + am := &domain.AnimeMovies{} + am.Get(path.Join(rootPath, "tmdb-mal-master.yaml")) + domain.CreateMapping(am, path.Join(rootPath, "tmdb-mal.yaml")) + + default: + fmt.Println("ERROR: no command specified") + } } diff --git a/for-shinkro.json b/for-shinkro.json index 9bac3c1..bedd02b 100644 --- a/for-shinkro.json +++ b/for-shinkro.json @@ -60037,7 +60037,7 @@ "releaseDate": "2000-07-20" }, { - "title": "Suki tte Ii na yo. Mei and Marshmallow", + "title": "Suki tte Ii na yo.: Mei and Marshmallow", "enTitle": "Say \"I Love You\".: Mei and Marshmallow Meow", "malid": 17409, "anidbid": 9236, @@ -76142,7 +76142,7 @@ "malid": 28789, "anidbid": 11395, "type": "music", - "releaseDate": "2014-12-08" + "releaseDate": "2014-11-28" }, { "title": "Gunslinger Stratos The Animation", @@ -84192,6 +84192,7 @@ "enTitle": "Pokémon the Series: XYZ", "malid": 31592, "anidbid": 11585, + "tvdbid": 76703, "type": "tv", "releaseDate": "2015-10-29" }, @@ -92864,6 +92865,7 @@ "enTitle": "Pokémon the Series: Sun \u0026 Moon", "malid": 34034, "anidbid": 12407, + "tvdbid": 76703, "type": "tv", "releaseDate": "2016-11-17" }, @@ -153239,7 +153241,7 @@ }, { "title": "Yoru ni Kakeru", - "enTitle": "Racing Into The Night", + "enTitle": "Racing into the Night", "malid": 48653, "type": "music", "releaseDate": "2019-11-16" @@ -180439,6 +180441,7 @@ }, { "title": "Naze Boku no Sekai wo Daremo Oboeteinai no ka?", + "enTitle": "Why nobody remembers my world?", "malid": 56062, "anidbid": 18133, "type": "tv", @@ -180928,7 +180931,7 @@ "releaseDate": "2024-01" }, { - "title": "Jujutsu Kaisen 2nd Season Recap", + "title": "Jujutsu Kaisen 2nd Season Recaps", "malid": 56243, "type": "special", "releaseDate": "2023-08-11" @@ -181434,7 +181437,8 @@ "releaseDate": "2022-06-29" }, { - "title": "Kkomimanyeo Lala", + "title": "Kkomimanyeo Lara", + "enTitle": "Komi Witch Lara", "malid": 56358, "type": "tv", "releaseDate": "2023-03-13" @@ -181949,6 +181953,13 @@ "type": "ova", "releaseDate": "" }, + { + "title": "Secret Mission: Sennyuu Sousakan wa Zettai ni Makenai!", + "malid": 56497, + "anidbid": 18168, + "type": "ona", + "releaseDate": "2023-10-02" + }, { "title": "Obetomo Gakuen", "malid": 56498, @@ -182752,207 +182763,279 @@ "releaseDate": "1983-08-04" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, + "title": "Angry Boogie", + "malid": 56683, "type": "music", - "releaseDate": "1983-08-04" + "releaseDate": "1982-08-02" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, + "title": "Ninja wa Doko ja", + "malid": 56684, "type": "music", - "releaseDate": "1983-08-04" + "releaseDate": "1985-12-02" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, + "title": "Dare mo Isoganai Mura", + "malid": 56688, "type": "music", - "releaseDate": "1983-08-04" + "releaseDate": "1978-04-07" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, + "title": "Dr. Puppukupuu", + "malid": 56689, "type": "music", - "releaseDate": "1983-08-04" + "releaseDate": "1999-08-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Re:Monster", + "malid": 56690, + "anidbid": 18201, + "type": "tv", + "releaseDate": "" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" }, { - "title": "Uma no Shippo Buta no Shippo", - "malid": 56679, - "type": "music", - "releaseDate": "1983-08-04" + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" + }, + { + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" + }, + { + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" + }, + { + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" + }, + { + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" + }, + { + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" + }, + { + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" } ] \ No newline at end of file diff --git a/go.mod b/go.mod index 763ff0c..df5a685 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.20 require ( github.com/gocolly/colly v1.2.0 + github.com/spf13/pflag v1.0.5 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index 2094b71..c71644b 100644 --- a/go.sum +++ b/go.sum @@ -30,6 +30,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d h1:hrujxIzL1woJ7AwssoOcM/tq5JjjG2yYOc8odClEiXA= github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/internal/domain/tmdb.go b/internal/domain/tmdb.go index e8edc9f..32dcda8 100644 --- a/internal/domain/tmdb.go +++ b/internal/domain/tmdb.go @@ -3,12 +3,14 @@ package domain import ( "encoding/json" "encoding/xml" + "errors" "fmt" "io" "log" "net/http" "net/url" "os" + "path" "regexp" "strings" @@ -59,7 +61,7 @@ type TMDBAPIResponse struct { TotalResults int `json:"total_results"` } -func GetTmdbIds(cfg *Config) { +func GetTmdbIds(cfg *Config, rootPath string) { a := GetAnime("./malid-anidbid-tvdbid.json") u := buildUrl(cfg.TmdbApiKey) am := &AnimeMovies{} @@ -124,9 +126,8 @@ func GetTmdbIds(cfg *Config) { log.Println("Total number of movies", totalMovies) log.Println("Total number of movies with TMDBID", withTmdbTotal) log.Println("Total number of movies without TMDBID", noTmdbTotal) - am.Store("./tmdb-mal-unmapped.yaml") - amm := UpdateMaster(&AnimeMovies{}, am) - CreateMapping(amm) + am.Store(path.Join(rootPath, "tmdb-mal-unmapped.yaml")) + UpdateMaster(&AnimeMovies{}, am, path.Join(rootPath, "tmdb-mal-master.yaml")) } func buildUrl(apikey string) *url.URL { @@ -183,10 +184,10 @@ func (am *AnimeMovies) Store(path string) { } } -func (am *AnimeMovies) Get(path string) { +func (am *AnimeMovies) Get(path string) error { f, err := os.Open(path) if err != nil { - checkErr(err) + return errors.New("file does not exist") } defer f.Close() @@ -199,26 +200,34 @@ func (am *AnimeMovies) Get(path string) { if err != nil { checkErr(err) } + + return err } -func UpdateMaster(am1 *AnimeMovies, am2 *AnimeMovies) *AnimeMovies { - master := "./tmdb-mal-master.yaml" - am1.Get(master) +func UpdateMaster(am1 *AnimeMovies, am2 *AnimeMovies, path string) { + err := am1.Get(path) + if err.Error() == "file does not exist" { + am2.Store(path) + return + } + + malidToTmdbid := make(map[int]int) for i := range am1.AnimeMovie { if am1.AnimeMovie[i].TMDBID != 0 { - for ii := range am2.AnimeMovie { - if am1.AnimeMovie[i].MALID == am2.AnimeMovie[ii].MALID { - am2.AnimeMovie[ii].TMDBID = am1.AnimeMovie[i].TMDBID - } - } + malidToTmdbid[am1.AnimeMovie[i].MALID] = am1.AnimeMovie[i].TMDBID + } + } + + for ii := range am2.AnimeMovie { + if tmdbid, found := malidToTmdbid[am2.AnimeMovie[ii].MALID]; found { + am2.AnimeMovie[ii].TMDBID = tmdbid } } - am2.Store(master) - return am2 + am2.Store(path) } -func CreateMapping(am *AnimeMovies) { +func CreateMapping(am *AnimeMovies, path string) { amf := &AnimeMovies{} for _, movie := range am.AnimeMovie { if movie.TMDBID != 0 { @@ -226,5 +235,5 @@ func CreateMapping(am *AnimeMovies) { } } - amf.Store("./tmdb-mal.yaml") + amf.Store(path) } diff --git a/malid-anidbid-tvdbid-tmdbid.json b/malid-anidbid-tvdbid-tmdbid.json index 582f910..1e95fd9 100644 --- a/malid-anidbid-tvdbid-tmdbid.json +++ b/malid-anidbid-tvdbid-tmdbid.json @@ -60123,7 +60123,7 @@ "releaseDate": "2000-07-20" }, { - "title": "Suki tte Ii na yo. Mei and Marshmallow", + "title": "Suki tte Ii na yo.: Mei and Marshmallow", "enTitle": "Say \"I Love You\".: Mei and Marshmallow Meow", "malid": 17409, "anidbid": 9236, @@ -76253,7 +76253,7 @@ "malid": 28789, "anidbid": 11395, "type": "music", - "releaseDate": "2014-12-08" + "releaseDate": "2014-11-28" }, { "title": "Gunslinger Stratos The Animation", @@ -84321,6 +84321,7 @@ "enTitle": "Pokémon the Series: XYZ", "malid": 31592, "anidbid": 11585, + "tvdbid": 76703, "type": "tv", "releaseDate": "2015-10-29" }, @@ -93007,6 +93008,7 @@ "enTitle": "Pokémon the Series: Sun \u0026 Moon", "malid": 34034, "anidbid": 12407, + "tvdbid": 76703, "type": "tv", "releaseDate": "2016-11-17" }, @@ -153509,7 +153511,7 @@ }, { "title": "Yoru ni Kakeru", - "enTitle": "Racing Into The Night", + "enTitle": "Racing into the Night", "malid": 48653, "type": "music", "releaseDate": "2019-11-16" @@ -180723,6 +180725,7 @@ }, { "title": "Naze Boku no Sekai wo Daremo Oboeteinai no ka?", + "enTitle": "Why nobody remembers my world?", "malid": 56062, "anidbid": 18133, "type": "tv", @@ -181212,7 +181215,7 @@ "releaseDate": "2024-01" }, { - "title": "Jujutsu Kaisen 2nd Season Recap", + "title": "Jujutsu Kaisen 2nd Season Recaps", "malid": 56243, "type": "special", "releaseDate": "2023-08-11" @@ -181718,7 +181721,8 @@ "releaseDate": "2022-06-29" }, { - "title": "Kkomimanyeo Lala", + "title": "Kkomimanyeo Lara", + "enTitle": "Komi Witch Lara", "malid": 56358, "type": "tv", "releaseDate": "2023-03-13" @@ -182233,6 +182237,13 @@ "type": "ova", "releaseDate": "" }, + { + "title": "Secret Mission: Sennyuu Sousakan wa Zettai ni Makenai!", + "malid": 56497, + "anidbid": 18168, + "type": "ona", + "releaseDate": "2023-10-02" + }, { "title": "Obetomo Gakuen", "malid": 56498, @@ -183034,5 +183045,43 @@ "malid": 56679, "type": "music", "releaseDate": "1983-08-04" + }, + { + "title": "Angry Boogie", + "malid": 56683, + "type": "music", + "releaseDate": "1982-08-02" + }, + { + "title": "Ninja wa Doko ja", + "malid": 56684, + "type": "music", + "releaseDate": "1985-12-02" + }, + { + "title": "Dare mo Isoganai Mura", + "malid": 56688, + "type": "music", + "releaseDate": "1978-04-07" + }, + { + "title": "Dr. Puppukupuu", + "malid": 56689, + "type": "music", + "releaseDate": "1999-08-01" + }, + { + "title": "Re:Monster", + "malid": 56690, + "anidbid": 18201, + "type": "tv", + "releaseDate": "" + }, + { + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" } ] \ No newline at end of file diff --git a/malid-anidbid-tvdbid.json b/malid-anidbid-tvdbid.json index 4d0fa6c..c0023ca 100644 --- a/malid-anidbid-tvdbid.json +++ b/malid-anidbid-tvdbid.json @@ -59086,7 +59086,7 @@ "releaseDate": "2000-07-20" }, { - "title": "Suki tte Ii na yo. Mei and Marshmallow", + "title": "Suki tte Ii na yo.: Mei and Marshmallow", "enTitle": "Say \"I Love You\".: Mei and Marshmallow Meow", "malid": 17409, "anidbid": 9236, @@ -75001,7 +75001,7 @@ "malid": 28789, "anidbid": 11395, "type": "music", - "releaseDate": "2014-12-08" + "releaseDate": "2014-11-28" }, { "title": "Gunslinger Stratos The Animation", @@ -82873,6 +82873,7 @@ "enTitle": "Pokémon the Series: XYZ", "malid": 31592, "anidbid": 11585, + "tvdbid": 76703, "type": "tv", "releaseDate": "2015-10-29" }, @@ -91439,6 +91440,7 @@ "enTitle": "Pokémon the Series: Sun \u0026 Moon", "malid": 34034, "anidbid": 12407, + "tvdbid": 76703, "type": "tv", "releaseDate": "2016-11-17" }, @@ -151330,7 +151332,7 @@ }, { "title": "Yoru ni Kakeru", - "enTitle": "Racing Into The Night", + "enTitle": "Racing into the Night", "malid": 48653, "type": "music", "releaseDate": "2019-11-16" @@ -178241,6 +178243,7 @@ }, { "title": "Naze Boku no Sekai wo Daremo Oboeteinai no ka?", + "enTitle": "Why nobody remembers my world?", "malid": 56062, "anidbid": 18133, "type": "tv", @@ -178729,7 +178732,7 @@ "releaseDate": "2024-01" }, { - "title": "Jujutsu Kaisen 2nd Season Recap", + "title": "Jujutsu Kaisen 2nd Season Recaps", "malid": 56243, "type": "special", "releaseDate": "2023-08-11" @@ -179225,7 +179228,8 @@ "releaseDate": "2022-06-29" }, { - "title": "Kkomimanyeo Lala", + "title": "Kkomimanyeo Lara", + "enTitle": "Komi Witch Lara", "malid": 56358, "type": "tv", "releaseDate": "2023-03-13" @@ -179736,6 +179740,13 @@ "type": "ova", "releaseDate": "" }, + { + "title": "Secret Mission: Sennyuu Sousakan wa Zettai ni Makenai!", + "malid": 56497, + "anidbid": 18168, + "type": "ona", + "releaseDate": "2023-10-02" + }, { "title": "Obetomo Gakuen", "malid": 56498, @@ -180531,5 +180542,43 @@ "malid": 56679, "type": "music", "releaseDate": "1983-08-04" + }, + { + "title": "Angry Boogie", + "malid": 56683, + "type": "music", + "releaseDate": "1982-08-02" + }, + { + "title": "Ninja wa Doko ja", + "malid": 56684, + "type": "music", + "releaseDate": "1985-12-02" + }, + { + "title": "Dare mo Isoganai Mura", + "malid": 56688, + "type": "music", + "releaseDate": "1978-04-07" + }, + { + "title": "Dr. Puppukupuu", + "malid": 56689, + "type": "music", + "releaseDate": "1999-08-01" + }, + { + "title": "Re:Monster", + "malid": 56690, + "anidbid": 18201, + "type": "tv", + "releaseDate": "" + }, + { + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" } ] \ No newline at end of file diff --git a/malid-anidbid.json b/malid-anidbid.json index 46c964d..cfb4935 100644 --- a/malid-anidbid.json +++ b/malid-anidbid.json @@ -57058,7 +57058,7 @@ "releaseDate": "2000-07-20" }, { - "title": "Suki tte Ii na yo. Mei and Marshmallow", + "title": "Suki tte Ii na yo.: Mei and Marshmallow", "enTitle": "Say \"I Love You\".: Mei and Marshmallow Meow", "malid": 17409, "anidbid": 9236, @@ -72641,7 +72641,7 @@ "malid": 28789, "anidbid": 11395, "type": "music", - "releaseDate": "2014-12-08" + "releaseDate": "2014-11-28" }, { "title": "Gunslinger Stratos The Animation", @@ -147720,7 +147720,7 @@ }, { "title": "Yoru ni Kakeru", - "enTitle": "Racing Into The Night", + "enTitle": "Racing into the Night", "malid": 48653, "type": "music", "releaseDate": "2019-11-16" @@ -174314,6 +174314,7 @@ }, { "title": "Naze Boku no Sekai wo Daremo Oboeteinai no ka?", + "enTitle": "Why nobody remembers my world?", "malid": 56062, "anidbid": 18133, "type": "tv", @@ -174802,7 +174803,7 @@ "releaseDate": "2024-01" }, { - "title": "Jujutsu Kaisen 2nd Season Recap", + "title": "Jujutsu Kaisen 2nd Season Recaps", "malid": 56243, "type": "special", "releaseDate": "2023-08-11" @@ -175298,7 +175299,8 @@ "releaseDate": "2022-06-29" }, { - "title": "Kkomimanyeo Lala", + "title": "Kkomimanyeo Lara", + "enTitle": "Komi Witch Lara", "malid": 56358, "type": "tv", "releaseDate": "2023-03-13" @@ -175809,6 +175811,13 @@ "type": "ova", "releaseDate": "" }, + { + "title": "Secret Mission: Sennyuu Sousakan wa Zettai ni Makenai!", + "malid": 56497, + "anidbid": 18168, + "type": "ona", + "releaseDate": "2023-10-02" + }, { "title": "Obetomo Gakuen", "malid": 56498, @@ -176604,5 +176613,43 @@ "malid": 56679, "type": "music", "releaseDate": "1983-08-04" + }, + { + "title": "Angry Boogie", + "malid": 56683, + "type": "music", + "releaseDate": "1982-08-02" + }, + { + "title": "Ninja wa Doko ja", + "malid": 56684, + "type": "music", + "releaseDate": "1985-12-02" + }, + { + "title": "Dare mo Isoganai Mura", + "malid": 56688, + "type": "music", + "releaseDate": "1978-04-07" + }, + { + "title": "Dr. Puppukupuu", + "malid": 56689, + "type": "music", + "releaseDate": "1999-08-01" + }, + { + "title": "Re:Monster", + "malid": 56690, + "anidbid": 18201, + "type": "tv", + "releaseDate": "" + }, + { + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "anidbid": 18202, + "type": "tv", + "releaseDate": "2024-01" } ] \ No newline at end of file diff --git a/malid.json b/malid.json index c059b45..970223f 100644 --- a/malid.json +++ b/malid.json @@ -49844,7 +49844,7 @@ "releaseDate": "2000-07-20" }, { - "title": "Suki tte Ii na yo. Mei and Marshmallow", + "title": "Suki tte Ii na yo.: Mei and Marshmallow", "enTitle": "Say \"I Love You\".: Mei and Marshmallow Meow", "malid": 17409, "type": "special", @@ -63774,7 +63774,7 @@ "enTitle": "March comes in like a lion meets Bump of Chicken", "malid": 28789, "type": "music", - "releaseDate": "2014-12-08" + "releaseDate": "2014-11-28" }, { "title": "Gunslinger Stratos The Animation", @@ -134580,7 +134580,7 @@ }, { "title": "Yoru ni Kakeru", - "enTitle": "Racing Into The Night", + "enTitle": "Racing into the Night", "malid": 48653, "type": "music", "releaseDate": "2019-11-16" @@ -160018,6 +160018,7 @@ }, { "title": "Naze Boku no Sekai wo Daremo Oboeteinai no ka?", + "enTitle": "Why nobody remembers my world?", "malid": 56062, "type": "tv", "releaseDate": "2024" @@ -160484,7 +160485,7 @@ "releaseDate": "2024-01" }, { - "title": "Jujutsu Kaisen 2nd Season Recap", + "title": "Jujutsu Kaisen 2nd Season Recaps", "malid": 56243, "type": "special", "releaseDate": "2023-08-11" @@ -160978,7 +160979,8 @@ "releaseDate": "2022-06-29" }, { - "title": "Kkomimanyeo Lala", + "title": "Kkomimanyeo Lara", + "enTitle": "Komi Witch Lara", "malid": 56358, "type": "tv", "releaseDate": "2023-03-13" @@ -161482,6 +161484,12 @@ "type": "ova", "releaseDate": "" }, + { + "title": "Secret Mission: Sennyuu Sousakan wa Zettai ni Makenai!", + "malid": 56497, + "type": "ona", + "releaseDate": "2023-10-02" + }, { "title": "Obetomo Gakuen", "malid": 56498, @@ -162265,5 +162273,41 @@ "malid": 56679, "type": "music", "releaseDate": "1983-08-04" + }, + { + "title": "Angry Boogie", + "malid": 56683, + "type": "music", + "releaseDate": "1982-08-02" + }, + { + "title": "Ninja wa Doko ja", + "malid": 56684, + "type": "music", + "releaseDate": "1985-12-02" + }, + { + "title": "Dare mo Isoganai Mura", + "malid": 56688, + "type": "music", + "releaseDate": "1978-04-07" + }, + { + "title": "Dr. Puppukupuu", + "malid": 56689, + "type": "music", + "releaseDate": "1999-08-01" + }, + { + "title": "Re:Monster", + "malid": 56690, + "type": "tv", + "releaseDate": "" + }, + { + "title": "Gekkan Mousou Kagaku", + "malid": 56691, + "type": "tv", + "releaseDate": "2024-01" } ] \ No newline at end of file