mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-13 19:31:46 +00:00
feat: run prettier
This commit is contained in:
@ -93,7 +93,11 @@ export const getCookieFromWindow = async (win: BrowserWindow) => {
|
||||
|
||||
let config: DownloaderPluginConfig;
|
||||
|
||||
export const onMainLoad = async ({ window: _win, getConfig, ipc }: BackendContext<DownloaderPluginConfig>) => {
|
||||
export const onMainLoad = async ({
|
||||
window: _win,
|
||||
getConfig,
|
||||
ipc,
|
||||
}: BackendContext<DownloaderPluginConfig>) => {
|
||||
win = _win;
|
||||
config = await getConfig();
|
||||
|
||||
@ -107,7 +111,9 @@ export const onMainLoad = async ({ window: _win, getConfig, ipc }: BackendContex
|
||||
ipc.on('video-src-changed', (data: GetPlayerResponse) => {
|
||||
playingUrl = data.microformat.microformatDataRenderer.urlCanonical;
|
||||
});
|
||||
ipc.handle('download-playlist-request', async (url: string) => downloadPlaylist(url));
|
||||
ipc.handle('download-playlist-request', async (url: string) =>
|
||||
downloadPlaylist(url),
|
||||
);
|
||||
};
|
||||
|
||||
export const onConfigChange = (newConfig: DownloaderPluginConfig) => {
|
||||
@ -230,8 +236,7 @@ async function downloadSongUnsafe(
|
||||
const selectedPreset = config.selectedPreset ?? 'mp3 (256kbps)';
|
||||
let presetSetting: Preset;
|
||||
if (selectedPreset === 'Custom') {
|
||||
presetSetting =
|
||||
config.customPresetSetting ?? DefaultPresetList['Custom'];
|
||||
presetSetting = config.customPresetSetting ?? DefaultPresetList['Custom'];
|
||||
} else if (selectedPreset === 'Source') {
|
||||
presetSetting = DefaultPresetList['Source'];
|
||||
} else {
|
||||
@ -444,8 +449,7 @@ export async function downloadPlaylist(givenUrl?: string | URL) {
|
||||
}
|
||||
|
||||
const playlistId =
|
||||
getPlaylistID(givenUrl) ||
|
||||
getPlaylistID(new URL(playingUrl));
|
||||
getPlaylistID(givenUrl) || getPlaylistID(new URL(playingUrl));
|
||||
|
||||
if (!playlistId) {
|
||||
sendError(new Error('No playlist ID found'));
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import { app, BrowserWindow } from 'electron';
|
||||
import is from 'electron-is';
|
||||
|
||||
export const getFolder = (customFolder: string) => customFolder || app.getPath('downloads');
|
||||
export const getFolder = (customFolder: string) =>
|
||||
customFolder || app.getPath('downloads');
|
||||
export const defaultMenuDownloadLabel = 'Download playlist';
|
||||
|
||||
export const sendFeedback = (win: BrowserWindow, message?: unknown) => {
|
||||
|
||||
Reference in New Issue
Block a user