mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
chore(frontend): clean logging and lint suppressions
This commit is contained in:
1 parent
a1b0d9186c
commit
701cf23299
7 files changed
+54
-38
No files matched your search
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
@@ -141,6 +140,20 @@ export class PlaylistsService {
|
||||
return this.indexedDbMigrationPromise;
|
||||
}
|
||||
|
||||
private toPlaylistMeta(playlist: Playlist): Playlist {
|
||||
const playlistMeta = { ...playlist };
|
||||
delete playlistMeta.playlist;
|
||||
delete playlistMeta.items;
|
||||
delete playlistMeta.header;
|
||||
return playlistMeta;
|
||||
}
|
||||
|
||||
private toAutoUpdatePlaylistMeta(playlist: Playlist): Playlist {
|
||||
const playlistMeta = this.toPlaylistMeta(playlist);
|
||||
delete playlistMeta.favorites;
|
||||
return playlistMeta;
|
||||
}
|
||||
|
||||
private async migrateIndexedDbPlaylistsToSqlite(): Promise<void> {
|
||||
try {
|
||||
const electron = this.electronApi;
|
||||
@@ -366,10 +379,8 @@ export class PlaylistsService {
|
||||
const playlists = electron
|
||||
? await electron.dbGetAppPlaylists()
|
||||
: [];
|
||||
return (playlists as Playlist[]).map(
|
||||
({ playlist, items, header, ...rest }) => ({
|
||||
...(rest as Playlist),
|
||||
})
|
||||
return (playlists as Playlist[]).map((playlist) =>
|
||||
this.toPlaylistMeta(playlist)
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -377,11 +388,7 @@ export class PlaylistsService {
|
||||
return this.runOnIndexedDb(() =>
|
||||
firstValueFrom(this.dbService.getAll<Playlist>(DbStores.Playlists))
|
||||
).pipe(
|
||||
map((data) =>
|
||||
data.map(({ playlist, items, header, ...rest }) => ({
|
||||
...(rest as Playlist),
|
||||
}))
|
||||
)
|
||||
map((data) => data.map((playlist) => this.toPlaylistMeta(playlist)))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -855,15 +862,7 @@ export class PlaylistsService {
|
||||
map((playlists: Playlist[]) => {
|
||||
return playlists
|
||||
.filter((item) => item.autoRefresh)
|
||||
.map(
|
||||
({
|
||||
playlist,
|
||||
header,
|
||||
items,
|
||||
favorites,
|
||||
...rest
|
||||
}: Playlist) => rest
|
||||
);
|
||||
.map((playlist) => this.toAutoUpdatePlaylistMeta(playlist));
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ export class PortalStatusService {
|
||||
} else {
|
||||
return 'inactive';
|
||||
}
|
||||
} catch (error) {
|
||||
} catch {
|
||||
return 'unavailable';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,9 @@ export const SettingsStore = signalStore(
|
||||
showCaptions: store.showCaptions(),
|
||||
showDashboard: store.showDashboard(),
|
||||
startupBehavior: store.startupBehavior(),
|
||||
showExternalPlaybackBar: store.showExternalPlaybackBar!(),
|
||||
showExternalPlaybackBar:
|
||||
store.showExternalPlaybackBar?.() ??
|
||||
DEFAULT_SETTINGS.showExternalPlaybackBar,
|
||||
theme: store.theme(),
|
||||
mpvPlayerPath: store.mpvPlayerPath(),
|
||||
mpvPlayerArguments: store.mpvPlayerArguments(),
|
||||
@@ -146,20 +148,26 @@ export const SettingsStore = signalStore(
|
||||
remoteControl: store.remoteControl(),
|
||||
remoteControlPort: store.remoteControlPort(),
|
||||
epgUrl: store.epgUrl(),
|
||||
downloadFolder: store.downloadFolder!(),
|
||||
recordingFolder: store.recordingFolder!(),
|
||||
coverSize: store.coverSize!(),
|
||||
downloadFolder:
|
||||
store.downloadFolder?.() ?? DEFAULT_SETTINGS.downloadFolder,
|
||||
recordingFolder:
|
||||
store.recordingFolder?.() ??
|
||||
DEFAULT_SETTINGS.recordingFolder,
|
||||
coverSize: store.coverSize?.() ?? DEFAULT_SETTINGS.coverSize,
|
||||
preferUploadedEpgOverXtream:
|
||||
store.preferUploadedEpgOverXtream!(),
|
||||
store.preferUploadedEpgOverXtream?.() ??
|
||||
DEFAULT_SETTINGS.preferUploadedEpgOverXtream,
|
||||
};
|
||||
},
|
||||
|
||||
getDownloadFolder() {
|
||||
return store.downloadFolder!();
|
||||
return store.downloadFolder?.() ?? DEFAULT_SETTINGS.downloadFolder;
|
||||
},
|
||||
|
||||
getRecordingFolder() {
|
||||
return store.recordingFolder!();
|
||||
return (
|
||||
store.recordingFolder?.() ?? DEFAULT_SETTINGS.recordingFolder
|
||||
);
|
||||
},
|
||||
|
||||
getPlayer() {
|
||||
|
||||
Reference in new issue
Block a user