Skip to content

Commit

Permalink
Add total listeners count to top listeners stat
Browse files Browse the repository at this point in the history
  • Loading branch information
amCap1712 committed Dec 29, 2023
1 parent 858fedc commit a57597b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion frontend/js/src/entity-pages/AlbumPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export default function AlbumPage(props: AlbumPageProps): JSX.Element {
const {
total_listen_count: listenCount,
listeners: topListeners,
total_user_count: userCount,
} = listening_stats;

const [metadata, setMetadata] = React.useState(initialReleaseGroupMetadata);
Expand Down Expand Up @@ -367,7 +368,7 @@ export default function AlbumPage(props: AlbumPageProps): JSX.Element {
<div className="separator" />
<div className="text-center">
<div className="number">
{bigNumberFormatter.format(topListeners.length)}
{bigNumberFormatter.format(userCount)}
</div>
<div className="text-muted small">
<FontAwesomeIcon icon={faUserAstronaut} /> listeners
Expand Down
3 changes: 2 additions & 1 deletion frontend/js/src/entity-pages/ArtistPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default function ArtistPage(props: ArtistPageProps): JSX.Element {
const {
total_listen_count: listenCount,
listeners: topListeners,
total_user_count: userCount
} = listeningStats;

const [artist, setArtist] = React.useState(initialArtist);
Expand Down Expand Up @@ -354,7 +355,7 @@ export default function ArtistPage(props: ArtistPageProps): JSX.Element {
<div className="separator" />
<div className="text-center">
<div className="number">
{bigNumberFormatter.format(topListeners.length)}
{bigNumberFormatter.format(userCount)}
</div>
<div className="text-muted small">
<FontAwesomeIcon icon={faUserAstronaut} /> listeners
Expand Down
1 change: 1 addition & 0 deletions frontend/js/src/entity-pages/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export type PopularRecording = {

export type ListeningStats = {
total_listen_count: number;
total_user_count: number;
listeners: Array<{
user_name: string;
listen_count: number;
Expand Down

0 comments on commit a57597b

Please sign in to comment.