From b270de8c160339e21a80b9dc17c816c6d3497b05 Mon Sep 17 00:00:00 2001 From: Kartik Ohri Date: Fri, 10 Jan 2025 23:14:20 +0530 Subject: [PATCH] fix top discoveries playlist To find tracks discovered in a year correctly, need to use all listens. --- listenbrainz_spark/year_in_music/top_discoveries.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/listenbrainz_spark/year_in_music/top_discoveries.py b/listenbrainz_spark/year_in_music/top_discoveries.py index afe6133825..1ae900f321 100644 --- a/listenbrainz_spark/year_in_music/top_discoveries.py +++ b/listenbrainz_spark/year_in_music/top_discoveries.py @@ -2,6 +2,7 @@ from more_itertools import chunked +from listenbrainz_spark.constants import LAST_FM_FOUNDING_YEAR from listenbrainz_spark.path import RECORDING_ARTIST_DATAFRAME from listenbrainz_spark.stats import run_query from listenbrainz_spark.utils import get_listens_from_dump @@ -66,7 +67,7 @@ def generate_top_discoveries(year): def create_tracks_of_the_year(year): - start = datetime(year, 1, 1) + start = datetime(LAST_FM_FOUNDING_YEAR, 1, 1) end = datetime.combine(date(year, 12, 31), time.max) listens = get_listens_from_dump(start, end) listens.createOrReplaceTempView("listens_for_tracks_of_year")