diff --git a/catalog/performance/tests.py b/catalog/performance/tests.py index a4795278..cf72bf1c 100644 --- a/catalog/performance/tests.py +++ b/catalog/performance/tests.py @@ -73,7 +73,7 @@ class DoubanDramaTestCase(TestCase): self.assertEqual(item.performer, ["安蘭けい", "柚希礼音", "遠野あすか", "霧矢大夢", "龍真咲"]) self.assertEqual(len(resource.related_resources), 4) crawl_related_resources_task(resource.id) # force the async job to run now - productions = list(item.productions.all()) + productions = list(item.productions.all().order_by("title")) self.assertEqual(len(productions), 4) self.assertEqual(productions[0].opening_date, "2008-06-20") self.assertEqual(productions[0].closing_date, "2008-08-04") diff --git a/catalog/sites/douban_drama.py b/catalog/sites/douban_drama.py index 56d7b782..1d36d052 100644 --- a/catalog/sites/douban_drama.py +++ b/catalog/sites/douban_drama.py @@ -133,10 +133,14 @@ class DoubanDrama(AbstractSite): ) data["other_title"] = other_title_elem - plot_elem = h.xpath("//div[@id='link-report']/text()") + plot_elem = h.xpath("//div[@class='pure-text']/div[@class='full']/text()") if len(plot_elem) == 0: - plot_elem = h.xpath("//div[@class='abstract']/text()") - data["brief"] = "\n".join(plot_elem) if len(plot_elem) > 0 else "" + plot_elem = h.xpath( + "//div[@class='pure-text']/div[@class='abstract']/text()" + ) + if len(plot_elem) == 0: + plot_elem = h.xpath("//div[@class='pure-text']/text()") + data["brief"] = "\n".join(plot_elem) data["genre"] = [ s.strip()