Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API is returning non-MU comics #35

Open
geoffrich opened this issue Aug 19, 2023 · 1 comment
Open

API is returning non-MU comics #35

geoffrich opened this issue Aug 19, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@geoffrich
Copy link
Owner

Due to some Marvel API change, non-MU comics (e.g. Conan) are being returning from the API. Trade paperbacks were also coming back (fixed with c7af095).

Comics are also being returned that aren't on MU yet, e.g. comics that were just released that will be on MU in a few months.

I think previously we were relying on hasDigitalIssue to only be set for MU comics, but this no longer seems to be the case. Queries with this set are not only returning non-MU comics that are available digitally, but also comics that aren't available digitally.

https://github.com/geoffrich/marvel-by-year/blob/c7af095ff5bd897cc95449654269bc1f989f6f40/src/lib/api.ts#L144

I'm not sure the best way to fix this.

One thing I noticed is that for many of the affected comics, unlimitedDate and digitalPurchaseDate are identical, which shouldn't be true for many comics (verification TBD, not sure what this looks like for old comics added to MU that weren't previously available digitally).

Example responses

Savage Sword of Conan (not on MU)

{
  "id": 74053,
  "digitalId": 50614,
  "title": "Savage Sword of Conan (2019) #2",
  "issueNumber": 2,
  "variantDescription": "",
  "description": null,
  "modified": "2019-01-10T12:19:12-0500",
  "isbn": "",
  "upc": "75960609265900211",
  "diamondCode": "DEC180823",
  "ean": "",
  "issn": "",
  "format": "Comic",
  "pageCount": 32,
  "textObjects": [],
  "resourceURI": "http://gateway.marvel.com/v1/public/comics/74053",
  "urls": [
    {
      "type": "detail",
      "url": "http://marvel.com/comics/issue/74053/savage_sword_of_conan_2019_2?utm_campaign=apiRef&utm_source=e78f64287735d7304f6dbcf59dae2328"
    },
    {
      "type": "purchase",
      "url": "http://comicstore.marvel.com/Savage-Sword-of-Conan-2/digital-comic/50614?utm_campaign=apiRef&utm_source=e78f64287735d7304f6dbcf59dae2328"
    },
    {
      "type": "reader",
      "url": "http://marvel.com/digitalcomics/view.htm?iid=50614&utm_campaign=apiRef&utm_source=e78f64287735d7304f6dbcf59dae2328"
    },
    {
      "type": "inAppLink",
      "url": "https://applink.marvel.com/issue/50614?utm_campaign=apiRef&utm_source=e78f64287735d7304f6dbcf59dae2328"
    }
  ],
  "series": {
    "resourceURI": "http://gateway.marvel.com/v1/public/series/26686",
    "name": "Savage Sword of Conan (2019)"
  },
  "variants": [],
  "collections": [],
  "collectedIssues": [],
  "dates": [
    {
      "type": "onsaleDate",
      "date": "2019-02-27T00:00:00-0500"
    },
    {
      "type": "focDate",
      "date": "2019-02-04T00:00:00-0500"
    },
    {
      "type": "unlimitedDate",
      "date": "2023-05-03T14:09:00-0400"
    },
    {
      "type": "digitalPurchaseDate",
      "date": "2023-05-03T14:09:00-0400"
    }
  ],
  "prices": [
    {
      "type": "printPrice",
      "price": 3.99
    },
    {
      "type": "digitalPurchasePrice",
      "price": 3.99
    }
  ],
  "thumbnail": {
    "path": "http://i.annihil.us/u/prod/marvel/i/mg/c/10/5c6dd8ffa0221",
    "extension": "jpg"
  },
  "images": [
    {
      "path": "http://i.annihil.us/u/prod/marvel/i/mg/c/10/5c6dd8ffa0221",
      "extension": "jpg"
    },
    {
      "path": "http://i.annihil.us/u/prod/marvel/i/mg/f/b0/5bfecf0d37a88",
      "extension": "jpg"
    }
  ],
  "creators": {
    "available": 6,
    "collectionURI": "http://gateway.marvel.com/v1/public/comics/74053/creators",
    "items": [
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/creators/12313",
        "name": "Mark Basso",
        "role": "editor"
      },
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/creators/11680",
        "name": "Gerry Duggan",
        "role": "writer"
      },
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/creators/120",
        "name": "Ron Garney",
        "role": "inker"
      },
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/creators/13055",
        "name": "Richard Isanove",
        "role": "colorist"
      },
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/creators/12993",
        "name": "Vc Travis Lanham",
        "role": "letterer"
      },
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/creators/63",
        "name": "Alex Ross",
        "role": "painter (cover)"
      }
    ],
    "returned": 6
  },
  "characters": {
    "available": 0,
    "collectionURI": "http://gateway.marvel.com/v1/public/comics/74053/characters",
    "items": [],
    "returned": 0
  },
  "stories": {
    "available": 2,
    "collectionURI": "http://gateway.marvel.com/v1/public/comics/74053/stories",
    "items": [
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/stories/164922",
        "name": "cover from Savage Sword of Conan (2019) #2",
        "type": "cover"
      },
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/stories/164923",
        "name": "story from Savage Sword of Conan (2019) #2",
        "type": "interiorStory"
      }
    ],
    "returned": 2
  },
  "events": {
    "available": 0,
    "collectionURI": "http://gateway.marvel.com/v1/public/comics/74053/events",
    "items": [],
    "returned": 0
  }
}

