From 83a8b8fdde7824ac221c6bcbf964cba8ec747e1a Mon Sep 17 00:00:00 2001 From: Hareesh Nagaraj Date: Fri, 25 Oct 2019 15:09:08 -0700 Subject: [PATCH] Eliminate filling in of zero listens for trending --- identity-service/src/routes/trackListens.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/identity-service/src/routes/trackListens.js b/identity-service/src/routes/trackListens.js index c7438a253df..a2068279694 100644 --- a/identity-service/src/routes/trackListens.js +++ b/identity-service/src/routes/trackListens.js @@ -191,24 +191,6 @@ const getTrendingTracks = async ( seenTrackIds.push(elem.trackId) }) - const seenIdSet = new Set(seenTrackIds) - if (idList && seenIdSet.size < idList.length) { - // For any tracks in the required id list that were not listened to in the last - // Populate empty listen counts - for (var i = 0; i < idList.length; i++) { - const id = parseInt(idList[i]) - // Add tracks only if not already present in parsedListenCounts - if (!seenIdSet.has(id)) { - parsedListenCounts.push({ trackId: id, listens: 0 }) - } - - // Exit if desired response limit has been met - if (limit && parsedListenCounts.length >= limit) { - break - } - } - } - return parsedListenCounts }