From e09d67d291a84d8760a96b3b1d05470d6b003628 Mon Sep 17 00:00:00 2001 From: Joakim Soderlund Date: Fri, 22 Feb 2019 23:34:24 +0100 Subject: [PATCH] Fix invalid status in alpha beta converter Thanks to Midnight Sapphire for finding this bug. --- fimfarchive/converters/alpha_beta/__init__.py | 4 ++++ tests/converters/test_alpha_beta.json | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fimfarchive/converters/alpha_beta/__init__.py b/fimfarchive/converters/alpha_beta/__init__.py index da19b99..c7141ec 100644 --- a/fimfarchive/converters/alpha_beta/__init__.py +++ b/fimfarchive/converters/alpha_beta/__init__.py @@ -255,6 +255,10 @@ class RootHandler(Handler): @property def completion_status(self) -> Optional[str]: status = self.meta.get('status') + + if status == 'On Hiatus': + return 'hiatus' + return status and status.strip().lower() @property diff --git a/tests/converters/test_alpha_beta.json b/tests/converters/test_alpha_beta.json index 5bb4fc8..a976771 100644 --- a/tests/converters/test_alpha_beta.json +++ b/tests/converters/test_alpha_beta.json @@ -49,7 +49,7 @@ "image": "https://cdn-img.fimfiction.net/story/vr3n-1432418803-9-medium", "likes": 365, "short_description": "", - "status": "Incomplete", + "status": "On Hiatus", "title": "The Greatest Equine Who has Ever Lived!", "total_views": 9943, "url": "https://www.fimfiction.net/story/9/the-greatest-equine-who-has-ever-lived", @@ -100,7 +100,7 @@ 126 ] }, - "completion_status": "incomplete", + "completion_status": "hiatus", "content_rating": "everyone", "cover_image": { "full": "https://cdn-img.fimfiction.net/story/vr3n-1432418803-9-full", @@ -161,4 +161,4 @@ } } ] -} \ No newline at end of file +}