Added footer and basic stats page.

This commit is contained in:
DebaucheryLibrarian
2020-08-15 19:04:33 +02:00
parent d7974f057f
commit b3435c97c3
14 changed files with 194 additions and 8 deletions

View File

@@ -154,6 +154,32 @@ function initUiActions(_store, _router) {
};
}
async function fetchStats() {
const {
scenes,
movies,
actors,
networks,
channels,
} = await graphql(`
query Stats {
scenes: releasesConnection { totalCount }
movies: moviesConnection { totalCount }
actors: actorsConnection { totalCount }
networks: entitiesConnection(filter: { type: { equalTo: "network" } }) { totalCount }
channels: entitiesConnection(filter: { type: { equalTo: "channel" } }) { totalCount }
}
`);
return {
totalScenes: scenes.totalCount,
totalMovies: movies.totalCount,
totalActors: actors.totalCount,
totalNetworks: networks.totalCount,
totalChannels: channels.totalCount,
};
}
return {
search,
setFilter,
@@ -161,6 +187,7 @@ function initUiActions(_store, _router) {
setBatch,
setSfw,
setTheme,
fetchStats,
};
}