mam/audible: null author_info or authors no longer abort the run - #28
Draft
cursor[bot] wants to merge 1 commit into
Draft
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
getMAMBook still did len() and json.loads on author_info, so a snatched hit with author_info null (radio / uncredited) or an already-decoded object TypeError'd and skipped every later book. product2Book had the same gap for authors/narrators/category_ladders after series.sequence was hardened. Skip those fields the same way. Co-authored-by: Mancolt <Mancolt@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A snatched MAM hit with
author_infonull (radio / uncredited) or already a JSON object used to TypeError ingetMAMBookand skip every later book.narrator_infoandseries_infowere guarded for null in #24;author_infowas not.The same run-killing TypeError/KeyError happened in
product2Bookwhen Audible sentauthors,narrators, orcategory_laddersas null, or an author/narrator withoutname.Fix: parse MAM
*_infofields through_mamJsonObject(string, already-decoded object, or skip). Skip incomplete Audible contributor/ladder entries the same wayseries.sequencealready is.Validation:
python3 -m unittest discover -s tests -p 'test_*.py'— 223 tests, 0 failures. New cases cover null/decoded/badauthor_infoand null authors/ladders through ranking.