persisting songs ins show
This commit is contained in:
@@ -11,6 +11,7 @@ import {songSwitch} from '../../../widget-modules/components/song-text/animation
|
||||
import {TextRenderingService} from '../../songs/services/text-rendering.service';
|
||||
import {Show} from '../../shows/services/show';
|
||||
import {GlobalSettings} from '../../../services/global-settings';
|
||||
import {ShowSongService} from '../../shows/services/show-song.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-monitor',
|
||||
@@ -28,10 +29,9 @@ export class MonitorComponent implements OnInit {
|
||||
public date: Date | null = null;
|
||||
public config$: Observable<Config | null>;
|
||||
|
||||
// private sections: Section[];
|
||||
|
||||
public constructor(
|
||||
private showService: ShowService,
|
||||
private showSongService: ShowSongService,
|
||||
private songService: SongService,
|
||||
private textRenderingService: TextRenderingService,
|
||||
private globalSettingsService: GlobalSettingsService,
|
||||
@@ -60,13 +60,12 @@ export class MonitorComponent implements OnInit {
|
||||
tap<Show>(_ => (this.zoom = _.presentationZoom ?? 30))
|
||||
)
|
||||
.pipe(
|
||||
switchMap((_: Show) => this.songService.read$(_.presentationSongId)),
|
||||
switchMap((_: Show) => this.showSongService.read$(_.id, _.presentationSongId)),
|
||||
filter(_ => !!_),
|
||||
map(_ => _ as Song)
|
||||
)
|
||||
.subscribe(_ => {
|
||||
this.song = _;
|
||||
// this.sections = this.textRenderingService.parse(_.text, null);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ export class RemoteComponent {
|
||||
this.showService.read$(change).subscribe(_ => (this.show = _));
|
||||
this.showSongService.list$(change).subscribe(_ => {
|
||||
this.showSongs = _;
|
||||
this.presentationSongs = _.map(song => this.songs.filter(f => f.id === song.songId)[0]).map(song => ({
|
||||
this.presentationSongs = _.map(song => ({
|
||||
id: song.id,
|
||||
title: song.title,
|
||||
sections: this.textRenderingService.parse(song.text, null),
|
||||
|
||||
Reference in New Issue
Block a user