optimize song usage
This commit is contained in:
15
src/main.ts
15
src/main.ts
@@ -18,6 +18,7 @@ declare global {
|
||||
interface Window {
|
||||
wgeneratorAdmin?: {
|
||||
rebuildSongUsage(): Promise<unknown>;
|
||||
rebuildShowSongIds(): Promise<unknown>;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -49,6 +50,20 @@ bootstrapApplication(AppComponent, {
|
||||
const userService = appRef.injector.get(UserService);
|
||||
window.wgeneratorAdmin = {
|
||||
rebuildSongUsage: () => userService.rebuildSongUsage(),
|
||||
rebuildShowSongIds: async () => {
|
||||
console.info('[wgeneratorAdmin] rebuildShowSongIds started');
|
||||
const result = await userService.rebuildShowSongIds(progress => {
|
||||
console.info(
|
||||
`[wgeneratorAdmin] rebuildShowSongIds ${progress.processed}/${progress.total} shows processed`,
|
||||
{
|
||||
showId: progress.showId,
|
||||
showSongsProcessed: progress.showSongsProcessed,
|
||||
}
|
||||
);
|
||||
});
|
||||
console.info('[wgeneratorAdmin] rebuildShowSongIds finished', result);
|
||||
return result;
|
||||
},
|
||||
};
|
||||
})
|
||||
.catch(err => console.error(err));
|
||||
|
||||
Reference in New Issue
Block a user