Skip to content

Commit

Permalink
added threshold for biggest climbers/fallers lists (closes #47)
Browse files Browse the repository at this point in the history
  • Loading branch information
felhag committed Apr 5, 2024
1 parent 8610974 commit 83f9db5
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions projects/shared/src/lib/lists/album-lists.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<app-top10list [list]="s.albumStreak" title="Album streaks" explanation="Streaks for playing the same album in a row."></app-top10list>
</div>
<div class="row">
<app-top10list [list]="s.climbers" title="Biggest climbers" explanation="Gained most ranks in a single month (according to {{'translate.scrobble' | translate}} count)"></app-top10list>
<app-top10list [list]="s.fallers" title="Biggest fallers" explanation="Lost most ranks in a single month (according to {{'translate.scrobble' | translate}} count)"></app-top10list>
<app-top10list [list]="s.climbers" title="Biggest climbers" explanation="Gained most ranks in a single month (according to {{'translate.scrobble' | translate}} count with at least {{minimumForcedThreshold}} {{'translate.scrobbles' | translate}})"></app-top10list>
<app-top10list [list]="s.fallers" title="Biggest fallers" explanation="Lost most ranks in a single month (according to {{'translate.scrobble' | translate}} count with at least {{minimumForcedThreshold}} {{'translate.scrobbles' | translate}})"></app-top10list>
</div>
</div>
}
2 changes: 1 addition & 1 deletion projects/shared/src/lib/lists/album-lists.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class AlbumListsComponent extends AbstractListsComponent<AlbumStats> {
next.avgScrobbleDesc = this.getAlbumTop10(seenThreshold, s => s.avgScrobble, k => seenThreshold[+k], a => `${a.name} (${a.scrobbles.length} scrobbles)`, (i, v) => new Date(v).toLocaleDateString());
next.avgScrobbleAsc = this.getAlbumTop10(seenThreshold, s => -s.avgScrobble, k => seenThreshold[+k], a => `${a.name} (${a.scrobbles.length} scrobbles)`, (i, v) => new Date(Math.abs(v)).toLocaleDateString());

const rankings = this.getRankings(seen, Object.values(stats.monthList), (i, m) => this.url.albumMonth(i.artist, i.shortName, m));
const rankings = this.getRankings(seenThreshold, Object.values(stats.monthList), (i, m) => this.url.albumMonth(i.artist, i.shortName, m));
next.climbers = rankings.climbers;
next.fallers = rankings.fallers;
}
Expand Down
4 changes: 2 additions & 2 deletions projects/shared/src/lib/lists/artist-lists.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
<app-top10list [list]="s.latestNew" title="Latest new artist"></app-top10list>
</div>
<div class="row">
<app-top10list [list]="s.climbers" title="Biggest climbers" explanation="Gained most ranks in a single month (according to {{'translate.scrobble' | translate}} count)"></app-top10list>
<app-top10list [list]="s.fallers" title="Biggest fallers" explanation="Lost most ranks in a single month (according to {{'translate.scrobble' | translate}} count)"></app-top10list>
<app-top10list [list]="s.climbers" title="Biggest climbers" explanation="Gained most ranks in a single month (according to {{'translate.scrobble' | translate}} count with at least {{minimumForcedThreshold}} {{'translate.scrobbles' | translate}})"></app-top10list>
<app-top10list [list]="s.fallers" title="Biggest fallers" explanation="Lost most ranks in a single month (according to {{'translate.scrobble' | translate}} count with at least {{minimumForcedThreshold}} {{'translate.scrobbles' | translate}})"></app-top10list>
</div>
<div class="row">
<app-top10list [list]="s.artistStreak" title="Artist streaks" explanation="Streaks for playing the same artist in a row."></app-top10list>
Expand Down
2 changes: 1 addition & 1 deletion projects/shared/src/lib/lists/artist-lists.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class ArtistListsComponent extends AbstractListsComponent<ArtistStats> {
next.latestNew = this.getArtistTop10(seen, s => s.scrobbles[0], k => seen[+k], a => `${a.name} (${a.scrobbles.length} scrobbles)`, (i, v) => this.dateString(v));
next.artistStreak = this.consecutiveStreak(stats, stats.artistStreak, s => `${s.start.artist} (${s.length} times)`);

const rankings = this.getRankings(seen, Object.values(months), (i, m) => this.url.artistMonth(i.name, m));
const rankings = this.getRankings(seenThreshold, Object.values(months), (i, m) => this.url.artistMonth(i.name, m));
next.climbers = rankings.climbers;
next.fallers = rankings.fallers;
}
Expand Down
4 changes: 2 additions & 2 deletions projects/shared/src/lib/lists/track-lists.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<app-top10list [list]="s.trackStreak" title="Track streaks" explanation="Streaks for playing the same track in a row."></app-top10list>
</div>
<div class="row">
<app-top10list [list]="s.climbers" title="Biggest climbers" explanation="Gained most ranks in a single month (according to {{'translate.scrobble' | translate}} count)"></app-top10list>
<app-top10list [list]="s.fallers" title="Biggest fallers" explanation="Lost most ranks in a single month (according to {{'translate.scrobble' | translate}} count)"></app-top10list>
<app-top10list [list]="s.climbers" title="Biggest climbers" explanation="Gained most ranks in a single month (according to {{'translate.scrobble' | translate}} count with at least {{minimumForcedThreshold}} {{'translate.scrobbles' | translate}})"></app-top10list>
<app-top10list [list]="s.fallers" title="Biggest fallers" explanation="Lost most ranks in a single month (according to {{'translate.scrobble' | translate}} count with at least {{minimumForcedThreshold}} {{'translate.scrobbles' | translate}})"></app-top10list>
</div>
</div>
}
2 changes: 1 addition & 1 deletion projects/shared/src/lib/lists/track-lists.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class TrackListsComponent extends AbstractListsComponent<TrackStats> {
next.avgScrobbleAsc = this.getTrackTop10(seenThreshold, s => -s.avgScrobble, k => seenThreshold[+k], a => `${a.name} (${a.scrobbles.length} scrobbles)`, (i, v) => new Date(Math.abs(v)).toLocaleDateString());
next.trackStreak = this.consecutiveStreak(stats, stats.trackStreak, s => `${s.start.artist} - ${s.start.track} (${s.length} times)`);

const rankings = this.getRankings(seen, monthsValues, (i, m) => this.url.trackMonth(i.artist, i.shortName, m));
const rankings = this.getRankings(seenThreshold, monthsValues, (i, m) => this.url.trackMonth(i.artist, i.shortName, m));
next.climbers = rankings.climbers;
next.fallers = rankings.fallers;
}
Expand Down

0 comments on commit 83f9db5

Please sign in to comment.