tangled
alpha
login
or
join now
flo-bit.dev
/
blento
your personal website on atproto - mirror
blento.app
20
fork
atom
overview
issues
pulls
pipelines
fix 522?
Florian
3 days ago
e2bb5348
1180d6f1
+16
-16
4 changed files
expand all
collapse all
unified
split
src
lib
cards
media
LastFMCard
LastFMProfileCard
index.ts
LastFMRecentTracksCard
index.ts
LastFMTopAlbumsCard
index.ts
LastFMTopTracksCard
index.ts
+4
-4
src/lib/cards/media/LastFMCard/LastFMProfileCard/index.ts
···
21
const response = await fetch(
22
`https://blento.app/api/lastfm?method=user.getInfo&user=${encodeURIComponent(username)}`
23
);
24
-
if (response.ok) {
25
-
const result = await response.json();
26
-
allData[`lastfmProfile:${username}`] = result?.user;
27
-
}
28
} catch (error) {
29
console.error('Failed to fetch Last.fm profile:', error);
30
}
···
21
const response = await fetch(
22
`https://blento.app/api/lastfm?method=user.getInfo&user=${encodeURIComponent(username)}`
23
);
24
+
if (!response.ok) continue;
25
+
const text = await response.text();
26
+
const result = JSON.parse(text);
27
+
allData[`lastfmProfile:${username}`] = result?.user;
28
} catch (error) {
29
console.error('Failed to fetch Last.fm profile:', error);
30
}
+4
-4
src/lib/cards/media/LastFMCard/LastFMRecentTracksCard/index.ts
···
21
const response = await fetch(
22
`https://blento.app/api/lastfm?method=user.getRecentTracks&user=${encodeURIComponent(username)}&limit=50`
23
);
24
-
if (response.ok) {
25
-
const result = await response.json();
26
-
allData[`lastfmRecentTracks:${username}`] = result?.recenttracks?.track ?? [];
27
-
}
28
} catch (error) {
29
console.error('Failed to fetch Last.fm recent tracks:', error);
30
}
···
21
const response = await fetch(
22
`https://blento.app/api/lastfm?method=user.getRecentTracks&user=${encodeURIComponent(username)}&limit=50`
23
);
24
+
if (!response.ok) continue;
25
+
const text = await response.text();
26
+
const result = JSON.parse(text);
27
+
allData[`lastfmRecentTracks:${username}`] = result?.recenttracks?.track ?? [];
28
} catch (error) {
29
console.error('Failed to fetch Last.fm recent tracks:', error);
30
}
+4
-4
src/lib/cards/media/LastFMCard/LastFMTopAlbumsCard/index.ts
···
25
const response = await fetch(
26
`https://blento.app/api/lastfm?method=user.getTopAlbums&user=${encodeURIComponent(username)}&period=${period}&limit=50`
27
);
28
-
if (response.ok) {
29
-
const result = await response.json();
30
-
allData[`lastfmTopAlbums:${username}:${period}`] = result?.topalbums?.album ?? [];
31
-
}
32
} catch (error) {
33
console.error('Failed to fetch Last.fm top albums:', error);
34
}
···
25
const response = await fetch(
26
`https://blento.app/api/lastfm?method=user.getTopAlbums&user=${encodeURIComponent(username)}&period=${period}&limit=50`
27
);
28
+
if (!response.ok) continue;
29
+
const text = await response.text();
30
+
const result = JSON.parse(text);
31
+
allData[`lastfmTopAlbums:${username}:${period}`] = result?.topalbums?.album ?? [];
32
} catch (error) {
33
console.error('Failed to fetch Last.fm top albums:', error);
34
}
+4
-4
src/lib/cards/media/LastFMCard/LastFMTopTracksCard/index.ts
···
25
const response = await fetch(
26
`https://blento.app/api/lastfm?method=user.getTopTracks&user=${encodeURIComponent(username)}&period=${period}&limit=50`
27
);
28
-
if (response.ok) {
29
-
const result = await response.json();
30
-
allData[`lastfmTopTracks:${username}:${period}`] = result?.toptracks?.track ?? [];
31
-
}
32
} catch (error) {
33
console.error('Failed to fetch Last.fm top tracks:', error);
34
}
···
25
const response = await fetch(
26
`https://blento.app/api/lastfm?method=user.getTopTracks&user=${encodeURIComponent(username)}&period=${period}&limit=50`
27
);
28
+
if (!response.ok) continue;
29
+
const text = await response.text();
30
+
const result = JSON.parse(text);
31
+
allData[`lastfmTopTracks:${username}:${period}`] = result?.toptracks?.track ?? [];
32
} catch (error) {
33
console.error('Failed to fetch Last.fm top tracks:', error);
34
}