DreadPirateShawn / goodreads

:snake: Python wrapper for Goodreads API :books:
0 stars 0 forks source link

book.popular_shelves and book.series_works can be empty #1

Open DreadPirateShawn opened 5 years ago

DreadPirateShawn commented 5 years ago

Example of both cases:

OrderedDict([
  ('id', OrderedDict([
    ('@type', 'integer'),
    ('#text', '546454')])),
    ('isbn', '0532601467'),
    ('isbn13', '9780532601463'),
    ('text_reviews_count', OrderedDict([('@type', 'integer'), ('#text', '98')])),
    ('uri', 'kca://book/amzn1.gr.book.v1.nc7d34Wasx0hXPwjH9DMLQ'),
    ('title', 'The Voyage of the Space Beagle'),
    ('title_without_series', 'The Voyage of the Space Beagle'),
    ('image_url', 'https://s.gr-assets.com/assets/nophoto/book/111x148-bcc042a9c91a29c1d680899eff700a03.png'),
    ('small_image_url', 'https://s.gr-assets.com/assets/nophoto/book/50x75-a91bf249278a81aabab721ef782c4a74.png'),
    ('large_image_url', None),
    ('link', 'https://www.goodreads.com/book/show/546454.The_Voyage_of_the_Space_Beagle'),
    ('num_pages', '192'),
    ('format', 'Paperback'),
    ('edition_information', None),
    ('publisher', 'Macfadden-Bartell'),
    ('publication_day', None),
    ('publication_year', '1963'),
    ('publication_month', None),
    ('average_rating', '3.86'),
    ('ratings_count', '3137'),
    ('description', None),
    ('authors', OrderedDict([
      ('author', OrderedDict([
        ('id', '1293688'),
        ('name', 'A.E. van Vogt'),
        ('role', None),
        ('image_url', OrderedDict([
          ('@nophoto', 'false'),
          ('#text', 'https://images.gr-assets.com/authors/1226200601p5/1293688.jpg')
        ])),
        ('small_image_url', OrderedDict([
          ('@nophoto', 'false'),
          ('#text', 'https://images.gr-assets.com/authors/1226200601p2/1293688.jpg')
        ])),
        ('link', 'https://www.goodreads.com/author/show/1293688.A_E_van_Vogt'),
        ('average_rating', '3.84'),
        ('ratings_count', '38578'),
        ('text_reviews_count', '2280')
      ]))
    ])),
    ('published', '1963'),
    ('work', OrderedDict([('id', '2016616'), ('uri', 'kca://work/amzn1.gr.work.v1.3tDylDehuKu4BaHTdlO5Ow')]))
  ])
DreadPirateShawn commented 5 years ago

Verdict, some data is omitted when pulled via (say) user shelf contents, but populated when pulled directly via client.book(id).

Solution is to re-fetch all shelf results directly, if such data is needed.

I don't think this should be baked in, but it should certainly be called out in the docs.