Remove more unused data from 2025 annual reports (#37134)

This commit is contained in:
Claire
2025-12-05 14:36:37 +01:00
committed by GitHub
parent 591776d7ad
commit 9b851616fe
8 changed files with 1 additions and 140 deletions

View File

@@ -42,13 +42,6 @@ interface AnnualReportV2 {
time_series: TimeSeriesMonth[];
top_hashtags: NameAndCount[];
top_statuses: TopStatuses;
most_used_apps: NameAndCount[];
type_distribution: {
total: number;
reblogs: number;
replies: number;
standalone: number;
};
}
export type AnnualReport = {

View File

@@ -5,9 +5,7 @@ class AnnualReport
SOURCES = [
AnnualReport::Archetype,
AnnualReport::TypeDistribution,
AnnualReport::TopStatuses,
AnnualReport::MostUsedApps,
AnnualReport::TimeSeries,
AnnualReport::TopHashtags,
].freeze

View File

@@ -1,22 +0,0 @@
# frozen_string_literal: true
class AnnualReport::MostUsedApps < AnnualReport::Source
SET_SIZE = 10
def generate
{
most_used_apps: most_used_apps.map do |(name, count)|
{
name: name,
count: count,
}
end,
}
end
private
def most_used_apps
report_statuses.joins(:application).group(oauth_applications: [:name]).order(count_all: :desc).limit(SET_SIZE).count
end
end

View File

@@ -2,7 +2,7 @@
class AnnualReport::TopHashtags < AnnualReport::Source
MINIMUM_TAGGINGS = 1
SET_SIZE = 5
SET_SIZE = 1
def generate
{

View File

@@ -1,14 +0,0 @@
# frozen_string_literal: true
class AnnualReport::TypeDistribution < AnnualReport::Source
def generate
{
type_distribution: {
total: report_statuses.count,
reblogs: report_statuses.only_reblogs.count,
replies: report_statuses.where.not(in_reply_to_id: nil).not_replying_to_account(@account).count,
standalone: report_statuses.without_replies.without_reblogs.count,
},
}
end
end