From 8c750d3207e9a0823b70db2fec901c81feb53940 Mon Sep 17 00:00:00 2001 From: codl Date: Fri, 14 May 2021 19:46:59 +0200 Subject: [PATCH] remove fav/reblog counters. they were never used --- libforget/mastodon.py | 2 -- ...emove_favourite_reblog_count_from_posts.py | 26 +++++++++++++++++++ templates/privacy.html | 3 +-- 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 migrations/versions/af763dccc0b4_remove_favourite_reblog_count_from_posts.py diff --git a/libforget/mastodon.py b/libforget/mastodon.py index 8f99ce0..8cdf507 100644 --- a/libforget/mastodon.py +++ b/libforget/mastodon.py @@ -145,8 +145,6 @@ def post_from_api_object(obj, instance): created_at=obj['created_at'], author_id=account_from_api_object(obj['account'], instance).id, direct=obj['visibility'] == 'direct', - favourites=obj['favourites_count'], - reblogs=obj['reblogs_count'], is_reblog=obj['reblog'] is not None, ) diff --git a/migrations/versions/af763dccc0b4_remove_favourite_reblog_count_from_posts.py b/migrations/versions/af763dccc0b4_remove_favourite_reblog_count_from_posts.py new file mode 100644 index 0000000..efb6779 --- /dev/null +++ b/migrations/versions/af763dccc0b4_remove_favourite_reblog_count_from_posts.py @@ -0,0 +1,26 @@ +"""remove favourite, reblog count from posts + +Revision ID: af763dccc0b4 +Revises: 4b56cde3ebd7 +Create Date: 2021-05-14 19:45:37.429645 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'af763dccc0b4' +down_revision = '4b56cde3ebd7' +branch_labels = None +depends_on = None + + +def upgrade(): + op.drop_column('posts', 'reblogs') + op.drop_column('posts', 'favourites') + + +def downgrade(): + op.add_column('posts', sa.Column('favourites', sa.Integer(), nullable=True)) + op.add_column('posts', sa.Column('reblogs', sa.Integer(), nullable=True)) diff --git a/templates/privacy.html b/templates/privacy.html index 4fca12a..593d377 100644 --- a/templates/privacy.html +++ b/templates/privacy.html @@ -13,12 +13,11 @@
  • The post's time and date of publishing
  • Whether the post has any media attached
  • Whether the post has been favourited by you
  • -
  • How many favourites and reblogs / retweets the post has
  • (Mastodon only) Whether the post is a direct message
  • No other post metadata and no post contents are stored by Forget.

    -

    Last updated on 2017-12-27. History.

    +

    Last updated on 2021-05-14. History.

    {% endblock %}