Skip to content

Commit ad7858b

Browse files
committed
Merge branch 'master' into mdui
2 parents b64d7b3 + be3ae4d commit ad7858b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1160
-433
lines changed

src/config/defaults.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export interface DefaultConfig {
3131
likeButtons: string;
3232
proxy: string;
3333
startingPage: string;
34+
backgroundMaterial?: 'none' | 'mica' | 'acrylic' | 'tabbed';
3435
overrideUserAgent: boolean;
3536
usePodcastParticipantAsArtist: boolean;
3637
themes: string[];
@@ -39,7 +40,7 @@ export interface DefaultConfig {
3940
'plugins': Record<string, unknown>;
4041
}
4142

42-
const defaultConfig: DefaultConfig = {
43+
export const defaultConfig: DefaultConfig = {
4344
'window-size': {
4445
width: 1100,
4546
height: 550,
@@ -73,5 +74,3 @@ const defaultConfig: DefaultConfig = {
7374
},
7475
'plugins': {},
7576
};
76-
77-
export default defaultConfig;

src/config/index.ts

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
11
import { deepmergeCustom } from 'deepmerge-ts';
22

3-
import defaultConfig from './defaults';
4-
5-
import store, { type IStore } from './store';
6-
import plugins from './plugins';
7-
3+
import { store, type IStore } from './store';
84
import { restart } from '@/providers/app-controls';
95

6+
import type { defaultConfig } from './defaults';
7+
108
const deepmerge = deepmergeCustom({
119
mergeArrays: false,
1210
});
1311

14-
const set = (key: string, value: unknown) => {
12+
export { defaultConfig } from './defaults';
13+
export * as plugins from './plugins';
14+
15+
export const set = (key: string, value: unknown) => {
1516
store.set(key, value);
1617
};
17-
const setPartial = (key: string, value: object, defaultValue?: object) => {
18+
19+
export const setPartial = (
20+
key: string,
21+
value: object,
22+
defaultValue?: object,
23+
) => {
1824
const newValue = deepmerge(defaultValue ?? {}, store.get(key) ?? {}, value);
1925
store.set(key, newValue);
2026
};
2127

22-
function setMenuOption(key: string, value: unknown) {
28+
export const setMenuOption = (key: string, value: unknown) => {
2329
set(key, value);
2430
if (store.get('options.restartOnConfigChanges')) {
2531
restart();
2632
}
27-
}
33+
};
2834

2935
// MAGIC OF TYPESCRIPT
3036

@@ -74,18 +80,11 @@ type PathValue<T, K extends string> =
7480
? PathValue<T[A], B>
7581
: T;
7682

77-
const get = <Key extends Paths<typeof defaultConfig>>(key: Key) =>
83+
export const get = <Key extends Paths<typeof defaultConfig>>(key: Key) =>
7884
store.get(key) as PathValue<typeof defaultConfig, typeof key>;
7985

80-
export default {
81-
defaultConfig,
82-
get,
83-
set,
84-
setPartial,
85-
setMenuOption,
86-
edit: () => store.openInEditor(),
87-
watch(cb: Parameters<IStore['onDidAnyChange']>[0]) {
88-
store.onDidAnyChange(cb);
89-
},
90-
plugins,
86+
export const edit = () => store.openInEditor();
87+
88+
export const watch = (cb: Parameters<IStore['onDidAnyChange']>[0]) => {
89+
store.onDidAnyChange(cb);
9190
};

src/config/plugins.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { deepmerge } from 'deepmerge-ts';
22
import { allPlugins } from 'virtual:plugins';
33

4-
import store from './store';
4+
import { store } from './store';
55

66
import { restart } from '@/providers/app-controls';
77

@@ -68,13 +68,3 @@ export function enable(plugin: string) {
6868
export function disable(plugin: string) {
6969
setMenuOptions(plugin, { enabled: false }, []);
7070
}
71-
72-
export default {
73-
isEnabled,
74-
getPlugins,
75-
enable,
76-
disable,
77-
setOptions,
78-
setMenuOptions,
79-
getOptions,
80-
};

src/config/store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Store from 'electron-store';
22

3-
import defaults from './defaults';
3+
import { defaultConfig as defaults } from './defaults';
44

55
import { DefaultPresetList, type Preset } from '@/plugins/downloader/types';
66

@@ -257,7 +257,7 @@ const migrations = {
257257
},
258258
};
259259

260-
export default new Store({
260+
export const store = new Store({
261261
defaults: {
262262
...defaults,
263263
// README: 'plugin' uses deepmerge to populate the default values, so it is not necessary to include it here

src/i18n/resources/de.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,26 @@
853853
"description": "Fügt ein TouchBar-Widget für macOS-Benutzer hinzu",
854854
"name": "TouchBar"
855855
},
856+
"transparent-player": {
857+
"description": "Macht das Player-Fenster transparent",
858+
"name": "Transparent Player",
859+
"menu": {
860+
"opacity": {
861+
"label": "Hintergrund-Sichtbarkeit",
862+
"submenu": {
863+
"percent": "{{opacity}}%"
864+
}
865+
},
866+
"type": {
867+
"label": "Typ",
868+
"submenu": {
869+
"acrylic": "Acrylic",
870+
"mica": "Mica",
871+
"tabbed": "Tabbed"
872+
}
873+
}
874+
}
875+
},
856876
"tuna-obs": {
857877
"description": "Integration mit dem OBS-Plugin Tuna",
858878
"name": "Tuna OBS"

src/i18n/resources/en.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@
758758
"token": "Enter ListenBrainz user token"
759759
},
760760
"scrobble-alternative-title": "Use alternative titles",
761+
"scrobble-alternative-artist": "Use alternative artists",
761762
"scrobble-other-media": "Scrobble other media"
762763
},
763764
"name": "Scrobbler",
@@ -812,6 +813,14 @@
812813
"not-found": "⚠️ No lyrics found for this song."
813814
},
814815
"menu": {
816+
"preferred-provider": {
817+
"label": "Preferred Provider",
818+
"tooltip": "Choose the default provider to use",
819+
"none": {
820+
"label": "None",
821+
"tooltip": "No preferred provider"
822+
}
823+
},
815824
"default-text-string": {
816825
"label": "Default character between lyrics",
817826
"tooltip": "Choose the default character to use for the gap between lyrics"
@@ -874,6 +883,27 @@
874883
"description": "Adds a TouchBar widget for macOS users",
875884
"name": "TouchBar"
876885
},
886+
"transparent-player": {
887+
"description": "Makes the app window transparent",
888+
"name": "Transparent Player",
889+
"menu": {
890+
"opacity": {
891+
"label": "Opacity",
892+
"submenu": {
893+
"percent": "{{opacity}}%"
894+
}
895+
},
896+
"type": {
897+
"label": "Type",
898+
"submenu": {
899+
"acrylic": "Acrylic",
900+
"mica": "Mica",
901+
"tabbed": "Tabbed",
902+
"none": "None"
903+
}
904+
}
905+
}
906+
},
877907
"tuna-obs": {
878908
"description": "Integration with OBS's plugin Tuna",
879909
"name": "Tuna OBS"

src/i18n/resources/ko.json

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,19 @@
421421
}
422422
}
423423
},
424+
"custom-output-device": {
425+
"description": "미디어 출력 장치 구성",
426+
"menu": {
427+
"device-selector": "장치 선택"
428+
},
429+
"name": "출력 장치 커스텀",
430+
"prompt": {
431+
"device-selector": {
432+
"label": "사용할 미디어 출력 장치를 선택하세요",
433+
"title": "출력 장치 선택"
434+
}
435+
}
436+
},
424437
"disable-autoplay": {
425438
"description": "노래를 '일시 정지' 모드로 시작하게 합니다",
426439
"menu": {
@@ -444,7 +457,15 @@
444457
"hide-duration-left": "남은 재생 시간 숨기기",
445458
"hide-github-button": "GitHub 링크 버튼 숨기기",
446459
"play-on-youtube-music": "유튜브 뮤직에서 재생",
447-
"set-inactivity-timeout": "비활성 시간 제한 설정"
460+
"set-inactivity-timeout": "비활성 시간 제한 설정",
461+
"set-status-display-type": {
462+
"label": "상태 텍스트",
463+
"submenu": {
464+
"artist": "{아티스트} 듣는 중",
465+
"title": "{곡 제목} 듣는 중",
466+
"youtube-music": "YouTube Music 듣는 중"
467+
}
468+
}
448469
},
449470
"name": "디스코드 활동 상태",
450471
"prompt": {
@@ -736,6 +757,7 @@
736757
"listenbrainz": {
737758
"token": "ListenBrainz 유저 토큰 입력"
738759
},
760+
"scrobble-alternative-artist": "대체 아티스트 명 사용",
739761
"scrobble-alternative-title": "대체 제목 사용하기",
740762
"scrobble-other-media": "다른 미디어 스크로블하기"
741763
},
@@ -853,6 +875,27 @@
853875
"description": "macOS 사용자를 위한 TouchBar 위젯을 추가합니다",
854876
"name": "TouchBar"
855877
},
878+
"transparent-player": {
879+
"description": "애플리케이션 창을 투명하게 만듭니다",
880+
"menu": {
881+
"opacity": {
882+
"label": "불투명도",
883+
"submenu": {
884+
"percent": "{{opacity}}%"
885+
}
886+
},
887+
"type": {
888+
"label": "종류",
889+
"submenu": {
890+
"acrylic": "아크릴",
891+
"mica": "미카",
892+
"none": "없음",
893+
"tabbed": ""
894+
}
895+
}
896+
},
897+
"name": "투명 플레이어"
898+
},
856899
"tuna-obs": {
857900
"description": "OBS의 확장인 Tuna와의 통합을 활성화합니다",
858901
"name": "Tuna OBS"

src/i18n/resources/pt-BR.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,19 @@
421421
}
422422
}
423423
},
424+
"custom-output-device": {
425+
"description": "Configure um dispositivo de saída de mídia personalizado para músicas",
426+
"menu": {
427+
"device-selector": "Selecionar dispositivo"
428+
},
429+
"name": "Dispositivo de saída personalizado",
430+
"prompt": {
431+
"device-selector": {
432+
"label": "Escolha o dispositivo de saída de mídia que será usado",
433+
"title": "Selecionar dispositivo de saída"
434+
}
435+
}
436+
},
424437
"disable-autoplay": {
425438
"description": "Faz a música começar no modo \"pausado\"",
426439
"menu": {
@@ -444,7 +457,15 @@
444457
"hide-duration-left": "Ocultar duração restante",
445458
"hide-github-button": "Ocultar botão do GitHub",
446459
"play-on-youtube-music": "Reproduzir no YouTube Music",
447-
"set-inactivity-timeout": "Definir tempo limite de inatividade"
460+
"set-inactivity-timeout": "Definir tempo limite de inatividade",
461+
"set-status-display-type": {
462+
"label": "Texto de status",
463+
"submenu": {
464+
"artist": "Ouvindo {artist}",
465+
"title": "Ouvindo {song title}",
466+
"youtube-music": "Ouvindo YouTube Music"
467+
}
468+
}
448469
},
449470
"name": "Rich Presence do Discord",
450471
"prompt": {

src/i18n/resources/ru.json

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,19 @@
421421
}
422422
}
423423
},
424+
"custom-output-device": {
425+
"description": "Настройка устройства вывода медиа для песен",
426+
"menu": {
427+
"device-selector": "Выберите устройство"
428+
},
429+
"name": "Пользовательское устройство вывода",
430+
"prompt": {
431+
"device-selector": {
432+
"label": "Выберите устройство вывода медиа, которое будет использоваться",
433+
"title": "Выберите устройство вывода"
434+
}
435+
}
436+
},
424437
"disable-autoplay": {
425438
"description": "Запускает песню сразу на паузе",
426439
"menu": {
@@ -444,7 +457,15 @@
444457
"hide-duration-left": "Скрыть сколько осталось времени",
445458
"hide-github-button": "Скрыть ссылку на GitHub",
446459
"play-on-youtube-music": "Воспроизвести на YouTube Music",
447-
"set-inactivity-timeout": "Поставить таймер неактивности"
460+
"set-inactivity-timeout": "Поставить таймер неактивности",
461+
"set-status-display-type": {
462+
"label": "Текст статуса",
463+
"submenu": {
464+
"artist": "Слушает {исполнитель}",
465+
"title": "Слушает {название трека}",
466+
"youtube-music": "Слушает YouTube Music"
467+
}
468+
}
448469
},
449470
"name": "Discord Rich Presence",
450471
"prompt": {
@@ -736,6 +757,7 @@
736757
"listenbrainz": {
737758
"token": "Введите токен пользователя ListenBrainz"
738759
},
760+
"scrobble-alternative-artist": "Использовать альтернативных исполнителей",
739761
"scrobble-alternative-title": "Использовать альтернативные названия",
740762
"scrobble-other-media": "Скробблинг других медиа"
741763
},
@@ -853,6 +875,27 @@
853875
"description": "Добавляет виджет тачбара для пользователей macOS",
854876
"name": "Тачбар"
855877
},
878+
"transparent-player": {
879+
"description": "Делает окно приложения прозрачным",
880+
"menu": {
881+
"opacity": {
882+
"label": "Непрозрачность",
883+
"submenu": {
884+
"percent": "{{opacity}}%"
885+
}
886+
},
887+
"type": {
888+
"label": "Тип",
889+
"submenu": {
890+
"acrylic": "Acrylic",
891+
"mica": "Mica",
892+
"none": "Отключено",
893+
"tabbed": "Tabbed"
894+
}
895+
}
896+
},
897+
"name": "Прозрачный плеер"
898+
},
856899
"tuna-obs": {
857900
"description": "Интеграция с плагином Tuna от OBS",
858901
"name": "Tuna OBS"

0 commit comments

Comments
 (0)