add nice statistics

This commit is contained in:
2025-06-21 09:38:22 +02:00
parent 99b0aaa72e
commit e79626972f
43 changed files with 1359 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
class HomeController < ApplicationController
before_action :authenticate_user!
def index
@user = current_user
@logins = Login.where(user: @user)
end
end

View File

@@ -0,0 +1,13 @@
class StatisticsController < ApplicationController
before_action :authenticate_user!
def index
stats = Statistics.new(current_user)
@total_plays = stats.total_plays
@activity_by_day = stats.activity_by_day
@top_artists_all_time = stats.top_artists_all_time
@top_artists_year = stats.top_artists_year
@top_artists_upcoming = stats.top_artists_upcoming
@since_date = stats.since_date
end
end