Conan 1972 (not on MU)

{
  "id": 72030,
  "digitalId": 51307,
  "title": "Conan the Barbarian (1970) #13",
  "issueNumber": 13,
  "variantDescription": "",
  "description": "",
  "modified": "2018-05-24T09:02:55-0400",
  "isbn": "",
  "upc": "",
  "diamondCode": "",
  "ean": "",
  "issn": "",
  "format": "Comic",
  "pageCount": 0,
  "textObjects": [],
  "resourceURI": "http://gateway.marvel.com/v1/public/comics/72030",
  "urls": [
    {
      "type": "detail",
      "url": "http://marvel.com/comics/issue/72030/conan_the_barbarian_1970_13?utm_campaign=apiRef&utm_source=e78f64287735d7304f6dbcf59dae2328"
    },
    {
      "type": "purchase",
      "url": "http://comicstore.marvel.com/Conan-the-Barbarian-13/digital-comic/51307?utm_campaign=apiRef&utm_source=e78f64287735d7304f6dbcf59dae2328"
    },
    {
      "type": "reader",
      "url": "http://marvel.com/digitalcomics/view.htm?iid=51307&utm_campaign=apiRef&utm_source=e78f64287735d7304f6dbcf59dae2328"
    }
  ],
  "series": {
    "resourceURI": "http://gateway.marvel.com/v1/public/series/25758",
    "name": "Conan the Barbarian (1970 - 1993)"
  },
  "variants": [],
  "collections": [],
  "collectedIssues": [],
  "dates": [
    {
      "type": "onsaleDate",
      "date": "1972-01-01T00:00:00-0500"
    },
    {
      "type": "focDate",
      "date": "-0001-11-30T00:00:00-0500"
    },
    {
      "type": "unlimitedDate",
      "date": "2023-05-23T10:57:00-0400"
    },
    {
      "type": "digitalPurchaseDate",
      "date": "2023-05-23T10:57:00-0400"
    }
  ],
  "prices": [
    {
      "type": "printPrice",
      "price": 0
    }
  ],
  "thumbnail": {
    "path": "http://i.annihil.us/u/prod/marvel/i/mg/9/00/646cc7041bcc5",
    "extension": "jpg"
  },
  "images": [
    {
      "path": "http://i.annihil.us/u/prod/marvel/i/mg/9/00/646cc7041bcc5",
      "extension": "jpg"
    }
  ],
  "creators": {
    "available": 0,
    "collectionURI": "http://gateway.marvel.com/v1/public/comics/72030/creators",
    "items": [],
    "returned": 0
  },
  "characters": {
    "available": 0,
    "collectionURI": "http://gateway.marvel.com/v1/public/comics/72030/characters",
    "items": [],
    "returned": 0
  },
  "stories": {
    "available": 2,
    "collectionURI": "http://gateway.marvel.com/v1/public/comics/72030/stories",
    "items": [
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/stories/160057",
        "name": "cover from Conan the Barbarian (1970) #13",
        "type": "cover"
      },
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/stories/160058",
        "name": "story from Conan the Barbarian (1970) #13",
        "type": "interiorStory"
      }
    ],
    "returned": 2
  },
  "events": {
    "available": 0,
    "collectionURI": "http://gateway.marvel.com/v1/public/comics/72030/events",
    "items": [],
    "returned": 0
  }
}

Weapon H (on MU)

