diff --git a/common/templates/partial/_sidebar.html b/common/templates/partial/_sidebar.html index df6441ff..be94ec4a 100644 --- a/common/templates/partial/_sidebar.html +++ b/common/templates/partial/_sidebar.html @@ -15,6 +15,7 @@
{{ user.mastodon_account.display_name }}
+

@{{ user.username }}@{{ user.mastodon_site }} {% current_user_relationship user as relationship %} diff --git a/journal/importers/goodreads.py b/journal/importers/goodreads.py index bc5cb8a7..df880a93 100644 --- a/journal/importers/goodreads.py +++ b/journal/importers/goodreads.py @@ -30,7 +30,7 @@ class GoodreadsImporter: match_shelf = re.match(re_shelf, raw_url) match_profile = re.match(re_profile, raw_url) if match_profile or match_shelf or match_list: - django_rq.get_queue("doufen").enqueue( + django_rq.get_queue("import").enqueue( cls.import_from_url_task, raw_url, user ) return True @@ -142,6 +142,20 @@ class GoodreadsImporter: ) review = "" last_updated = None + date_elem = cell.xpath(".//td[@class='field date_added']//span/text()") + for d in date_elem: + date_matched = re.search(r"(\w+)\s+(\d+),\s+(\d+)", d) + if date_matched: + last_updated = make_aware( + datetime.strptime( + date_matched[1] + + " " + + date_matched[2] + + " " + + date_matched[3], + "%b %d %Y", + ) + ) try: c2 = BasicDownloader(url_shelf).download().html() review_elem = c2.xpath("//div[@itemprop='reviewBody']/text()") diff --git a/social/models.py b/social/models.py index caf93f35..a5efd739 100644 --- a/social/models.py +++ b/social/models.py @@ -134,8 +134,12 @@ class DefaultActivityProcessor: ).first() if not activity: self.created() - elif activity.visibility != self.action_object.visibility: + elif ( + activity.visibility != self.action_object.visibility + or activity.created_time != activity.action_object.created_time + ): activity.visibility = self.action_object.visibility + activity.created_time = activity.action_object.created_time activity.save() diff --git a/users/templates/users/data.html b/users/templates/users/data.html index 206099a7..03780050 100644 --- a/users/templates/users/data.html +++ b/users/templates/users/data.html @@ -96,7 +96,7 @@

{% csrf_token %}
输入Goodreads链接 - +