Ottimizzazione UI player, rotazione head tilt invertita, prefisso playlist in Home e implementazione Identity QR modal e interceptor API

This commit is contained in:
David Frassi
2026-06-12 17:13:46 +02:00
parent 4d1883a45d
commit d023bb7d3f
31 changed files with 1706 additions and 160 deletions
+28
View File
@@ -53,6 +53,9 @@ export class SettingsService {
/** Avanzamento a pagine del karaoke manuale: true = i tasti next/prev voltano la pagina */
public karaokePageScrollMode = signal<boolean>(false);
/** Identificativo utente univoco per la gestione delle comunità */
public userUuid = signal<string>('');
private wakeLock: any = null;
// PWA installation signals
@@ -63,6 +66,22 @@ export class SettingsService {
public isAndroid = signal<boolean>(false);
constructor() {
// Gestione/Generazione ID utente univoco
let savedUuid = localStorage.getItem('user-uuid');
if (!savedUuid) {
if (typeof crypto !== 'undefined' && crypto.randomUUID) {
savedUuid = crypto.randomUUID();
} else {
savedUuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
const r = Math.random() * 16 | 0;
const v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
localStorage.setItem('user-uuid', savedUuid);
}
this.userUuid.set(savedUuid);
// Detect PWA status
try {
this.isStandalone.set(
@@ -117,6 +136,7 @@ export class SettingsService {
localStorage.setItem(migrationKey, 'true');
}
const savedChords = localStorage.getItem('show-chords-default');
if (savedChords !== null) {
this.showChordsDefault.set(savedChords === 'true');
@@ -397,6 +417,14 @@ export class SettingsService {
this.chordNotationPreference.set(val);
}
setUserUuid(uuid: string) {
const trimmed = uuid.trim();
if (trimmed) {
this.userUuid.set(trimmed);
localStorage.setItem('user-uuid', trimmed);
}
}
async installPwa() {
const promptEvent = this.deferredPrompt();
if (!promptEvent) {