{
  "id": 70087,
  "digitalId": 50411,
  "title": "Weapon H (2018) #12",
  "issueNumber": 12,
  "variantDescription": "",
  "description": null,
  "modified": "2019-01-10T12:00:41-0500",
  "isbn": "",
  "upc": "75960608932101211",
  "diamondCode": "NOV180958",
  "ean": "",
  "issn": "",
  "format": "Comic",
  "pageCount": 32,
  "textObjects": [],
  "resourceURI": "http://gateway.marvel.com/v1/public/comics/70087",
  "urls": [
    {
      "type": "detail",
      "url": "http://marvel.com/comics/issue/70087/weapon_h_2018_12?utm_campaign=apiRef&utm_source=e78f64287735d7304f6dbcf59dae2328"
    },
    {
      "type": "purchase",
      "url": "http://comicstore.marvel.com/Weapon-H-12/digital-comic/50411?utm_campaign=apiRef&utm_source=e78f64287735d7304f6dbcf59dae2328"
    },
    {
      "type": "reader",
      "url": "http://marvel.com/digitalcomics/view.htm?iid=50411&utm_campaign=apiRef&utm_source=e78f64287735d7304f6dbcf59dae2328"
    },
    {
      "type": "inAppLink",
      "url": "https://applink.marvel.com/issue/50411?utm_campaign=apiRef&utm_source=e78f64287735d7304f6dbcf59dae2328"
    }
  ],
  "series": {
    "resourceURI": "http://gateway.marvel.com/v1/public/series/24097",
    "name": "Weapon H (2018 - 2019)"
  },
  "variants": [],
  "collections": [],
  "collectedIssues": [],
  "dates": [
    {
      "type": "onsaleDate",
      "date": "2019-01-30T00:00:00-0500"
    },
    {
      "type": "focDate",
      "date": "2019-01-07T00:00:00-0500"
    },
    {
      "type": "unlimitedDate",
      "date": "2019-08-05T00:00:00-0400"
    },
    {
      "type": "digitalPurchaseDate",
      "date": "2019-01-30T00:00:00-0500"
    }
  ],
  "prices": [
    {
      "type": "printPrice",
      "price": 3.99
    },
    {
      "type": "digitalPurchasePrice",
      "price": 3.99
    }
  ],
  "thumbnail": {
    "path": "http://i.annihil.us/u/prod/marvel/i/mg/c/b0/5c48f71ae0f7e",
    "extension": "jpg"
  },
  "images": [
    {
      "path": "http://i.annihil.us/u/prod/marvel/i/mg/c/b0/5c48f71ae0f7e",
      "extension": "jpg"
    },
    {
      "path": "http://i.annihil.us/u/prod/marvel/i/mg/f/80/5bd9debbd3564",
      "extension": "jpg"
    }
  ],
  "creators": {
    "available": 8,
    "collectionURI": "http://gateway.marvel.com/v1/public/comics/70087/creators",
    "items": [
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/creators/5251",
        "name": "Vc Joe Caramagna",
        "role": "letterer"
      },
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/creators/13250",
        "name": "Romulo Fajardo Jr.",
        "role": "colorist (cover)"
      },
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/creators/774",
        "name": "Morry Hollowell",
        "role": "colorist"
      },
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/creators/13449",
        "name": "Chris Sotomayor",
        "role": "colorist"
      },
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/creators/12376",
        "name": "Wilson Moss",
        "role": "editor"
      },
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/creators/536",
        "name": "Greg Pak",
        "role": "writer"
      },
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/creators/489",
        "name": "Philip Tan",
        "role": "penciler (cover)"
      },
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/creators/13236",
        "name": "Guiu Vilanova",
        "role": "inker"
      }
    ],
    "returned": 8
  },
  "characters": {
    "available": 0,
    "collectionURI": "http://gateway.marvel.com/v1/public/comics/70087/characters",
    "items": [],
    "returned": 0
  },
  "stories": {
    "available": 2,
    "collectionURI": "http://gateway.marvel.com/v1/public/comics/70087/stories",
    "items": [
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/stories/155217",
        "name": "cover from Weapon H (2018) #12",
        "type": "cover"
      },
      {
        "resourceURI": "http://gateway.marvel.com/v1/public/stories/155218",
        "name": "story from Weapon H (2018) #12",
        "type": "interiorStory"
      }
    ],
    "returned": 2
  },
  "events": {
    "available": 0,
    "collectionURI": "http://gateway.marvel.com/v1/public/comics/70087/events",
    "items": [],
    "returned": 0
  }
}
@geoffrich geoffrich added the bug Something isn't working label Aug 19, 2023
@geoffrich
Copy link
Owner Author

Related: #16 (a.k.a this is a feature, not a bug)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant