This commit is contained in:
2026-03-15 12:50:33 +01:00
parent dd68a6b21d
commit d907c89eb6
36 changed files with 309 additions and 286 deletions

View File

@@ -75,11 +75,12 @@ export class SongComponent implements OnInit {
}
public ngOnInit(): void {
this.song$ = this.activatedRoute.params.pipe(
const song$ = this.activatedRoute.params.pipe(
map(param => param as {songId: string}),
map(param => param.songId),
switchMap(songId => this.songService.read$(songId))
);
this.song$ = song$;
this.files$ = this.activatedRoute.params.pipe(
map(param => param as {songId: string}),
@@ -87,7 +88,7 @@ export class SongComponent implements OnInit {
switchMap(songId => this.fileService.read$(songId))
);
this.songCount$ = combineLatest([this.user$, this.song$]).pipe(
this.songCount$ = combineLatest([this.userService.user$, song$]).pipe(
map(([user, song]) => {
if (!song) {
return 0;
@@ -111,10 +112,9 @@ export class SongComponent implements OnInit {
await this.router.navigateByUrl('/songs');
}
public async addSongToShow(show: Show, song: Song) {
if (!show) return;
const newId = await this.showSongService.new$(show?.id, song.id, false);
await this.showService.update$(show?.id, {order: [...show.order, newId ?? '']});
public async addSongToShow(show: Show, song: Song): Promise<void> {
const newId = await this.showSongService.new$(show.id, song.id, false);
await this.showService.update$(show.id, {order: [...show.order, newId ?? '']});
await this.router.navigateByUrl('/shows/' + show.id);
}
}