|
libMusicForge
|
Provider-attributed track comparisons. More...
Classes | |
| class | TrackStatisticsIf |
| Contract for track statistics lookup. More... | |
| class | TrackComparison |
| Track listener and scrobble counts and derived ratio. More... | |
Functions | |
| int|None | _count (Sequence[Statistic] stats, str metric) |
| list[TrackComparison] | compare_tracks (TrackStatisticsIf provider, Sequence[tuple[str, str]] tracks, *, str sort_by="listeners", bool descending=True) |
| Compare track totals from Last.fm. | |
Provider-attributed track comparisons.
Ratios describe Last.fm recorded listening, not global streaming popularity.
|
protected |
| list[TrackComparison] musicforge.analytics.compare_tracks | ( | TrackStatisticsIf | provider, |
| Sequence[tuple[str, str]] | tracks, | ||
| * | , | ||
| str | sort_by = "listeners", | ||
| bool | descending = True ) |
Compare track totals from Last.fm.
| provider | Track statistics provider. |
| tracks | Sequence of artist/title pairs. |
| sort_by | Sort metric: listeners, scrobbles or ratio. |
| descending | Whether to sort known values in descending order. |
Uses sequential requests to avoid unnecessary API bursts. Missing values are kept as None, not silently converted to zero.