feat: integrato il supporto ai canti personalizzati (non validati) della parrocchia
- Recuperato il campo 'canti_personali' dalle tabelle dell'API parrocchiale. - Mappato ed integrato il segnale 'comunitaCantiPersonali' in locale e salvato su localStorage. - Permesso il caricamento e l'interrogazione corretta dei brani custom in HomePage, PlayerPage, DisplayPage, YoutubePlayerService e MediaSessionService. - Risolto il disallineamento per cui la parrocchia 123456 mostrava 196 brani anziché 208.
This commit is contained in:
@@ -2,6 +2,7 @@ import { Component, OnInit, OnDestroy, signal, computed, effect, inject } from '
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { CantiService, Canto } from '../../services/canti.service';
|
||||
import { LyricsParserService, ParsedSection } from '../../services/lyrics-parser.service';
|
||||
import { ComunitaService } from '../../services/comunita.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-display',
|
||||
@@ -54,13 +55,18 @@ export class DisplayPage implements OnInit, OnDestroy {
|
||||
private route = inject(ActivatedRoute);
|
||||
private cantiService = inject(CantiService);
|
||||
private lyricsParser = inject(LyricsParserService);
|
||||
private comunitaService = inject(ComunitaService);
|
||||
|
||||
constructor() {
|
||||
effect(() => {
|
||||
const id = this.activeSongId();
|
||||
const allCanti = this.cantiService.canti();
|
||||
const comunitaCantiPers = this.comunitaService.comunitaCantiPersonali();
|
||||
if (id) {
|
||||
const found = allCanti.find(c => c.id === id);
|
||||
let found = allCanti.find(c => c.id === id);
|
||||
if (!found) {
|
||||
found = comunitaCantiPers.find(c => c.id === id);
|
||||
}
|
||||
if (found) {
|
||||
this.canto.set(found);
|
||||
}
|
||||
|
||||
@@ -160,12 +160,16 @@ export class PlayerPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
const id = this.activeSongId();
|
||||
const allCanti = this.cantiService.canti();
|
||||
const myCantiList = this.myCantiService.myCanti();
|
||||
const comunitaCantiPers = this.comunitaService.comunitaCantiPersonali();
|
||||
|
||||
if (id) {
|
||||
let found = allCanti.find(c => c.id === id);
|
||||
if (!found) {
|
||||
found = myCantiList.find(c => c.id === id);
|
||||
}
|
||||
if (!found) {
|
||||
found = comunitaCantiPers.find(c => c.id === id);
|
||||
}
|
||||
|
||||
if (found) {
|
||||
const current = this.canto();
|
||||
|
||||
Reference in New Issue
Block a user