gestione comunità
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Component, inject, computed } from '@angular/core';
|
||||
import { PlaylistService } from '../../services/playlist.service';
|
||||
import { CantiService } from '../../services/canti.service';
|
||||
import { ComunitaService } from '../../services/comunita.service';
|
||||
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
|
||||
import { AlertController, ToastController, ModalController } from '@ionic/angular';
|
||||
import { Router } from '@angular/router';
|
||||
@@ -14,6 +15,7 @@ import { Router } from '@angular/router';
|
||||
export class PlaylistPage {
|
||||
public playlistService = inject(PlaylistService);
|
||||
public cantiService = inject(CantiService);
|
||||
public comunitaService = inject(ComunitaService);
|
||||
private alertCtrl = inject(AlertController);
|
||||
private toastCtrl = inject(ToastController);
|
||||
private router = inject(Router);
|
||||
@@ -177,4 +179,11 @@ export class PlaylistPage {
|
||||
});
|
||||
await toast.present();
|
||||
}
|
||||
|
||||
getCommunitySongNumber(song: any): string | null {
|
||||
if (!this.comunitaService.comunitaCode() || !this.comunitaService.isFilterActive()) return null;
|
||||
const cantiInfo = this.comunitaService.comunitaCantiInfo();
|
||||
const info = cantiInfo.find(x => x.id_canti === song.id_canti || x.id_canti === Number(song.id));
|
||||
return info && info.num_canto ? info.num_canto.toString() : null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user