diff --git a/src/internal/admins/stats.go b/src/internal/admins/stats.go index b33e735..10e0422 100644 --- a/src/internal/admins/stats.go +++ b/src/internal/admins/stats.go @@ -13,8 +13,9 @@ const ( moviesTorrentsCountByIDQuery = `SELECT COUNT(*) FROM (SELECT DISTINCT(imdb_id) FROM movie_torrents) as TMP;` moviesTorrentsCountQuery = `SELECT COUNT(*) FROM movie_torrents;` showsCountQuery = `SELECT COUNT(*) FROM shows;` + showsTorrentsCountByIDQuery = `SELECT COUNT(*) FROM (SELECT DISTINCT(imdb_id) FROM episode_torrents) as TMP;` episodesCountQuery = `SELECT COUNT(*) FROM episodes;` - episodesTorrentsCountByIDQuery = `SELECT COUNT(*) FROM (SELECT DISTINCT(imdb_id) FROM episode_torrents) as TMP;` + episodesTorrentsCountByIDQuery = `SELECT COUNT(*) FROM (SELECT DISTINCT(imdb_id, season, episode) FROM episode_torrents) as TMP;` episodesTorrentsCountQuery = `SELECT COUNT(*) FROM episode_torrents;` ) @@ -41,6 +42,7 @@ func GetStatsHandler(env *web.Env, w http.ResponseWriter, r *http.Request) error MoviesTorrentsCount int `json:"movies_torrents_count"` MoviesTorrentsCountByID int `json:"movies_torrents_count_by_id"` ShowsCount int `json:"shows_count"` + ShowsTorrentsCountByID int `json:"shows_torrents_count_by_id"` EpisodesCount int `json:"episodes_count"` EpisodesTorrentsCount int `json:"episodes_torrents_count"` EpisodesTorrentsCountByID int `json:"episodes_torrents_count_by_id"` @@ -54,6 +56,7 @@ func GetStatsHandler(env *web.Env, w http.ResponseWriter, r *http.Request) error {moviesTorrentsCountQuery, &stats.MoviesTorrentsCount}, {moviesTorrentsCountByIDQuery, &stats.MoviesTorrentsCountByID}, {showsCountQuery, &stats.ShowsCount}, + {showsTorrentsCountByIDQuery, &stats.ShowsTorrentsCountByID}, {episodesCountQuery, &stats.EpisodesCount}, {episodesTorrentsCountQuery, &stats.EpisodesTorrentsCount}, {episodesTorrentsCountByIDQuery, &stats.EpisodesTorrentsCountByID}, diff --git a/src/public/js/components/admins/stats.js b/src/public/js/components/admins/stats.js index 612dccf..141ed56 100644 --- a/src/public/js/components/admins/stats.js +++ b/src/public/js/components/admins/stats.js @@ -10,7 +10,12 @@ export default function Stats(props) { torrentCount={props.stats.get("movies_torrents_count")} torrentCountById={props.stats.get("movies_torrents_count_by_id")} /> - +