File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 99 SpotifyProviderArgsSchema ,
1010 NoopProviderArgsSchema ,
1111 SpotifyStreamerArgs ,
12+ storageKindSchema ,
1213} from './schema'
1314import { InMemoryStorage , type IStorer } from './storage'
1415import { SpotifyStreamer , NoopStreamer , type IStreamer , Song } from './streamers'
@@ -35,8 +36,8 @@ export class NowPlaying {
3536 this . provider = provider
3637
3738 this . parseArgs ( args )
38- this . storageKind = args . storageKind
39- this . useCache = args . useCache
39+ this . storageKind = args . storageKind || StorageKinds . INMEMORY
40+ this . useCache = args . useCache || true
4041 this . cacheDuration = args . cacheDuration || 60000 ;
4142
4243 // this is whatever storage mechanic the user selects
Original file line number Diff line number Diff line change @@ -18,12 +18,11 @@ export const storageKindSchema = z.nativeEnum(StorageKinds);
1818export type StorageKind = z . infer < typeof storageKindSchema > ;
1919
2020export const BaseNowPlayingArgsSchema = z . object ( {
21- storageKind : storageKindSchema . optional ( ) . default ( StorageKinds . INMEMORY ) ,
22- useCache : z . boolean ( ) . optional ( ) . default ( true ) ,
21+ storageKind : storageKindSchema . optional ( ) ,
22+ useCache : z . boolean ( ) . optional ( ) ,
2323 cacheDuration : z
2424 . number ( )
2525 . optional ( )
26- . default ( 60 * 60 * 24 ) ,
2726} ) ;
2827export type BaseNowPlayingArgs = z . infer < typeof BaseNowPlayingArgsSchema > ;
2928
You can’t perform that action at this time.
0 commit comments