forked from
rocksky.app/rocksky
A decentralized music tracking and discovery platform built on AT Protocol 馃幍
1import axios from "axios";
2import { API_URL } from "../consts";
3
4export const getScrobblesChart = () => {
5 return [];
6};
7
8export const getSongChart = async (uri: string) => {
9 const response = await axios.get(
10 `${API_URL}/public/scrobbleschart?songuri=${uri}`,
11 );
12 if (response.status !== 200) {
13 return [];
14 }
15 return response.data;
16};
17
18export const getArtistChart = async (uri: string) => {
19 const response = await axios.get(
20 `${API_URL}/public/scrobbleschart?artisturi=${uri}`,
21 );
22 if (response.status !== 200) {
23 return [];
24 }
25 return response.data;
26};
27
28export const getAlbumChart = async (uri: string) => {
29 const response = await axios.get(
30 `${API_URL}/public/scrobbleschart?albumuri=${uri}`,
31 );
32 if (response.status !== 200) {
33 return [];
34 }
35 return response.data;
36};
37
38export const getProfileChart = async (did: string) => {
39 const response = await axios.get(
40 `${API_URL}/public/scrobbleschart?did=${did}`,
41 );
42 if (response.status !== 200) {
43 return [];
44 }
45 return response.data;
46};