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:
@@ -1,6 +1,7 @@
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { CantiService } from './canti.service';
|
||||
import { MyCantiService } from './my-canti.service';
|
||||
import { ComunitaService } from './comunita.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -8,6 +9,7 @@ import { MyCantiService } from './my-canti.service';
|
||||
export class MediaSessionService {
|
||||
private cantiService = inject(CantiService);
|
||||
private myCantiService = inject(MyCantiService);
|
||||
private comunitaService = inject(ComunitaService);
|
||||
|
||||
public updateMetadata(cantoId: string) {
|
||||
if (!('mediaSession' in navigator)) return;
|
||||
@@ -16,6 +18,9 @@ export class MediaSessionService {
|
||||
if (!canto) {
|
||||
canto = this.myCantiService.myCanti().find(c => c.id === cantoId);
|
||||
}
|
||||
if (!canto) {
|
||||
canto = this.comunitaService.comunitaCantiPersonali().find(c => c.id === cantoId);
|
||||
}
|
||||
if (!canto) return;
|
||||
|
||||
const thumb = this.cantiService.getYoutubeThumb(canto.link_youtube) || 'assets/icons/icon-512x512.png';
|
||||
|
||||
Reference in New Issue
Block a user