Refactored stats page.

This commit is contained in:
DebaucheryLibrarian
2023-06-24 17:16:06 +02:00
parent f4ed4fb8d8
commit fbcf17d1c4
15 changed files with 139 additions and 62 deletions

View File

@@ -280,23 +280,15 @@ function initUiActions(store, _router) {
actors,
networks,
channels,
batches: [batch],
} = await graphql(`
query Stats {
scenes: releasesConnection(
last: 1,
orderBy: BATCH_BY_CREATED_BATCH_ID__CREATED_AT_ASC
) {
totalCount
scenes: nodes {
batch: createdBatch {
createdAt
}
}
}
scenes: releasesConnection { totalCount }
movies: moviesConnection { totalCount }
actors: actorsConnection { totalCount }
networks: entitiesConnection(filter: { type: { equalTo: "network" } }) { totalCount }
channels: entitiesConnection(filter: { type: { equalTo: "channel" } }) { totalCount }
batches(orderBy: CREATED_AT_DESC, first: 1) { createdAt }
}
`);
@@ -306,7 +298,7 @@ function initUiActions(store, _router) {
totalActors: actors.totalCount,
totalNetworks: networks.totalCount,
totalChannels: channels.totalCount,
lastScrape: new Date(scenes.scenes[0]?.batch.createdAt),
lastScrape: new Date(batch.createdAt),
};
}