mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-12 11:01:45 +00:00
chore: improve readability
This commit is contained in:
@ -7,7 +7,7 @@ import { t } from '@/i18n';
|
||||
|
||||
import { QualitySettingButton } from './templates/quality-setting-button';
|
||||
|
||||
import type { YoutubePlayer } from '@/types/youtube-player';
|
||||
import type { MusicPlayer } from '@/types/music-player';
|
||||
|
||||
export default createPlugin({
|
||||
name: () => t('plugins.quality-changer.name'),
|
||||
@ -19,7 +19,7 @@ export default createPlugin({
|
||||
|
||||
backend({ ipc, window }) {
|
||||
ipc.handle(
|
||||
'ytmd:quality-changer',
|
||||
'peard:quality-changer',
|
||||
async (qualityLabels: string[], currentIndex: number) =>
|
||||
await dialog.showMessageBox(window, {
|
||||
type: 'question',
|
||||
@ -44,7 +44,7 @@ export default createPlugin({
|
||||
|
||||
renderer: {
|
||||
qualitySettingsButtonContainer: document.createElement('div'),
|
||||
onPlayerApiReady(api: YoutubePlayer, context) {
|
||||
onPlayerApiReady(api: MusicPlayer, context) {
|
||||
const chooseQuality = async (e: MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
|
||||
@ -53,7 +53,7 @@ export default createPlugin({
|
||||
const currentIndex = qualityLevels.indexOf(api.getPlaybackQuality());
|
||||
|
||||
const quality = (await context.ipc.invoke(
|
||||
'ytmd:quality-changer',
|
||||
'peard:quality-changer',
|
||||
api.getAvailableQualityLabels(),
|
||||
currentIndex,
|
||||
)) as {
|
||||
|
||||
Reference in New Issue
Block a user