commit: a93489f10135385f8847c5dafd4e9c3e06bc76dc
parent 70d925a9be7a921ddd5591df477ba1b80b812ad5
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Wed, 27 Mar 2024 22:24:21 +0100
statuses.js: Yeet scrobbles
Diffstat:
1 file changed, 0 insertions(+), 17 deletions(-)
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
@@ -33,7 +33,6 @@ const emptyTl = (userId = 0) => ({
export const defaultState = () => ({
allStatuses: [],
- scrobblesNextFetch: {},
allStatusesObject: {},
conversationsObject: {},
maxId: 0,
@@ -106,24 +105,8 @@ const sortTimeline = (timeline) => {
return timeline
}
-const getLatestScrobble = (state, user) => {
- if (state.scrobblesNextFetch[user.id] && state.scrobblesNextFetch[user.id] > Date.now()) {
- return
- }
-
- state.scrobblesNextFetch[user.id] = Date.now() + 24 * 60 * 60 * 1000
- apiService.fetchScrobbles({ accountId: user.id }).then((scrobbles) => {
- if (scrobbles.length > 0) {
- user.latestScrobble = scrobbles[0]
-
- state.scrobblesNextFetch[user.id] = Date.now() + 60 * 1000
- }
- })
-}
-
// Add status to the global storages (arrays and objects maintaining statuses) except timelines
const addStatusToGlobalStorage = (state, data) => {
- getLatestScrobble(state, data.user)
const result = mergeOrAdd(state.allStatuses, state.allStatusesObject, data)
if (result.new) {
// Add to conversation