mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-16 01:09:55 +00:00
Remove more unused data from 2025 annual reports (#37134)
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -5,9 +5,7 @@ class AnnualReport
|
||||
|
||||
SOURCES = [
|
||||
AnnualReport::Archetype,
|
||||
AnnualReport::TypeDistribution,
|
||||
AnnualReport::TopStatuses,
|
||||
AnnualReport::MostUsedApps,
|
||||
AnnualReport::TimeSeries,
|
||||
AnnualReport::TopHashtags,
|
||||
].freeze
|
||||
|
||||
@@ -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
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
class AnnualReport::TopHashtags < AnnualReport::Source
|
||||
MINIMUM_TAGGINGS = 1
|
||||
SET_SIZE = 5
|
||||
SET_SIZE = 1
|
||||
|
||||
def generate
|
||||
{
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user