File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 1
1
const cache : Record < string , unknown > = { } ;
2
2
3
- const set = < T > ( key : string , value : T ) => {
3
+ export const set = < T > ( key : string , value : T ) => {
4
4
cache [ key ] = value ;
5
5
} ;
6
6
Original file line number Diff line number Diff line change 1
1
import { searchForAlbum , searchForArtist , searchForTrack } from "../api/spotify" ;
2
- import { cacher } from "../extensions/cache" ;
2
+ import { cacher , set } from "../extensions/cache" ;
3
3
import type * as LastFM from "../types/lastfm" ;
4
4
import type * as Spotify from "../types/spotify" ;
5
5
import type {
@@ -63,6 +63,7 @@ export const convertArtist = async (artist: LastFM.Artist) => {
63
63
uri : artist . url ,
64
64
type : "lastfm" ,
65
65
} as LastFMMinifiedArtist ;
66
+ set ( `artist-${ spotifyArtist . id } ` , spotifyArtist ) ;
66
67
return {
67
68
...minifyArtist ( spotifyArtist ) ,
68
69
playcount : Number ( artist . playcount ) ,
You can’t perform that action at this time.
0 commit comments