mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
feat(api): update existing artists in MusicLibrary
This commit is contained in:
parent
a0c28e2324
commit
a0ffe108e1
11 changed files with 176 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ export class SchedulerService implements OnApplicationBootstrap {
|
|||
|
||||
onApplicationBootstrap() {
|
||||
this.setupSpotifyCrawler();
|
||||
this.setupSpotifyMusicLibraryUpdater();
|
||||
}
|
||||
|
||||
private setupSpotifyCrawler() {
|
||||
|
|
@ -33,4 +34,16 @@ export class SchedulerService implements OnApplicationBootstrap {
|
|||
|
||||
this.registry.addInterval("crawler_spotify", interval);
|
||||
}
|
||||
|
||||
private setupSpotifyMusicLibraryUpdater() {
|
||||
const callback = () => {
|
||||
this.spotifyService.runUpdaterForAllEntities();
|
||||
};
|
||||
const timeoutMs =
|
||||
this.config.get<number>("SPOTIFY_UPDATE_INTERVAL_SEC") * 1000;
|
||||
|
||||
const interval = setInterval(callback, timeoutMs);
|
||||
|
||||
this.registry.addInterval("updater_spotify", interval);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue