mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-29 07:17:44 +02:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| da445b815d | |||
| c875146779 | |||
| 9806d2f553 | |||
| 18a7fd0731 | |||
| 062617bb40 | |||
| f8ca8861fc | |||
| 26eea7422d | |||
| 21d788226c | |||
| 9a1bf8f4a9 | |||
| 0fab3ba318 | |||
| 5ddbfcbfee | |||
| b6519e9839 | |||
| 2103c3b8c6 | |||
| 4a7f084b59 | |||
| 5ef4744c44 | |||
| ecda4ef8bc | |||
| 0ed68e8ebb | |||
| 417365f091 |
@@ -71,4 +71,5 @@ publish:
|
||||
provider: s3
|
||||
bucket: feishin-nightly
|
||||
channel: alpha
|
||||
region: auto
|
||||
endpoint: https://065f090c64de2dc707dd70ac72db9669.r2.cloudflarestorage.com
|
||||
|
||||
+4
-2
@@ -99,7 +99,7 @@
|
||||
"clsx": "^2.1.1",
|
||||
"cmdk": "^1.1.1",
|
||||
"dayjs": "^1.11.21",
|
||||
"dompurify": "^3.4.8",
|
||||
"dompurify": "^3.4.11",
|
||||
"electron-debug": "^3.2.0",
|
||||
"electron-localshortcut": "^3.2.1",
|
||||
"electron-log": "^5.4.4",
|
||||
@@ -114,6 +114,8 @@
|
||||
"idb-keyval": "^6.2.5",
|
||||
"immer": "^10.2.0",
|
||||
"is-electron": "^2.2.2",
|
||||
"kuroshiro": "^1.2.0",
|
||||
"kuroshiro-analyzer-kuromoji": "^1.1.0",
|
||||
"lodash": "^4.18.1",
|
||||
"md5": "^2.3.0",
|
||||
"motion": "^12.40.0",
|
||||
@@ -160,7 +162,7 @@
|
||||
"concurrently": "^9.2.1",
|
||||
"cross-env": "^10.1.0",
|
||||
"electron": "^41.7.1",
|
||||
"electron-builder": "^26.15.0",
|
||||
"electron-builder": "^26.15.5",
|
||||
"electron-devtools-installer": "^4.0.0",
|
||||
"electron-vite": "^4.0.1",
|
||||
"eslint": "^9.39.4",
|
||||
|
||||
Generated
+133
-376
File diff suppressed because it is too large
Load Diff
@@ -973,7 +973,43 @@
|
||||
"autoDJ_albumStrategy": "Mode de selecció d'àlbum",
|
||||
"autoDJ_songStrategy": "Mode de selecció de cançó",
|
||||
"autoDJ_strategy_option_library_random": "A l'atzar",
|
||||
"autoDJ_strategy_option_similar": "Similar"
|
||||
"autoDJ_strategy_option_similar": "Similar",
|
||||
"enableFurigana_description": "Mostra guies de pronunciació (furigana) per les lletres en japonès.",
|
||||
"enableFurigana": "Activa la generació de furigana",
|
||||
"equalizer_descriptionMpv": "Equalitzador paramètric amb FFmpeg lavfi (MPV)",
|
||||
"equalizer_descriptionWebAudio": "Equalitzador paramètric amb l'API de Web Audio",
|
||||
"equalizer": "Equalitzador",
|
||||
"equalizerBands_description": "Guany per banda. Arrossegueu-lo amunt o avall, o introduïu-hi un valor. Rang: -12 a +12 dB.",
|
||||
"equalizerBands": "Bandes",
|
||||
"equalizerPreamp_description": "Guany d'entrada previ a les bandes de l'equalitzador. Poseu-lo en negatiu quan realceu les bandes per evitar el clipping (MPV).",
|
||||
"equalizerPreamp": "Preamplificador",
|
||||
"equalizerPreset_description": "Aplica una corba d'equalitzador personalitzada integrada o desada",
|
||||
"equalizerPreset": "Preajustament",
|
||||
"equalizerPresetDeletePlaceholder": "Elimina la personalització...",
|
||||
"equalizerPresetGroupBuiltIn": "Integrat",
|
||||
"equalizerPresetGroupCustom": "Personalitzat",
|
||||
"equalizerPresetNamePlaceholder": "Nom de l'ajust predefinit...",
|
||||
"equalizerPresetSelectPlaceholder": "Seleccioneu un ajust predefinit",
|
||||
"equalizerSavePreset_description": "Desa la configuració actual de l'equalitzador com a ajust predefinit amb nom",
|
||||
"equalizerSavePreset": "Desa l'ajust",
|
||||
"compressor_descriptionMpv": "Compressor de rang dinàmic amb el compressor de FFmpeg (MPV)",
|
||||
"compressor_descriptionWebAudio": "Compressor de rang dinàmic amb l'API de Web Audio",
|
||||
"compressor": "Compressor",
|
||||
"compressorAttack_description": "La rapidesa amb què el compressor s'activa quan el senyal excedeix el llindar.",
|
||||
"compressorAttack": "Atac",
|
||||
"compressorKnee_description": "Amplada de la zona de resposta suau. Com més alt sigui, més gradual serà la transició cap a la compressió.",
|
||||
"compressorKnee": "Zona de resposta",
|
||||
"compressorMakeupGain_description": "Guany de sortida aplicat després de la compressió per recuperar volum.",
|
||||
"compressorMakeupGain": "Guany de compensació",
|
||||
"compressorPreset_description": "Aplica una configuració personalitzada del compressor integrada o desada",
|
||||
"compressorRatio_description": "Ràtio de compressio, p. ex. 4 = 4:1.",
|
||||
"compressorRatio": "Ràtio",
|
||||
"compressorRelease_description": "Com de ràpid el compressor es desactiva un cop el senyal sigui inferior al llindar.",
|
||||
"compressorRelease": "Desactivació",
|
||||
"compressorReset_description": "Restaura tots els paràmetres del compressor als seus valors per defecte",
|
||||
"compressorSavePreset_description": "Desa la configuració actual del compressor com un ajust predefinit amb nom",
|
||||
"compressorThreshold_description": "Nivell de senyal a partir del qual comença la compressió.",
|
||||
"compressorThreshold": "Llindar"
|
||||
},
|
||||
"table": {
|
||||
"column": {
|
||||
@@ -1266,7 +1302,9 @@
|
||||
"notContains": "No conté",
|
||||
"notInPlaylist": "No és a",
|
||||
"notInTheLast": "No és a l'últim",
|
||||
"startsWith": "Comença amb"
|
||||
"startsWith": "Comença amb",
|
||||
"isMissing": "Falta",
|
||||
"isPresent": "Està present"
|
||||
},
|
||||
"queryBuilder": {
|
||||
"standardTags": "Etiquetes estàndard",
|
||||
|
||||
@@ -457,7 +457,45 @@
|
||||
"autoDJ_albumStrategy": "Režim výběru alb",
|
||||
"autoDJ_songStrategy": "Režim výběru skladeb",
|
||||
"autoDJ_strategy_option_library_random": "Náhodně",
|
||||
"autoDJ_strategy_option_similar": "Podobné"
|
||||
"autoDJ_strategy_option_similar": "Podobné",
|
||||
"enableFurigana_description": "Zobrazit návody na výslovnost (furigana) u japonských kandži textů.",
|
||||
"enableFurigana": "Povolit generování furigana",
|
||||
"equalizer_descriptionMpv": "Parametrický ekvalizér skrze FFmpeg lavfi (MPV)",
|
||||
"equalizer_descriptionWebAudio": "Parametrický ekvalizér skrze Web Audio API",
|
||||
"equalizer": "Ekvalizér",
|
||||
"equalizerBands_description": "Zisk na pásmo. Posuňte nahoru/dolů nebo zadejte hodnotu. Rozsah: -12 do +12 dB.",
|
||||
"equalizerBands": "Pásma",
|
||||
"equalizerPreamp_description": "Vstupní zisk před pásmy ekvalizéru. Při zvýšení pásem nastavte na negativní hodnotu pro zabránění clippingu (MPV).",
|
||||
"equalizerPreamp": "Předzesilovač",
|
||||
"equalizerPreset_description": "Použít vestavěnou nebo uloženou vlastní křivku ekvalizéru",
|
||||
"equalizerPreset": "Předvolba",
|
||||
"equalizerPresetDeletePlaceholder": "Odstranit vlastní…",
|
||||
"equalizerPresetGroupBuiltIn": "Vestavěná",
|
||||
"equalizerPresetGroupCustom": "Vlastní",
|
||||
"equalizerPresetNamePlaceholder": "Název předvolby…",
|
||||
"equalizerPresetSelectPlaceholder": "Vybrat předvolbu",
|
||||
"equalizerSavePreset_description": "Uložit aktuální nastavení ekvalizéru jako pojmenovanou předvolbu",
|
||||
"equalizerSavePreset": "Uložit předvolbu",
|
||||
"compressor_descriptionMpv": "Kompresor dynamického rozsahu skrze FFmpeg acompressor (MPV)",
|
||||
"compressor_descriptionWebAudio": "Kompresor dynamického rozsahu skrze Web Audio API",
|
||||
"compressor": "Kompresor",
|
||||
"compressorAttack_description": "Jak rychle se kompresor spustí, když signál překročí hranici.",
|
||||
"compressorAttack": "Útok",
|
||||
"compressorKnee_description": "Měkká šířka. Čím vyšší jsou hodnoty, tím pozvolnější je přechod do komprese.",
|
||||
"compressorKnee": "Koleno",
|
||||
"compressorMakeupGain_description": "Výstupní zesílení aplikované po kompresi za účelem obnovení hlasitosti.",
|
||||
"compressorMakeupGain": "Následný zisk",
|
||||
"compressorPreset_description": "Použít vestavěné nebo uložené vlastní nastavení kompresoru",
|
||||
"compressorRatio_description": "Poměr komprese, např. 4 = 4:1.",
|
||||
"compressorRatio": "Poměr",
|
||||
"compressorRelease_description": "Jak rychle se kompresor uvolní, když signál spadne pod nastavenou hranici.",
|
||||
"compressorRelease": "Uvolnění",
|
||||
"compressorReset_description": "Obnovit všechny parametry kompresoru na jejich výchozí hodnoty",
|
||||
"compressorSavePreset_description": "Uložit aktuální nastavení kompresoru jako pojmenovanou předvolbu",
|
||||
"compressorThreshold_description": "Úroveň signálu, nad kterou začne komprese.",
|
||||
"compressorThreshold": "Hranice",
|
||||
"enableRomaji_description": "Zobrazit rómadži výslovnost pod japonskými texty.",
|
||||
"enableRomaji": "Povolit generování rómadži"
|
||||
},
|
||||
"action": {
|
||||
"editPlaylist": "Upravit $t(entity.playlist, {\"count\": 1})",
|
||||
|
||||
@@ -843,6 +843,26 @@
|
||||
"discordUpdateInterval_description": "The time in seconds between each update (minimum 15 seconds)",
|
||||
"enableAutoTranslation_description": "Enable translation automatically when lyrics are loaded",
|
||||
"enableAutoTranslation": "Enable auto translation",
|
||||
"enableFurigana_description": "Display pronunciation guides (furigana) over Japanese kanji lyrics.",
|
||||
"enableFurigana": "Enable furigana generation",
|
||||
"enableRomaji_description": "Display a romaji pronunciation line under Japanese lyrics.",
|
||||
"enableRomaji": "Enable romaji generation",
|
||||
"equalizer_descriptionMpv": "Parametric equalizer via FFmpeg lavfi (MPV)",
|
||||
"equalizer_descriptionWebAudio": "Parametric equalizer via Web Audio API",
|
||||
"equalizer": "Equalizer",
|
||||
"equalizerBands_description": "Per-band gain. Drag up/down or type a value. Range: -12 to +12 dB.",
|
||||
"equalizerBands": "Bands",
|
||||
"equalizerPreamp_description": "Input gain before EQ bands. Set negative when boosting bands to prevent clipping (MPV).",
|
||||
"equalizerPreamp": "Preamp",
|
||||
"equalizerPreset_description": "Apply a built-in or saved custom EQ curve",
|
||||
"equalizerPreset": "Preset",
|
||||
"equalizerPresetDeletePlaceholder": "Delete custom...",
|
||||
"equalizerPresetGroupBuiltIn": "Built-in",
|
||||
"equalizerPresetGroupCustom": "Custom",
|
||||
"equalizerPresetNamePlaceholder": "Preset name...",
|
||||
"equalizerPresetSelectPlaceholder": "Select preset",
|
||||
"equalizerSavePreset_description": "Save the current EQ settings as a named preset",
|
||||
"equalizerSavePreset": "Save preset",
|
||||
"enableRemote_description": "Enables the remote control server to allow other devices to control the application",
|
||||
"enableRemote": "Enable remote control server",
|
||||
"exitToTray_description": "Exit the application to the system tray",
|
||||
@@ -1024,6 +1044,24 @@
|
||||
"showVisualizerInSidebar": "Show visualizer in player sidebar",
|
||||
"combinedLyricsAndVisualizer_description": "Combine lyrics and visualizer into the same panel",
|
||||
"combinedLyricsAndVisualizer": "Combine lyrics and visualizer in player sidebar",
|
||||
"compressor_descriptionMpv": "Dynamic range compressor via FFmpeg acompressor (MPV)",
|
||||
"compressor_descriptionWebAudio": "Dynamic range compressor via Web Audio API",
|
||||
"compressor": "Compressor",
|
||||
"compressorAttack_description": "How quickly the compressor engages after the signal exceeds the threshold.",
|
||||
"compressorAttack": "Attack",
|
||||
"compressorKnee_description": "Soft-knee width. Higher values make the transition into compression more gradual.",
|
||||
"compressorKnee": "Knee",
|
||||
"compressorMakeupGain_description": "Output gain applied after compression to restore loudness.",
|
||||
"compressorMakeupGain": "Makeup Gain",
|
||||
"compressorPreset_description": "Apply a built-in or saved custom compressor setting",
|
||||
"compressorRatio_description": "Compression ratio, e.g. 4 = 4:1.",
|
||||
"compressorRatio": "Ratio",
|
||||
"compressorRelease_description": "How quickly the compressor releases after the signal drops below the threshold.",
|
||||
"compressorRelease": "Release",
|
||||
"compressorReset_description": "Restore all compressor parameters to their default values",
|
||||
"compressorSavePreset_description": "Save the current compressor settings as a named preset",
|
||||
"compressorThreshold_description": "Signal level above which compression begins.",
|
||||
"compressorThreshold": "Threshold",
|
||||
"preservePitch_description": "Preserves pitch when modifying playback speed",
|
||||
"preservePitch": "Preserve pitch",
|
||||
"audioFadeOnStatusChange": "Audio fade on status change",
|
||||
@@ -1137,6 +1175,8 @@
|
||||
"webAudio": "Use web audio",
|
||||
"windowBarStyle_description": "Select the style of the window bar",
|
||||
"windowBarStyle": "Window bar style",
|
||||
"windowBarTrackinfo": "Track info in Window Title",
|
||||
"windowBarTrackinfo_description": "Show current track's title and artist, queue position, and Playing/Paused state in the Window's Title.",
|
||||
"zoom_description": "Sets the zoom percentage for the application",
|
||||
"zoom": "Zoom percentage",
|
||||
"queryBuilder": "Query builder",
|
||||
|
||||
@@ -457,7 +457,45 @@
|
||||
"autoDJ_songStrategy": "Modo de selección de canción",
|
||||
"autoDJ_strategy_option_library_random": "Aleatorio",
|
||||
"autoDJ_strategy_option_similar": "Similar",
|
||||
"autoDJ_mode_description": "Elegir para añadir canciones o álbumes enteros a la cola"
|
||||
"autoDJ_mode_description": "Elegir para añadir canciones o álbumes enteros a la cola",
|
||||
"enableFurigana_description": "Mostrar guías de pronunciación (furigana) sobre letras kanji japonesas.",
|
||||
"enableFurigana": "Activar generación de furigana",
|
||||
"equalizer_descriptionMpv": "Ecualizador paramétrico a través de FFmpeg lavfi (MPV)",
|
||||
"equalizer_descriptionWebAudio": "Ecualizador paramétrico a través de la API de Web Audio",
|
||||
"equalizer": "Ecualizador",
|
||||
"equalizerBands": "Bandas",
|
||||
"equalizerBands_description": "Ganancia por banda. Arrastrar arriba/abajo o escribir un valor. Rango: -12 a +12 dB.",
|
||||
"equalizerPreamp_description": "Ganancia de entrada antes de las bandas de ecualización. Ajústala en negativo al realzar las bandas para evitar el clipping (MPV).",
|
||||
"equalizerPreamp": "Preamplificador",
|
||||
"equalizerPreset_description": "Aplica una curva de ecualizador personalizada integrada o guardada",
|
||||
"equalizerPreset": "Preajuste",
|
||||
"equalizerPresetDeletePlaceholder": "Elimianr personalizado...",
|
||||
"equalizerPresetGroupBuiltIn": "Integrado",
|
||||
"equalizerPresetGroupCustom": "Personalizado",
|
||||
"equalizerPresetNamePlaceholder": "Nombre del preajuste...",
|
||||
"equalizerPresetSelectPlaceholder": "Seleccionar preajuste",
|
||||
"equalizerSavePreset": "Guardar preajuste",
|
||||
"equalizerSavePreset_description": "Guarda la configuración del ecualizador actual como un preajuste nombrado",
|
||||
"compressor_descriptionMpv": "Compresor de rango dinámico a través del compresor de FFmpeg (MPV)",
|
||||
"compressor_descriptionWebAudio": "Compresor de rango dinámico a través de la API de Web Audio",
|
||||
"compressor": "Compresor",
|
||||
"compressorThreshold": "Umbral",
|
||||
"compressorThreshold_description": "Nivel de señal a partir del cual comienza la compresión.",
|
||||
"compressorSavePreset_description": "Guarda la configuración actual del compresor como un preajuste nombrado",
|
||||
"compressorReset_description": "Restaura todos los parámetros del compresor a sus valores predeterminados",
|
||||
"compressorRelease": "Liberación",
|
||||
"compressorRelease_description": "La rapidez con la que el compresor se libera una vez que la señal desciende por debajo del umbral.",
|
||||
"compressorRatio": "Ratio",
|
||||
"compressorRatio_description": "Ratio de compresión, p. ej. 4 = 4:1.",
|
||||
"compressorPreset_description": "Aplica una configuración personalizada del compresor integrada o guardada",
|
||||
"compressorKnee_description": "Ancho de la zona de respuesta suave. Cuanto mayor sea el valor, más gradual será la transición hacia la compresión.",
|
||||
"compressorKnee": "Zona de respuesta",
|
||||
"compressorMakeupGain_description": "Ganancia de salida aplicada tras la compresión para recuperar el volumen.",
|
||||
"compressorMakeupGain": "Ganancia de compensación",
|
||||
"compressorAttack_description": "La rapidez con la que el compresor entra en acción una vez que la señal supera el umbral.",
|
||||
"compressorAttack": "Ataque",
|
||||
"enableRomaji_description": "Muestra una línea de pronunciación en romaji debajo de las letras japonesas.",
|
||||
"enableRomaji": "Activar generación de romaji"
|
||||
},
|
||||
"action": {
|
||||
"editPlaylist": "Editar $t(entity.playlist, {\"count\": 1})",
|
||||
|
||||
@@ -1135,7 +1135,43 @@
|
||||
"queryBuilderCustomFields_inputLabel": "Nimetus",
|
||||
"queryBuilderCustomFields_inputTag": "Silt",
|
||||
"queryBuilderCustomFields": "Kohandatud väljad",
|
||||
"queryBuilderCustomFields_description": "Lisa kohandatud välju, mida päringukoosturis kasutada"
|
||||
"queryBuilderCustomFields_description": "Lisa kohandatud välju, mida päringukoosturis kasutada",
|
||||
"equalizer_descriptionMpv": "Parametriline ekvalaiser FFmpeg lavfi (MPV) kaudu",
|
||||
"equalizer_descriptionWebAudio": "Parametriline ekvalaiser Web Audio API kaudu",
|
||||
"equalizer": "Ekvalaiser",
|
||||
"equalizerBands_description": "Riba põhivõimendus. Lohista üles/alla või sisesta väärtus. Vahemik: -12 kuni +12 dB.",
|
||||
"equalizerBands": "Ribad",
|
||||
"equalizerPreamp_description": "Sisendvõimendus enne ekvalaiseri ribasid. Moonutuste vältimiseks määra ribade võimendamisel negatiivne väärtus (MPV).",
|
||||
"equalizerPreamp": "Eelvõimendus",
|
||||
"equalizerPreset_description": "Rakenda sisseehitatud või salvestatud kohandatud EQ-häälestus",
|
||||
"equalizerPreset": "Eelseadistus",
|
||||
"equalizerPresetDeletePlaceholder": "Kustuta kohandatud...",
|
||||
"equalizerPresetGroupBuiltIn": "Sisseehitatud",
|
||||
"equalizerPresetGroupCustom": "Kohandatud",
|
||||
"equalizerPresetNamePlaceholder": "Eelseadistuse nimi...",
|
||||
"equalizerPresetSelectPlaceholder": "Vali eelseadistus",
|
||||
"equalizerSavePreset_description": "Salvesta praegused EQ-seaded nimetatud eelseadistusena",
|
||||
"equalizerSavePreset": "Salvesta eelseadistus",
|
||||
"compressor_descriptionMpv": "Dünaamilise vahemiku kompressor FFmpeg acompressori kaudu (MPV)",
|
||||
"compressor_descriptionWebAudio": "Dünaamilise vahemiku kompressor Web Audio API kaudu",
|
||||
"enableFurigana_description": "Kuva jaapani kanji-märkide kohal hääldusjuhiseid (furigana).",
|
||||
"enableFurigana": "Luba furigana kuvamine",
|
||||
"compressor": "Kompressor",
|
||||
"compressorAttack_description": "Kui kiiresti kompressor pärast läve ületamist rakendub.",
|
||||
"compressorAttack": "Rakendumisaeg",
|
||||
"compressorKnee_description": "Sujuva ülemineku (soft-knee) ulatus. Suuremad väärtused muudavad kompressiooni rakendumise astmelisemaks.",
|
||||
"compressorKnee": "Üleminek",
|
||||
"compressorMakeupGain_description": "Väljundvõimendus helitugevuse taastamiseks pärast kompressiooni.",
|
||||
"compressorMakeupGain": "Väljundvõimendus",
|
||||
"compressorPreset_description": "Rakenda sisseehitatud või salvestatud kohandatud kompressoriseadistus",
|
||||
"compressorRatio_description": "Kompressiooniaste, nt 4 = 4:1.",
|
||||
"compressorRatio": "Kompressiooniaste",
|
||||
"compressorRelease_description": "Kui kiiresti kompressiooni mõju pärast lävest allapoole langemist lakkab.",
|
||||
"compressorRelease": "Vabastusaeg",
|
||||
"compressorReset_description": "Taasta kõigi kompressori parameetrite vaikeväärtused",
|
||||
"compressorSavePreset_description": "Salvesta praegused kompressori seaded nimetatud eelseadistusena",
|
||||
"compressorThreshold_description": "Signaali tase, mida ületades kompressioon algab.",
|
||||
"compressorThreshold": "Lävi"
|
||||
},
|
||||
"datetime": {
|
||||
"minuteShort": "m",
|
||||
|
||||
@@ -1108,7 +1108,43 @@
|
||||
"autoDJ_albumStrategy": "Tryb wyboru albumów",
|
||||
"autoDJ_songStrategy": "Tryb wyboru piosenek",
|
||||
"autoDJ_strategy_option_library_random": "Losowo",
|
||||
"autoDJ_strategy_option_similar": "Podobne"
|
||||
"autoDJ_strategy_option_similar": "Podobne",
|
||||
"enableFurigana_description": "Wyświetlaj pomoce wymowy (furigana) nad tekstami Japońskimi kanji.",
|
||||
"enableFurigana": "Włącz generowanie furigana",
|
||||
"equalizer_descriptionMpv": "Equalizer parametryczny przez FFmpeg lavfi (MPV)",
|
||||
"equalizer_descriptionWebAudio": "Parametryczny equalizer przez API Web Audio",
|
||||
"equalizer": "Equalizer",
|
||||
"equalizerBands_description": "Wzmocnienie dla poszczególnych pasm. Przesuń w górę/dół lub wpisz wartość. Zakres: -12 do +12 dB.",
|
||||
"equalizerBands": "Pasma",
|
||||
"equalizerPreamp_description": "Wzmocnienie sygnału przed pasmami EQ. Ustaw na wartość ujemną podczas wzmacniania pasm, aby zapobiec przesterowaniu (MPV).",
|
||||
"equalizerPreamp": "Przedwzmacnianie",
|
||||
"equalizerPreset_description": "Zastosuj wbudowaną lub niestandardową zapisaną krzywą EQ",
|
||||
"equalizerPreset": "Ustawienia wstępne",
|
||||
"equalizerPresetDeletePlaceholder": "Usuń niestandardowe...",
|
||||
"equalizerPresetGroupBuiltIn": "Wbudowane",
|
||||
"equalizerPresetGroupCustom": "Niestandardowe",
|
||||
"equalizerPresetNamePlaceholder": "Nazwa ustawień wstępnych...",
|
||||
"equalizerPresetSelectPlaceholder": "Wybierz ustawienia wstępne",
|
||||
"equalizerSavePreset_description": "Zapisz aktualne ustawienia EQ jako nazwany zestaw ustawień wstępnych",
|
||||
"equalizerSavePreset": "Zapisz ustawienia wstępne",
|
||||
"compressor_descriptionMpv": "Kompresor zakresu dynamicznego przez FFmpeg acompressor (MPV)",
|
||||
"compressor_descriptionWebAudio": "Kompresor zakresu dynamicznego poprzez API Web Audio",
|
||||
"compressor": "Kompresor",
|
||||
"compressorAttack_description": "Jak szybko załączany jest kompresor po przekroczeniu progu przez sygnał.",
|
||||
"compressorAttack": "Attack",
|
||||
"compressorKnee_description": "Szerokośc soft-knee. Większe wartości powodują przejście do kompresji bardziej stopniowym.",
|
||||
"compressorKnee": "Knee",
|
||||
"compressorMakeupGain_description": "Zwiększenie wyjściowe dodawane po kompresji aby, przywrócić głośność.",
|
||||
"compressorMakeupGain": "Makeup Gain",
|
||||
"compressorPreset_description": "Zastosuj wbudowane lub niestandardowe zapisane ustawienie kompresora",
|
||||
"compressorRatio_description": "Proporcje kompresji, np. 4 = 4:1.",
|
||||
"compressorRatio": "Proporcje",
|
||||
"compressorRelease_description": "Jak szybko kompresor odpuszcza po spadnięciu sygnału poniżej progu.",
|
||||
"compressorRelease": "Odpuszczenie",
|
||||
"compressorReset_description": "Przywróć wszystkie parametry kompresora do wartości domyślnych",
|
||||
"compressorSavePreset_description": "Zapisz aktualne ustawienia kompresora jako nazwany zestaw ustawień wstępnych",
|
||||
"compressorThreshold_description": "Poziom sygnału nad którym rozpoczyna się kompresja.",
|
||||
"compressorThreshold": "Próg"
|
||||
},
|
||||
"table": {
|
||||
"config": {
|
||||
|
||||
+186
-8
@@ -40,7 +40,10 @@
|
||||
"listenbrainz": "Відкрити у ListenBrainz",
|
||||
"qobuz": "Відкрити у Qobuz",
|
||||
"spotify": "Відкрити у Spotify"
|
||||
}
|
||||
},
|
||||
"goToCurrent": "Перейти до поточного елементу",
|
||||
"collapseAllFolders": "Згорнути всі папки",
|
||||
"expandAllFolders": "Розгорнути всі папки"
|
||||
},
|
||||
"common": {
|
||||
"countSelected": "Вибрано {{count}}",
|
||||
@@ -170,7 +173,8 @@
|
||||
"itemsMore": "{{count}} більше",
|
||||
"numberOfResults": "{{numberOfResults}} результатів",
|
||||
"newVersionAvailable": "Доступна нова версія",
|
||||
"back": "Повернутися"
|
||||
"back": "Повернутися",
|
||||
"openFolder": "Відкрити папку"
|
||||
},
|
||||
"entity": {
|
||||
"album_one": "Альбом",
|
||||
@@ -338,7 +342,9 @@
|
||||
"notContains": "Не містить",
|
||||
"notInPlaylist": "Немає в",
|
||||
"notInTheLast": "Не є в останньому",
|
||||
"startsWith": "Починається з"
|
||||
"startsWith": "Починається з",
|
||||
"isMissing": "Загублений",
|
||||
"isPresent": "Присутній"
|
||||
},
|
||||
"form": {
|
||||
"addServer": {
|
||||
@@ -369,7 +375,8 @@
|
||||
"input_skipDuplicates": "Пропустити дублікати",
|
||||
"searchOrCreate": "Шукайте $t(entity.playlist, {\"count\": 2}) або пишіть, щоб створити новий",
|
||||
"success": "Додано $t(entity.trackWithCount, {\"count\": {{message}} }) до $t(entity.playlistWithCount, {\"count\": {{numOfPlaylists}} })",
|
||||
"title": "Додати до $t(entity.playlist, {\"count\": 1})"
|
||||
"title": "Додати до $t(entity.playlist, {\"count\": 1})",
|
||||
"noneAdded": "Ніяких треків не було додано до $t(entity.playlist, {\"count\": 1}) '{{playlist}}'"
|
||||
},
|
||||
"createPlaylist": {
|
||||
"input_description": "$t(common.description)",
|
||||
@@ -437,7 +444,12 @@
|
||||
"input_played": "Відтворити фільтр",
|
||||
"input_played_optionAll": "Всі треки",
|
||||
"input_played_optionUnplayed": "Тільки не відтворені треки",
|
||||
"input_played_optionPlayed": "Тільки відтворені треки"
|
||||
"input_played_optionPlayed": "Тільки відтворені треки",
|
||||
"input_kind_albums": "Альбоми",
|
||||
"input_kind_songs": "Треки",
|
||||
"input_kind": "Випадкові вибори",
|
||||
"input_limit_albums": "Скільки альбомів?",
|
||||
"input_limit_songs": "Скільки треків?"
|
||||
},
|
||||
"updateServer": {
|
||||
"success": "Сервер успішно оновлено",
|
||||
@@ -453,7 +465,57 @@
|
||||
}
|
||||
},
|
||||
"player": {
|
||||
"skip": "Пропустити"
|
||||
"skip": "Пропустити",
|
||||
"repeat": "Повторювати",
|
||||
"repeat_all": "Повторювати всі",
|
||||
"repeat_off": "Повторювання вимкнено",
|
||||
"restoreQueueFromServer": "Відновити чергу з серверу",
|
||||
"saveQueueToServer": "Зберегти чергу до серверу",
|
||||
"shuffle": "Грати (перемішано)",
|
||||
"shuffle_off": "Перемішування вимкнено",
|
||||
"addLast": "Останній",
|
||||
"addNext": "Наступним",
|
||||
"addLastShuffled": "Останнім (перемішано)",
|
||||
"addNextShuffled": "Наступним (перемішано)",
|
||||
"albumRadio": "Радіо альбому",
|
||||
"artistRadio": "Радіо артиста",
|
||||
"holdToShuffle": "Утримуйте щоб перемішати",
|
||||
"favorite": "Додати до вибраних",
|
||||
"lyrics": "Тексти пісень",
|
||||
"mute": "Вимкнути звук",
|
||||
"muted": "Звук вимкнено",
|
||||
"next": "Наступний",
|
||||
"play": "Грати",
|
||||
"playbackFetchCancel": "Будь ласка, трошки почекайте... закрийте повідомлення, щоб скасувати",
|
||||
"playbackFetchInProgress": "Завантаження треків…",
|
||||
"playbackFetchNoResults": "Треків не знайдено",
|
||||
"playbackSpeed": "Швидкість відтворення",
|
||||
"playRandom": "Грати випадково",
|
||||
"playSimilarSongs": "Грати схожі треки",
|
||||
"previous": "Попередній",
|
||||
"queue_clear": "Очистити чергу",
|
||||
"queue_moveToBottom": "Пересунути виділені вниз",
|
||||
"queue_moveToTop": "Пересунути виділені угору",
|
||||
"queue_remove": "Видалити виділені",
|
||||
"skip_back": "Перемотати назад",
|
||||
"skip_forward": "Перемотати вперед",
|
||||
"stop": "Зупинити",
|
||||
"toggleFullscreenPlayer": "Перемкнути повноекранний плеєр",
|
||||
"trackRadio": "Радіо треку",
|
||||
"unfavorite": "Прибрати з вибраних",
|
||||
"pause": "Пауза",
|
||||
"viewQueue": "Переглянути чергу",
|
||||
"sleepTimer": "Таймер сну",
|
||||
"sleepTimer_endOfSong": "Кінець поточного треку",
|
||||
"sleepTimer_endOfAlbum": "Кінець поточного альбому",
|
||||
"sleepTimer_minutes": "{{count}} хв",
|
||||
"sleepTimer_hours": "{{count}} г",
|
||||
"sleepTimer_custom": "Користувацький",
|
||||
"sleepTimer_off": "Вимкнено",
|
||||
"sleepTimer_timeRemaining": "{{time}} залишилось",
|
||||
"sleepTimer_setCustom": "Встановити таймер",
|
||||
"sleepTimer_cancel": "Скасувати таймер",
|
||||
"scrobbleForceSubmit": "Змусити скробблинути"
|
||||
},
|
||||
"page": {
|
||||
"albumArtistDetail": {
|
||||
@@ -570,7 +632,9 @@
|
||||
"showLyricProvider": "Показувати джерело тексту пісень",
|
||||
"synchronized": "Синхронізовано",
|
||||
"unsynchronized": "Несинхронізовано",
|
||||
"useImageAspectRatio": "Використовувати співвідношення сторін зображення"
|
||||
"useImageAspectRatio": "Використовувати співвідношення сторін зображення",
|
||||
"lyricOpacityNonActive": "Непрозорість неактивних слів",
|
||||
"lyricScaleNonActive": "Масштаб неактивних слів"
|
||||
},
|
||||
"lyrics": "Текст пісні",
|
||||
"related": "Пов'язані",
|
||||
@@ -599,7 +663,121 @@
|
||||
"genres": "$t(entity.genre, {\"count\": 2})",
|
||||
"mostPlayed": "Найбільш відтворені",
|
||||
"newlyAdded": "Нещодавно додані релізи",
|
||||
"recentlyPlayed": "Нещодавно відтворені"
|
||||
"recentlyPlayed": "Нещодавно відтворені",
|
||||
"recentlyReleased": "Нещодавно випущені",
|
||||
"title": "$t(common.home)"
|
||||
},
|
||||
"itemDetail": {
|
||||
"copyPath": "Скопіювати шлях до буфера обміну",
|
||||
"copiedPath": "Шлях успішно скопійовано",
|
||||
"openFile": "Показати трек у файловому менеджері"
|
||||
},
|
||||
"setting": {
|
||||
"sidebar": "Бічна панель",
|
||||
"remote": "Віддалений",
|
||||
"exportImport": "Імпортувати/експортувати",
|
||||
"scrobble": "Скробблінг",
|
||||
"audio": "Аудіо",
|
||||
"lyrics": "Тексти пісень",
|
||||
"lyricsDisplay": "Відображення текстів пісень",
|
||||
"transcoding": "Транскодування",
|
||||
"discord": "Діскорд",
|
||||
"logger": "Логгер",
|
||||
"playerFilters": "Фільтри плеєра",
|
||||
"advanced": "Розширені",
|
||||
"analytics": "Аналітика",
|
||||
"generalTab": "Загальні",
|
||||
"hotkeysTab": "Гарячі клавіші",
|
||||
"playbackTab": "Відтворення",
|
||||
"windowTab": "Вікно",
|
||||
"updates": "Оновлення",
|
||||
"cache": "Кеш",
|
||||
"application": "Застосунок",
|
||||
"queryBuilder": "Конструктор черги",
|
||||
"theme": "Тема",
|
||||
"controls": "Керування"
|
||||
},
|
||||
"sidebar": {
|
||||
"albumArtists": "$t(entity.albumArtist, {\"count\": 2})",
|
||||
"albums": "$t(entity.album, {\"count\": 2})",
|
||||
"collections": "Колекції",
|
||||
"artists": "$t(entity.artist, {\"count\": 2})",
|
||||
"favorites": "$t(entity.favorite, {\"count\": 2})",
|
||||
"folders": "$t(entity.folder, {\"count\": 2})",
|
||||
"genres": "$t(entity.genre, {\"count\": 2})",
|
||||
"home": "$t(common.home)",
|
||||
"radio": "$t(entity.radioStation, {\"count\": 2})",
|
||||
"myLibrary": "Моя бібліотека",
|
||||
"nowPlaying": "Зараз грає",
|
||||
"playlists": "$t(entity.playlist, {\"count\": 2})",
|
||||
"search": "$t(common.search)",
|
||||
"settings": "$t(common.setting, {\"count\": 2})",
|
||||
"shared": "Поширено $t(entity.playlist, {\"count\": 2})",
|
||||
"tracks": "$t(entity.track, {\"count\": 2})"
|
||||
},
|
||||
"trackList": {
|
||||
"artistTracks": "Треки {{artist}}",
|
||||
"genreTracks": "\"{{genre}}\" $t(entity.track, {\"count\": 2})",
|
||||
"title": "$t(entity.track, {\"count\": 2})"
|
||||
},
|
||||
"playlistList": {
|
||||
"title": "$t(entity.playlist, {\"count\": 2})"
|
||||
},
|
||||
"collections": {
|
||||
"overrideExisting": "Перевизначити існуючі",
|
||||
"saveAsCollection": "Зберегти як колекцію"
|
||||
}
|
||||
},
|
||||
"queryBuilder": {
|
||||
"standardTags": "Стандартні теги",
|
||||
"customTags": "Користувацькі теги"
|
||||
},
|
||||
"releaseType": {
|
||||
"primary": {
|
||||
"album": "$t(entity.album, {\"count\": 1})",
|
||||
"broadcast": "Транслювати",
|
||||
"ep": "Міні-альбом",
|
||||
"other": "Інші",
|
||||
"single": "Сінгл"
|
||||
},
|
||||
"secondary": {
|
||||
"audiobook": "Аудіокнига",
|
||||
"audioDrama": "Радіоп'єса",
|
||||
"compilation": "Збірка",
|
||||
"djMix": "DJ мікс",
|
||||
"demo": "Демо",
|
||||
"fieldRecording": "Запис поза студією",
|
||||
"interview": "Інтерв'ю",
|
||||
"live": "Наживо",
|
||||
"mixtape": "Мікстейп",
|
||||
"remix": "Ремікс",
|
||||
"soundtrack": "Саундтрек",
|
||||
"spokenWord": "Усне слово"
|
||||
}
|
||||
},
|
||||
"setting": {
|
||||
"autoDJ": "Авто DJ",
|
||||
"autoDJ_itemCount": "Кількість елементів",
|
||||
"autoDJ_itemCount_description": "Кількість елементів, які будуть додані до черги",
|
||||
"autoDJ_timing": "Таймінг",
|
||||
"autoDJ_timing_description": "Кількість треків залишившихся в черзі перед тим, як авто DJ запрацює",
|
||||
"autoDJ_mode": "Режим",
|
||||
"autoDJ_mode_albums": "Альбоми",
|
||||
"autoDJ_mode_description": "Оберіть, додавати треки чи цілі альбоми до черги",
|
||||
"autoDJ_mode_songs": "Треки",
|
||||
"autoDJ_enabled": "Увімкнути Авто DJ",
|
||||
"autoDJ_albumStrategy": "Режим вибора альбомів",
|
||||
"autoDJ_songStrategy": "Режим вибора треків",
|
||||
"autoDJ_strategy_option_library_random": "Випадково",
|
||||
"autoDJ_strategy_option_similar": "Схожі",
|
||||
"autosave": "Автоматично зберігати чергу відтворення",
|
||||
"autosave_description": "Увімкнути автоматичне збереження черги відтворення до вашого серверу. Це можливо тільки коли використовується Navidrome/Subsonic.Також, ви не можете мати міксовану чергу відтворення.",
|
||||
"autosaveCount": "Частота автоматичного збереження черги відтворення",
|
||||
"autosaveCount_description": "Кількість зміни трека перед збереженням черги. 1 (мінімум) означає змінення кожного трека",
|
||||
"accentColor_description": "Встановлює акцентний колір для застосунка",
|
||||
"accentColor": "Акцентний колір",
|
||||
"useThemeAccentColor": "Використовувати акцентний колір теми",
|
||||
"useThemeAccentColor_description": "Використовувати основний колір визначений у обраній темі замість користувацького акцентного коліру",
|
||||
"useThemePrimaryShade": "Використовувати основний відтінок теми"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -828,7 +828,45 @@
|
||||
"autoDJ_albumStrategy": "專輯選擇模式",
|
||||
"autoDJ_songStrategy": "歌曲選擇模式",
|
||||
"autoDJ_strategy_option_library_random": "隨機",
|
||||
"autoDJ_strategy_option_similar": "相似"
|
||||
"autoDJ_strategy_option_similar": "相似",
|
||||
"enableFurigana_description": "在日文歌詞漢字上方顯示發音標記(振假名)。",
|
||||
"enableFurigana": "啟用振假名顯示",
|
||||
"equalizer_descriptionMpv": "透過 FFmpeg lavfi (MPV) 使用參數等化器",
|
||||
"equalizer_descriptionWebAudio": "透過 Web Audio API 使用參數等化器",
|
||||
"equalizer": "等化器",
|
||||
"equalizerBands_description": "各頻段增益。可上下拖曳或輸入數值。範圍:-12 至 +12 dB。",
|
||||
"equalizerBands": "頻段",
|
||||
"equalizerPreamp_description": "EQ 頻段之前的輸入增益。提升頻段時可設為負值以避免削波 (MPV)。",
|
||||
"equalizerPreamp": "前級增益",
|
||||
"equalizerPreset_description": "套用內建或已儲存的自訂 EQ 曲線",
|
||||
"equalizerPreset": "預設",
|
||||
"equalizerPresetDeletePlaceholder": "刪除自訂…",
|
||||
"equalizerPresetGroupBuiltIn": "內建",
|
||||
"equalizerPresetGroupCustom": "自訂",
|
||||
"equalizerPresetNamePlaceholder": "預設名稱…",
|
||||
"equalizerPresetSelectPlaceholder": "選擇預設",
|
||||
"equalizerSavePreset_description": "將目前 EQ 設定儲存為具名預設",
|
||||
"equalizerSavePreset": "儲存預設",
|
||||
"compressor_descriptionMpv": "透過 FFmpeg acompressor (MPV) 使用動態範圍壓縮器",
|
||||
"compressor_descriptionWebAudio": "透過 Web Audio API 使用動態範圍壓縮器",
|
||||
"compressor": "壓縮器",
|
||||
"compressorAttack_description": "訊號超過閾值後,壓縮器開始作用的速度。",
|
||||
"compressorAttack": "啟動時間",
|
||||
"compressorKnee_description": "柔性拐點寬度。數值越高,進入壓縮的過渡越平滑。",
|
||||
"compressorKnee": "拐點",
|
||||
"compressorMakeupGain_description": "壓縮後套用的輸出增益,用於恢復音量。",
|
||||
"compressorMakeupGain": "補償增益",
|
||||
"compressorPreset_description": "套用內建或已儲存的自訂壓縮器設定",
|
||||
"compressorRatio_description": "壓縮比例,例如 4 表示 4:1。",
|
||||
"compressorRatio": "比例",
|
||||
"compressorRelease_description": "訊號低於閾值後,壓縮器解除作用的速度。",
|
||||
"compressorRelease": "釋放時間",
|
||||
"compressorReset_description": "將所有壓縮器參數恢復為預設值",
|
||||
"compressorSavePreset_description": "將目前壓縮器設定儲存為具名預設",
|
||||
"compressorThreshold_description": "開始進行壓縮的訊號電平。",
|
||||
"compressorThreshold": "閥值",
|
||||
"enableRomaji_description": "在日文歌詞下方顯示羅馬拼音。",
|
||||
"enableRomaji": "啟用羅馬拼音顯示"
|
||||
},
|
||||
"table": {
|
||||
"config": {
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
import Kuroshiro from 'kuroshiro';
|
||||
import KuromojiAnalyzer from 'kuroshiro-analyzer-kuromoji';
|
||||
|
||||
// doc: https://kuroshiro.org
|
||||
|
||||
let kuroshiroInstance: any = null;
|
||||
let initPromise: null | Promise<void> = null;
|
||||
|
||||
const getKuroshiro = async () => {
|
||||
if (initPromise) {
|
||||
await initPromise;
|
||||
return kuroshiroInstance;
|
||||
}
|
||||
|
||||
if (kuroshiroInstance) return kuroshiroInstance;
|
||||
|
||||
const KuroshiroClass = (Kuroshiro as any).default || Kuroshiro;
|
||||
kuroshiroInstance = new KuroshiroClass();
|
||||
initPromise = kuroshiroInstance.init(new KuromojiAnalyzer());
|
||||
await initPromise;
|
||||
|
||||
initPromise = null;
|
||||
return kuroshiroInstance;
|
||||
};
|
||||
|
||||
export const convertFurigana = async (text: string): Promise<string> => {
|
||||
const KuroshiroClass = (Kuroshiro as any).default || Kuroshiro;
|
||||
|
||||
// check if the text contains any Japanese kana (to distinguish Japanese from Chinese text, which shares Kanji)
|
||||
// If no Japanese kana is detected, skip processing
|
||||
if (!KuroshiroClass.Util.hasKana(text)) return text;
|
||||
|
||||
try {
|
||||
const kuroshiro = await getKuroshiro();
|
||||
return await kuroshiro.convert(text, { mode: 'furigana', to: 'hiragana' });
|
||||
} catch (e) {
|
||||
console.error('Furigana conversion error: ', e);
|
||||
return text;
|
||||
}
|
||||
};
|
||||
|
||||
export const convertRomaji = async (text: string): Promise<string> => {
|
||||
const KuroshiroClass = (Kuroshiro as any).default || Kuroshiro;
|
||||
|
||||
if (!KuroshiroClass.Util.hasKana(text)) return text;
|
||||
|
||||
try {
|
||||
const kuroshiro = await getKuroshiro();
|
||||
return await kuroshiro.convert(text, { mode: 'spaced', to: 'romaji' });
|
||||
} catch (e) {
|
||||
console.error('Romaji conversion error: ', e);
|
||||
return text;
|
||||
}
|
||||
};
|
||||
@@ -1,6 +1,7 @@
|
||||
import { ipcMain } from 'electron';
|
||||
|
||||
import { store } from '../settings';
|
||||
import { convertFurigana, convertRomaji } from './furigana';
|
||||
import { getLyricsBySongId as getGenius, getSearchResults as searchGenius } from './genius';
|
||||
import { getLyricsBySongId as getLrcLib, getSearchResults as searchLrcLib } from './lrclib';
|
||||
import { getLyricsBySongId as getNetease, getSearchResults as searchNetease } from './netease';
|
||||
@@ -231,3 +232,11 @@ ipcMain.handle('lyric-by-remote-id', async (_event, params: LyricGetQuery) => {
|
||||
const lyricResults = await getRemoteLyricsById(params);
|
||||
return lyricResults;
|
||||
});
|
||||
|
||||
ipcMain.handle('lyric-convert-furigana', async (_event, text: string) => {
|
||||
return await convertFurigana(text);
|
||||
});
|
||||
|
||||
ipcMain.handle('lyric-convert-romaji', async (_event, text: string) => {
|
||||
return await convertRomaji(text);
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import console from 'console';
|
||||
import { app, ipcMain } from 'electron';
|
||||
import { app, ipcMain, powerMonitor } from 'electron';
|
||||
import { access, rm } from 'fs/promises';
|
||||
import uniq from 'lodash/uniq';
|
||||
import MpvAPI from 'node-mpv';
|
||||
@@ -85,6 +85,19 @@ const DEFAULT_MPV_PARAMETERS = (extraParameters?: string[]) => {
|
||||
parameters.push('--prefetch-playlist=yes');
|
||||
}
|
||||
|
||||
// Without these, mpv/ffmpeg will block indefinitely on a dead TCP connection
|
||||
// instead of failing or reconnecting. This commonly happens when the OS network
|
||||
// adapter resets after the system wakes from sleep while a stream is open.
|
||||
if (!extraParameters?.some((param) => param.startsWith('--network-timeout'))) {
|
||||
parameters.push('--network-timeout=10');
|
||||
}
|
||||
|
||||
if (!extraParameters?.some((param) => param.startsWith('--stream-lavf-o'))) {
|
||||
parameters.push(
|
||||
'--stream-lavf-o=reconnect=1,reconnect_streamed=1,reconnect_at_eof=1,reconnect_delay_max=5',
|
||||
);
|
||||
}
|
||||
|
||||
return parameters;
|
||||
};
|
||||
|
||||
@@ -191,21 +204,44 @@ export const getMpvInstance = () => {
|
||||
return mpvInstance;
|
||||
};
|
||||
|
||||
const QUIT_TIMEOUT_MS = 3000;
|
||||
|
||||
const killMpvProcess = (mpv: MpvAPI) => {
|
||||
const mpvProcess = (mpv as any).process || (mpv as any).mpvProcess;
|
||||
if (mpvProcess && typeof mpvProcess.kill === 'function') {
|
||||
try {
|
||||
mpvProcess.kill('SIGTERM');
|
||||
} catch (killErr) {
|
||||
mpvLog({ action: 'Failed to kill mpv process' }, killErr as NodeMpvError);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const quit = async (instance?: MpvAPI | null) => {
|
||||
const mpv = instance || getMpvInstance();
|
||||
if (mpv) {
|
||||
try {
|
||||
await mpv.quit();
|
||||
// mpv.quit() resolves only when mpv replies over IPC. If mpv's command queue
|
||||
// is wedged (e.g. blocked on a dead network stream after the system resumes
|
||||
// from sleep), that reply never arrives, so this must not be allowed to hang
|
||||
// forever - fall back to killing the process directly.
|
||||
let timedOut = false;
|
||||
await Promise.race([
|
||||
mpv.quit(),
|
||||
new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
timedOut = true;
|
||||
resolve(undefined);
|
||||
}, QUIT_TIMEOUT_MS);
|
||||
}),
|
||||
]);
|
||||
|
||||
if (timedOut) {
|
||||
killMpvProcess(mpv);
|
||||
}
|
||||
} catch {
|
||||
// If quit() fails, try to kill the process directly
|
||||
const mpvProcess = (mpv as any).process || (mpv as any).mpvProcess;
|
||||
if (mpvProcess && typeof mpvProcess.kill === 'function') {
|
||||
try {
|
||||
mpvProcess.kill('SIGTERM');
|
||||
} catch (killErr) {
|
||||
mpvLog({ action: 'Failed to kill mpv process' }, killErr as NodeMpvError);
|
||||
}
|
||||
}
|
||||
killMpvProcess(mpv);
|
||||
}
|
||||
if (!isWindows()) {
|
||||
try {
|
||||
@@ -666,6 +702,17 @@ const cleanupMpv = async (force = false) => {
|
||||
}
|
||||
};
|
||||
|
||||
// When the OS resumes from sleep, any network stream mpv had open is likely dead
|
||||
// (the connection silently dropped while the network adapter was suspended). Tell
|
||||
// the renderer to reload mpv so it reconnects with a fresh stream instead of staying
|
||||
// stuck on the old, now-dead connection until the app is manually restarted.
|
||||
powerMonitor.on('resume', () => {
|
||||
if (getMpvInstance()) {
|
||||
mpvLog({ action: 'System resumed from sleep, reloading mpv' });
|
||||
getMainWindow()?.webContents.send('renderer-mpv-reconnect');
|
||||
}
|
||||
});
|
||||
|
||||
app.on('before-quit', async (event) => {
|
||||
switch (mpvState) {
|
||||
case MpvState.DONE:
|
||||
|
||||
@@ -26,7 +26,17 @@ const getRemoteLyricsByRemoteId = (id: LyricGetQuery) => {
|
||||
return result;
|
||||
};
|
||||
|
||||
const convertFurigana = (text: string): Promise<string> => {
|
||||
return ipcRenderer.invoke('lyric-convert-furigana', text);
|
||||
};
|
||||
|
||||
const convertRomaji = (text: string): Promise<string> => {
|
||||
return ipcRenderer.invoke('lyric-convert-romaji', text);
|
||||
};
|
||||
|
||||
export const lyrics = {
|
||||
convertFurigana,
|
||||
convertRomaji,
|
||||
getRemoteLyricsByRemoteId,
|
||||
getRemoteLyricsBySong,
|
||||
searchRemoteLyrics,
|
||||
|
||||
@@ -174,6 +174,10 @@ const rendererPlayerFallback = (cb: (data: boolean) => void) => {
|
||||
ipcRenderer.on('renderer-player-fallback', (_, data) => cb(data));
|
||||
};
|
||||
|
||||
const rendererMpvReconnect = (cb: () => void) => {
|
||||
ipcRenderer.on('renderer-mpv-reconnect', () => cb());
|
||||
};
|
||||
|
||||
export const mpvPlayer = {
|
||||
autoNext,
|
||||
cleanup,
|
||||
@@ -205,6 +209,7 @@ export const mpvPlayerListener = {
|
||||
rendererAutoNext,
|
||||
rendererCurrentTime,
|
||||
rendererError,
|
||||
rendererMpvReconnect,
|
||||
rendererNext,
|
||||
rendererPause,
|
||||
rendererPlay,
|
||||
|
||||
@@ -19,7 +19,6 @@ import {
|
||||
DeleteInternetRadioStationImageResponse,
|
||||
DeletePlaylistImageArgs,
|
||||
DeletePlaylistImageResponse,
|
||||
genreListSortMap,
|
||||
InternalControllerEndpoint,
|
||||
playlistListSortMap,
|
||||
PlaylistSongListArgs,
|
||||
@@ -596,26 +595,7 @@ export const NavidromeController: InternalControllerEndpoint = {
|
||||
};
|
||||
}
|
||||
|
||||
const res = await ndApiClient(apiClientProps).getGenreList({
|
||||
query: {
|
||||
_end: query.startIndex + (query.limit || 0),
|
||||
_order: sortOrderMap.navidrome[query.sortOrder],
|
||||
_sort: genreListSortMap.navidrome[query.sortBy],
|
||||
_start: query.startIndex,
|
||||
library_id: getLibraryId(query.musicFolderId),
|
||||
name: query.searchTerm,
|
||||
},
|
||||
});
|
||||
|
||||
if (res.status !== 200) {
|
||||
throw new Error('Failed to get genre list');
|
||||
}
|
||||
|
||||
return {
|
||||
items: res.body.data.map((genre) => ndNormalize.genre(genre, apiClientProps.server)),
|
||||
startIndex: query.startIndex || 0,
|
||||
totalRecordCount: Number(res.body.headers.get('x-total-count') || 0),
|
||||
};
|
||||
return SubsonicController.getGenreList(args);
|
||||
},
|
||||
getImageRequest: SubsonicController.getImageRequest,
|
||||
getImageUrl: SubsonicController.getImageUrl,
|
||||
|
||||
@@ -1090,9 +1090,15 @@ export const SubsonicController: InternalControllerEndpoint = {
|
||||
}
|
||||
|
||||
switch (query.sortBy) {
|
||||
case GenreListSort.ALBUM_COUNT:
|
||||
results = orderBy(results, [(v) => v.albumCount], [sortOrder]);
|
||||
break;
|
||||
case GenreListSort.NAME:
|
||||
results = orderBy(results, [(v) => v.value.toLowerCase()], [sortOrder]);
|
||||
break;
|
||||
case GenreListSort.SONG_COUNT:
|
||||
results = orderBy(results, [(v) => v.songCount], [sortOrder]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
+10
-4
@@ -64,6 +64,7 @@ export const useItemDragDropState = <TElement extends HTMLElement = HTMLDivEleme
|
||||
return draggedItems;
|
||||
},
|
||||
itemType,
|
||||
metadata: { playlistId },
|
||||
onDragStart: () => {
|
||||
if (!item || !isDataRow) {
|
||||
return;
|
||||
@@ -248,10 +249,15 @@ export const useItemDragDropState = <TElement extends HTMLElement = HTMLDivEleme
|
||||
case DragTarget.SONG: {
|
||||
const sourceItems = (args.source.item || []) as Song[];
|
||||
if (sourceItems.length > 0) {
|
||||
playerContext.addToQueueByData(sourceItems, {
|
||||
edge: args.edge,
|
||||
uniqueId: droppedOnUniqueId,
|
||||
});
|
||||
const sourcePlaylistId = args.source.metadata?.playlistId as
|
||||
| string
|
||||
| undefined;
|
||||
playerContext.addToQueueByData(
|
||||
sourceItems,
|
||||
{ edge: args.edge, uniqueId: droppedOnUniqueId },
|
||||
undefined,
|
||||
sourcePlaylistId ?? null,
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -7,11 +7,14 @@ import { useSortOrderFilter } from '/@/renderer/features/shared/hooks/use-sort-o
|
||||
import { FILTER_KEYS } from '/@/renderer/features/shared/utils';
|
||||
import { setMultipleSearchParams } from '/@/renderer/utils/query-params';
|
||||
import { runInUrlTransition } from '/@/renderer/utils/url-transition';
|
||||
import { AlbumArtistListSort } from '/@/shared/types/domain-types';
|
||||
import { AlbumArtistListSort, ArtistListSort } from '/@/shared/types/domain-types';
|
||||
import { ItemListKey } from '/@/shared/types/types';
|
||||
|
||||
export const useAlbumArtistListFilters = () => {
|
||||
const { sortBy } = useSortByFilter<AlbumArtistListSort>(null, ItemListKey.ALBUM_ARTIST);
|
||||
const { sortBy } = useSortByFilter<AlbumArtistListSort>(
|
||||
ArtistListSort.NAME,
|
||||
ItemListKey.ALBUM_ARTIST,
|
||||
);
|
||||
|
||||
const { sortOrder } = useSortOrderFilter(null, ItemListKey.ALBUM_ARTIST);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { ArtistListSort } from '/@/shared/types/domain-types';
|
||||
import { ItemListKey } from '/@/shared/types/types';
|
||||
|
||||
export const useArtistListFilters = () => {
|
||||
const { sortBy } = useSortByFilter<ArtistListSort>(null, ItemListKey.ARTIST);
|
||||
const { sortBy } = useSortByFilter<ArtistListSort>(ArtistListSort.NAME, ItemListKey.ARTIST);
|
||||
|
||||
const { sortOrder } = useSortOrderFilter(null, ItemListKey.ARTIST);
|
||||
|
||||
|
||||
@@ -81,6 +81,15 @@ export const useDiscordRpc = () => {
|
||||
privateModeRef.current = privateMode;
|
||||
}, [privateMode]);
|
||||
|
||||
// If the component is unmounted while RPC is enabled, quit RPC
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
if (previousEnabledRef.current) {
|
||||
discordRpc?.quit();
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
const setActivity = useCallback(
|
||||
async (current: ActivityState, trigger: ActivityTrigger) => {
|
||||
const song = current[0];
|
||||
|
||||
@@ -6,7 +6,7 @@ import { GenreListSort } from '/@/shared/types/domain-types';
|
||||
import { ItemListKey } from '/@/shared/types/types';
|
||||
|
||||
export const useGenreListFilters = () => {
|
||||
const { sortBy } = useSortByFilter<GenreListSort>(null, ItemListKey.GENRE);
|
||||
const { sortBy } = useSortByFilter<GenreListSort>(GenreListSort.NAME, ItemListKey.GENRE);
|
||||
|
||||
const { sortOrder } = useSortOrderFilter(null, ItemListKey.GENRE);
|
||||
|
||||
|
||||
@@ -291,6 +291,36 @@ export const LyricsSettingsForm = ({ settingsKey }: LyricsSettingsFormProps) =>
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.lyricFetchProvider'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
aria-label="Enable furigana"
|
||||
defaultChecked={lyricsSettings.enableFurigana}
|
||||
onChange={(e) =>
|
||||
updateLyricsSetting({ enableFurigana: e.currentTarget.checked })
|
||||
}
|
||||
/>
|
||||
),
|
||||
description: t('setting.enableFurigana', {
|
||||
context: 'description',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.enableFurigana'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
aria-label="Enable romaji"
|
||||
defaultChecked={lyricsSettings.enableRomaji}
|
||||
onChange={(e) => updateLyricsSetting({ enableRomaji: e.currentTarget.checked })}
|
||||
/>
|
||||
),
|
||||
description: t('setting.enableRomaji', {
|
||||
context: 'description',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.enableRomaji'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import isElectron from 'is-electron';
|
||||
|
||||
import { LyricsResponse, SynchronizedLyricsArray } from '/@/shared/types/domain-types';
|
||||
|
||||
const lyricsApi = isElectron() ? window.api.lyrics : null;
|
||||
|
||||
export const useFuriganaLyrics = (lyrics: LyricsResponse | null | undefined, enabled: boolean) => {
|
||||
return useQuery({
|
||||
enabled: enabled && !!lyrics && !!lyricsApi,
|
||||
queryFn: async () => {
|
||||
if (!lyrics || !lyricsApi || !enabled) return lyrics;
|
||||
|
||||
if (typeof lyrics === 'string') {
|
||||
return await lyricsApi.convertFurigana(lyrics);
|
||||
} else if (Array.isArray(lyrics)) {
|
||||
const text = lyrics.map(([, line]) => line).join('\n');
|
||||
const converted = await lyricsApi.convertFurigana(text);
|
||||
const convertedLines = converted.split('\n');
|
||||
return lyrics.map(([time], i) => [
|
||||
time,
|
||||
convertedLines[i] ?? lyrics[i][1],
|
||||
]) as SynchronizedLyricsArray;
|
||||
}
|
||||
return lyrics;
|
||||
},
|
||||
queryKey: ['furigana', lyrics],
|
||||
staleTime: Infinity,
|
||||
});
|
||||
};
|
||||
|
||||
export const useRomajiLyrics = (lyrics: LyricsResponse | null | undefined, enabled: boolean) => {
|
||||
return useQuery({
|
||||
enabled: enabled && !!lyrics && !!lyricsApi,
|
||||
queryFn: async () => {
|
||||
if (!lyrics || !lyricsApi || !enabled) return lyrics;
|
||||
|
||||
if (typeof lyrics === 'string') {
|
||||
return await lyricsApi.convertRomaji(lyrics);
|
||||
} else if (Array.isArray(lyrics)) {
|
||||
const text = lyrics.map(([, line]) => line).join('\n');
|
||||
const converted = await lyricsApi.convertRomaji(text);
|
||||
const convertedLines = converted.split('\n');
|
||||
return lyrics.map(([time], i) => [
|
||||
time,
|
||||
convertedLines[i] ?? lyrics[i][1],
|
||||
]) as SynchronizedLyricsArray;
|
||||
}
|
||||
return lyrics;
|
||||
},
|
||||
queryKey: ['romaji', lyrics],
|
||||
staleTime: Infinity,
|
||||
});
|
||||
};
|
||||
@@ -25,3 +25,8 @@
|
||||
.lyric-line:global(.synchronized) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.romaji-line {
|
||||
font-size: 0.8em;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@@ -3,17 +3,28 @@ import { ComponentPropsWithoutRef, memo, useMemo } from 'react';
|
||||
|
||||
import styles from './lyric-line.module.css';
|
||||
|
||||
import { sanitize } from '/@/renderer/utils/sanitize';
|
||||
import { Box } from '/@/shared/components/box/box';
|
||||
import { Stack } from '/@/shared/components/stack/stack';
|
||||
|
||||
interface LyricLineProps extends ComponentPropsWithoutRef<'div'> {
|
||||
alignment: 'center' | 'left' | 'right';
|
||||
fontSize: number;
|
||||
romajiText?: null | string;
|
||||
text: string;
|
||||
translatedText?: null | string;
|
||||
}
|
||||
|
||||
export const LyricLine = memo(
|
||||
({ alignment, className, fontSize, text, ...props }: LyricLineProps) => {
|
||||
({
|
||||
alignment,
|
||||
className,
|
||||
fontSize,
|
||||
romajiText,
|
||||
text,
|
||||
translatedText,
|
||||
...props
|
||||
}: LyricLineProps) => {
|
||||
const lines = useMemo(() => text.split('_BREAK_'), [text]);
|
||||
|
||||
const style = useMemo(
|
||||
@@ -28,8 +39,17 @@ export const LyricLine = memo(
|
||||
<Box className={clsx(styles.lyricLine, className)} style={style} {...props}>
|
||||
<Stack gap={0}>
|
||||
{lines.map((line, index) => (
|
||||
<span key={index}>{line}</span>
|
||||
<span dangerouslySetInnerHTML={{ __html: sanitize(line) }} key={index} />
|
||||
))}
|
||||
{romajiText && (
|
||||
<span
|
||||
className={styles.romajiLine}
|
||||
dangerouslySetInnerHTML={{ __html: sanitize(romajiText) }}
|
||||
/>
|
||||
)}
|
||||
{translatedText && (
|
||||
<span dangerouslySetInnerHTML={{ __html: sanitize(translatedText) }} />
|
||||
)}
|
||||
</Stack>
|
||||
</Box>
|
||||
);
|
||||
|
||||
@@ -14,6 +14,10 @@ import {
|
||||
type LyricsQueryResult,
|
||||
} from '/@/renderer/features/lyrics/api/lyrics-api';
|
||||
import { openLyricsExportModal } from '/@/renderer/features/lyrics/components/lyrics-export-form';
|
||||
import {
|
||||
useFuriganaLyrics,
|
||||
useRomajiLyrics,
|
||||
} from '/@/renderer/features/lyrics/hooks/use-furigana-lyrics';
|
||||
import { LyricsActions } from '/@/renderer/features/lyrics/lyrics-actions';
|
||||
import {
|
||||
SynchronizedLyrics,
|
||||
@@ -49,6 +53,8 @@ export const Lyrics = ({ fadeOutNoLyricsMessage = true, settingsKey = 'default'
|
||||
|
||||
const {
|
||||
enableAutoTranslation,
|
||||
enableFurigana,
|
||||
enableRomaji,
|
||||
preferLocalLyrics,
|
||||
translationApiKey,
|
||||
translationApiProvider,
|
||||
@@ -116,7 +122,16 @@ export const Lyrics = ({ fadeOutNoLyricsMessage = true, settingsKey = 'default'
|
||||
return computeSelectedFromResult(data, preferLocalLyrics, indexToUse);
|
||||
}, [data, indexToUse, preferLocalLyrics]);
|
||||
|
||||
const displayLyrics = isLyricsDisabled ? null : lyrics;
|
||||
const { data: furiganaConvertedLyrics } = useFuriganaLyrics(lyrics?.lyrics, !!enableFurigana);
|
||||
const { data: romajiConvertedLyrics } = useRomajiLyrics(lyrics?.lyrics, !!enableRomaji);
|
||||
|
||||
const displayLyrics = useMemo(() => {
|
||||
if (isLyricsDisabled || !lyrics) return null;
|
||||
if (enableFurigana && furiganaConvertedLyrics) {
|
||||
return { ...lyrics, lyrics: furiganaConvertedLyrics };
|
||||
}
|
||||
return lyrics;
|
||||
}, [enableFurigana, isLyricsDisabled, lyrics, furiganaConvertedLyrics]);
|
||||
|
||||
const currentOffsetMs = useMemo(() => {
|
||||
if (!data) return 0;
|
||||
@@ -283,10 +298,10 @@ export const Lyrics = ({ fadeOutNoLyricsMessage = true, settingsKey = 'default'
|
||||
}, [isLoadingLyrics, hasNoLyrics, fadeOutNoLyricsMessage]);
|
||||
|
||||
const handleExportLyrics = useCallback(() => {
|
||||
if (displayLyrics) {
|
||||
openLyricsExportModal({ lyrics: displayLyrics, offsetMs: currentOffsetMs, synced });
|
||||
if (lyrics && !isLyricsDisabled) {
|
||||
openLyricsExportModal({ lyrics, offsetMs: currentOffsetMs, synced });
|
||||
}
|
||||
}, [currentOffsetMs, displayLyrics, synced]);
|
||||
}, [currentOffsetMs, isLyricsDisabled, lyrics, synced]);
|
||||
|
||||
const handleOpenSettings = () => {
|
||||
openLyricsSettingsModal(settingsKey);
|
||||
@@ -334,12 +349,22 @@ export const Lyrics = ({ fadeOutNoLyricsMessage = true, settingsKey = 'default'
|
||||
<SynchronizedLyrics
|
||||
{...(displayLyrics as SynchronizedLyricsProps)}
|
||||
offsetMs={displayOffsetMs}
|
||||
romajiLyrics={
|
||||
enableRomaji
|
||||
? (romajiConvertedLyrics as SynchronizedLyricsProps['romajiLyrics'])
|
||||
: null
|
||||
}
|
||||
settingsKey={settingsKey}
|
||||
translatedLyrics={showTranslation ? translatedLyrics : null}
|
||||
/>
|
||||
) : (
|
||||
<UnsynchronizedLyrics
|
||||
{...(displayLyrics as UnsynchronizedLyricsProps)}
|
||||
romajiLyrics={
|
||||
enableRomaji
|
||||
? (romajiConvertedLyrics as UnsynchronizedLyricsProps['romajiLyrics'])
|
||||
: null
|
||||
}
|
||||
settingsKey={settingsKey}
|
||||
translatedLyrics={showTranslation ? translatedLyrics : null}
|
||||
/>
|
||||
|
||||
@@ -23,6 +23,7 @@ const mpris = isElectron() && utils?.isLinux() ? window.api.mpris : null;
|
||||
export interface SynchronizedLyricsProps extends Omit<FullLyricsMetadata, 'lyrics'> {
|
||||
lyrics: SynchronizedLyricsArray;
|
||||
offsetMs?: number;
|
||||
romajiLyrics?: null | SynchronizedLyricsArray;
|
||||
settingsKey?: string;
|
||||
style?: React.CSSProperties;
|
||||
translatedLyrics?: null | string;
|
||||
@@ -34,6 +35,7 @@ export const SynchronizedLyrics = ({
|
||||
name,
|
||||
offsetMs,
|
||||
remote,
|
||||
romajiLyrics,
|
||||
settingsKey = 'default',
|
||||
source,
|
||||
style,
|
||||
@@ -368,10 +370,9 @@ export const SynchronizedLyrics = ({
|
||||
handleSeek(time / 1000);
|
||||
}
|
||||
}}
|
||||
text={
|
||||
text +
|
||||
(translatedLyrics ? `_BREAK_${translatedLyrics.split('\n')[idx]}` : '')
|
||||
}
|
||||
romajiText={romajiLyrics?.[idx]?.[1]}
|
||||
text={text}
|
||||
translatedText={translatedLyrics?.split('\n')[idx]}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -8,6 +8,7 @@ import { FullLyricsMetadata } from '/@/shared/types/domain-types';
|
||||
|
||||
export interface UnsynchronizedLyricsProps extends Omit<FullLyricsMetadata, 'lyrics'> {
|
||||
lyrics: string;
|
||||
romajiLyrics?: null | string;
|
||||
settingsKey?: string;
|
||||
translatedLyrics?: null | string;
|
||||
}
|
||||
@@ -17,6 +18,7 @@ export const UnsynchronizedLyrics = ({
|
||||
lyrics,
|
||||
name,
|
||||
remote,
|
||||
romajiLyrics,
|
||||
settingsKey = 'default',
|
||||
source,
|
||||
translatedLyrics,
|
||||
@@ -42,6 +44,10 @@ export const UnsynchronizedLyrics = ({
|
||||
return translatedLyrics ? translatedLyrics.split('\n') : [];
|
||||
}, [translatedLyrics]);
|
||||
|
||||
const romajiLines = useMemo(() => {
|
||||
return romajiLyrics ? romajiLyrics.split('\n') : [];
|
||||
}, [romajiLyrics]);
|
||||
|
||||
return (
|
||||
<div className={styles.container} style={{ gap: `${settings.gapUnsync}px` }}>
|
||||
{settings.showProvider && source && (
|
||||
@@ -67,7 +73,9 @@ export const UnsynchronizedLyrics = ({
|
||||
fontSize={settings.fontSizeUnsync}
|
||||
id={`lyric-${idx}`}
|
||||
key={idx}
|
||||
text={text + (translatedLines[idx] ? `_BREAK_${translatedLines[idx]}` : '')}
|
||||
romajiText={romajiLines[idx]}
|
||||
text={text}
|
||||
translatedText={translatedLines[idx]}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -68,9 +68,13 @@ export const MpvPlayerEngine = (props: MpvPlayerEngineProps) => {
|
||||
};
|
||||
|
||||
eventEmitter.on('MPV_RELOAD', handleMpvReload);
|
||||
// The main process notifies us after the OS resumes from sleep, since the
|
||||
// stream mpv had open is likely on a now-dead connection.
|
||||
mpvPlayerListener?.rendererMpvReconnect(handleMpvReload);
|
||||
|
||||
return () => {
|
||||
eventEmitter.off('MPV_RELOAD', handleMpvReload);
|
||||
ipc?.removeAllListeners('renderer-mpv-reconnect');
|
||||
};
|
||||
}, []);
|
||||
|
||||
|
||||
@@ -450,33 +450,36 @@ export function WebPlayer() {
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (!webAudio) return;
|
||||
if (!webAudio || !player1 || !player1Source) return;
|
||||
|
||||
if (player1 && player1Source && num === 1) {
|
||||
const newGain = calculateReplayGain(player1);
|
||||
const newGain = calculateReplayGain(player1);
|
||||
|
||||
// This error SHOULD never happen, as calculateReplayGain is expected to
|
||||
// always return a real value. However, to prevent app crash, check this just in case
|
||||
try {
|
||||
webAudio.gains[0].gain.setValueAtTime(Math.max(0, newGain), 0);
|
||||
} catch (error) {
|
||||
console.error('Error setting gain', error);
|
||||
}
|
||||
// Apply per player slot whenever its song/source is ready so pre-started
|
||||
// inactive players have correct gain before gapless/crossfade transitions.
|
||||
try {
|
||||
webAudio.gains[0].gain.setValueAtTime(
|
||||
Math.max(0, newGain),
|
||||
webAudio.context.currentTime,
|
||||
);
|
||||
} catch (error) {
|
||||
console.error('Error setting gain', error);
|
||||
}
|
||||
}, [calculateReplayGain, num, player1, player1Source, volume, webAudio]);
|
||||
}, [calculateReplayGain, player1, player1Source, webAudio]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!webAudio) return;
|
||||
if (!webAudio || !player2 || !player2Source) return;
|
||||
|
||||
if (player2 && player2Source && num === 2) {
|
||||
const newGain = calculateReplayGain(player2);
|
||||
try {
|
||||
webAudio.gains[1].gain.setValueAtTime(Math.max(0, newGain), 0);
|
||||
} catch (error) {
|
||||
console.error('Error setting gain', error);
|
||||
}
|
||||
const newGain = calculateReplayGain(player2);
|
||||
|
||||
try {
|
||||
webAudio.gains[1].gain.setValueAtTime(
|
||||
Math.max(0, newGain),
|
||||
webAudio.context.currentTime,
|
||||
);
|
||||
} catch (error) {
|
||||
console.error('Error setting gain', error);
|
||||
}
|
||||
}, [calculateReplayGain, num, player1, player2Source, player2, volume, webAudio]);
|
||||
}, [calculateReplayGain, player2, player2Source, webAudio]);
|
||||
|
||||
const player1Url = useSongUrl(player1, num === 1, transcode);
|
||||
const player2Url = useSongUrl(player2, num === 2, transcode);
|
||||
|
||||
@@ -39,7 +39,12 @@ import {
|
||||
import { Play, PlayerRepeat, PlayerShuffle } from '/@/shared/types/types';
|
||||
|
||||
export interface PlayerContext {
|
||||
addToQueueByData: (data: Song[], type: AddToQueueType, playSongId?: string) => void;
|
||||
addToQueueByData: (
|
||||
data: Song[],
|
||||
type: AddToQueueType,
|
||||
playSongId?: string,
|
||||
contextPlaylistId?: null | string,
|
||||
) => void;
|
||||
addToQueueByFetch: (
|
||||
serverId: string,
|
||||
id: string[],
|
||||
@@ -137,6 +142,23 @@ const getRootQueryKey = (itemType: LibraryItem, serverId: string) => {
|
||||
}
|
||||
};
|
||||
|
||||
const isReplaceQueueType = (type: AddToQueueType): boolean => {
|
||||
if (typeof type === 'object') return false;
|
||||
return type === Play.NOW || type === Play.SHUFFLE;
|
||||
};
|
||||
|
||||
// HashRouter puts the route in location.hash, not pathname.
|
||||
const inferPlaylistContextFromUrl = (): null | string => {
|
||||
const route = window.location.hash.replace(/^#/, '');
|
||||
const match = route.match(/^\/playlists\/([^/]+)/);
|
||||
return match ? match[1] : null;
|
||||
};
|
||||
|
||||
// Stamps each song with the playlist it was queued from, so the sidebar highlight
|
||||
// can be derived from whichever song is currently playing (see useCurrentPlaylistContextId).
|
||||
const tagPlaylistContext = (songs: Song[], contextPlaylistId: string): Song[] =>
|
||||
songs.map((song) => ({ ...song, _contextPlaylistId: contextPlaylistId }));
|
||||
|
||||
export const PlayerProvider = ({ children }: { children: React.ReactNode }) => {
|
||||
const { t } = useTranslation();
|
||||
const queryClient = useQueryClient();
|
||||
@@ -187,9 +209,20 @@ export const PlayerProvider = ({ children }: { children: React.ReactNode }) => {
|
||||
}, [doNotShowAgain, setDoNotShowAgain, t]);
|
||||
|
||||
const addToQueueByData = useCallback(
|
||||
(data: Song[], type: AddToQueueType, playSongId?: string) => {
|
||||
(
|
||||
data: Song[],
|
||||
type: AddToQueueType,
|
||||
playSongId?: string,
|
||||
contextPlaylistId?: null | string,
|
||||
) => {
|
||||
const filters = useSettingsStore.getState().playback.filters;
|
||||
const filteredData = filterSongsByPlayerFilters(data, filters);
|
||||
let filteredData = filterSongsByPlayerFilters(data, filters);
|
||||
const resolvedContextId =
|
||||
contextPlaylistId ??
|
||||
(isReplaceQueueType(type) ? inferPlaylistContextFromUrl() : null);
|
||||
if (resolvedContextId) {
|
||||
filteredData = tagPlaylistContext(filteredData, resolvedContextId);
|
||||
}
|
||||
|
||||
if (typeof type === 'object' && 'edge' in type && type.edge !== null) {
|
||||
const edge = type.edge === 'top' ? 'top' : 'bottom';
|
||||
@@ -279,7 +312,21 @@ export const PlayerProvider = ({ children }: { children: React.ReactNode }) => {
|
||||
}
|
||||
|
||||
const filters = useSettingsStore.getState().playback.filters;
|
||||
const filteredSongs = filterSongsByPlayerFilters(sortedSongs, filters);
|
||||
let filteredSongs = filterSongsByPlayerFilters(sortedSongs, filters);
|
||||
|
||||
// Songs from multiple playlists are merged together, so there is no single
|
||||
// playlist to attribute them to: skip tagging (and URL inference) entirely.
|
||||
const isMultiPlaylist = itemType === LibraryItem.PLAYLIST && id.length > 1;
|
||||
const explicitId =
|
||||
itemType === LibraryItem.PLAYLIST && id.length === 1 ? id[0] : null;
|
||||
const resolvedContextId =
|
||||
explicitId ??
|
||||
(!isMultiPlaylist && isReplaceQueueType(type)
|
||||
? inferPlaylistContextFromUrl()
|
||||
: null);
|
||||
if (resolvedContextId) {
|
||||
filteredSongs = tagPlaylistContext(filteredSongs, resolvedContextId);
|
||||
}
|
||||
|
||||
if (typeof type === 'object' && 'edge' in type && type.edge !== null) {
|
||||
const edge = type.edge === 'top' ? 'top' : 'bottom';
|
||||
|
||||
@@ -11,7 +11,10 @@ import { PlaylistListSort } from '/@/shared/types/domain-types';
|
||||
import { ItemListKey } from '/@/shared/types/types';
|
||||
|
||||
export const usePlaylistListFilters = () => {
|
||||
const sortByFilter = useSortByFilter<PlaylistListSort>(null, ItemListKey.PLAYLIST);
|
||||
const sortByFilter = useSortByFilter<PlaylistListSort>(
|
||||
PlaylistListSort.NAME,
|
||||
ItemListKey.PLAYLIST,
|
||||
);
|
||||
const sortOrderFilter = useSortOrderFilter(null, ItemListKey.PLAYLIST);
|
||||
|
||||
const { searchTerm, setSearchTerm } = useSearchTermFilter('');
|
||||
|
||||
@@ -93,6 +93,34 @@ export const LyricSettings = memo(() => {
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.lyricFetchProvider'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
aria-label="Enable furigana generation"
|
||||
defaultChecked={settings.enableFurigana}
|
||||
onChange={(e) => updateSetting({ enableFurigana: e.currentTarget.checked })}
|
||||
/>
|
||||
),
|
||||
description: t('setting.enableFurigana', {
|
||||
context: 'description',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.enableFurigana'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
aria-label="Enable romaji generation"
|
||||
defaultChecked={settings.enableRomaji}
|
||||
onChange={(e) => updateSetting({ enableRomaji: e.currentTarget.checked })}
|
||||
/>
|
||||
),
|
||||
description: t('setting.enableRomaji', {
|
||||
context: 'description',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.enableRomaji'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useMove } from '@mantine/hooks';
|
||||
import isElectron from 'is-electron';
|
||||
import { memo, useCallback, useContext, useEffect, useRef, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import {
|
||||
buildMpvAudioFilters,
|
||||
@@ -257,6 +258,7 @@ function EqBandSlider({
|
||||
|
||||
// ─── Main component ───────────────────────────────────────────────────────────
|
||||
export const EqSettings = memo(() => {
|
||||
const { t } = useTranslation();
|
||||
const settings = usePlaybackSettings();
|
||||
const { setSettings } = useSettingsStoreActions();
|
||||
|
||||
@@ -443,13 +445,13 @@ export const EqSettings = memo(() => {
|
||||
// ── Preset select data ────────────────────────────────────────────────────
|
||||
const eqPresetSelectData = [
|
||||
{
|
||||
group: 'Built-in',
|
||||
group: t('setting.equalizerPresetGroupBuiltIn'),
|
||||
items: Object.keys(EQ_PRESETS).map((name) => ({ label: name, value: name })),
|
||||
},
|
||||
...(Object.keys(customEqPresets).length > 0
|
||||
? [
|
||||
{
|
||||
group: 'Custom',
|
||||
group: t('setting.equalizerPresetGroupCustom'),
|
||||
items: Object.keys(customEqPresets).map((name) => ({
|
||||
label: name,
|
||||
value: name,
|
||||
@@ -461,13 +463,13 @@ export const EqSettings = memo(() => {
|
||||
|
||||
const compPresetSelectData = [
|
||||
{
|
||||
group: 'Built-in',
|
||||
group: t('setting.equalizerPresetGroupBuiltIn'),
|
||||
items: Object.keys(COMP_PRESETS).map((name) => ({ label: name, value: name })),
|
||||
},
|
||||
...(Object.keys(customCompPresets).length > 0
|
||||
? [
|
||||
{
|
||||
group: 'Custom',
|
||||
group: t('setting.equalizerPresetGroupCustom'),
|
||||
items: Object.keys(customCompPresets).map((name) => ({
|
||||
label: name,
|
||||
value: name,
|
||||
@@ -488,9 +490,9 @@ export const EqSettings = memo(() => {
|
||||
),
|
||||
description:
|
||||
settings.type === PlayerType.LOCAL
|
||||
? 'Parametric equalizer via FFmpeg lavfi (MPV)'
|
||||
: 'Parametric equalizer via Web Audio API',
|
||||
title: 'Equalizer',
|
||||
? t('setting.equalizer', { context: 'descriptionMpv' })
|
||||
: t('setting.equalizer', { context: 'descriptionWebAudio' }),
|
||||
title: t('setting.equalizer'),
|
||||
},
|
||||
...(settings.equalizer.enabled
|
||||
? ([
|
||||
@@ -505,7 +507,7 @@ export const EqSettings = memo(() => {
|
||||
const preset = customEqPresets[name] ?? EQ_PRESETS[name];
|
||||
if (preset) applyEqPreset(preset);
|
||||
}}
|
||||
placeholder="Select preset"
|
||||
placeholder={t('setting.equalizerPresetSelectPlaceholder')}
|
||||
searchable
|
||||
value={null}
|
||||
w={180}
|
||||
@@ -521,15 +523,15 @@ export const EqSettings = memo(() => {
|
||||
if (!name) return;
|
||||
handleDeleteEqPreset(name);
|
||||
}}
|
||||
placeholder="Delete custom..."
|
||||
placeholder={t('setting.equalizerPresetDeletePlaceholder')}
|
||||
value={null}
|
||||
w={160}
|
||||
/>
|
||||
)}
|
||||
</Group>
|
||||
),
|
||||
description: 'Apply a built-in or saved custom EQ curve',
|
||||
title: 'Preset',
|
||||
description: t('setting.equalizerPreset', { context: 'description' }),
|
||||
title: t('setting.equalizerPreset'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -539,7 +541,7 @@ export const EqSettings = memo(() => {
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter') handleSaveEqPreset();
|
||||
}}
|
||||
placeholder="Preset name..."
|
||||
placeholder={t('setting.equalizerPresetNamePlaceholder')}
|
||||
value={saveEqName}
|
||||
w={180}
|
||||
/>
|
||||
@@ -548,12 +550,12 @@ export const EqSettings = memo(() => {
|
||||
onClick={handleSaveEqPreset}
|
||||
variant="subtle"
|
||||
>
|
||||
Save
|
||||
{t('common.save')}
|
||||
</Button>
|
||||
</Group>
|
||||
),
|
||||
description: 'Save the current EQ settings as a named preset',
|
||||
title: 'Save preset',
|
||||
description: t('setting.equalizerSavePreset', { context: 'description' }),
|
||||
title: t('setting.equalizerSavePreset'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -600,13 +602,12 @@ export const EqSettings = memo(() => {
|
||||
w={70}
|
||||
/>
|
||||
<Button onClick={handleResetEq} variant="subtle">
|
||||
Reset all
|
||||
{t('common.reset')}
|
||||
</Button>
|
||||
</Group>
|
||||
),
|
||||
description:
|
||||
'Input gain before EQ bands. Set negative when boosting bands to prevent clipping (MPV).',
|
||||
title: 'Preamp',
|
||||
description: t('setting.equalizerPreamp', { context: 'description' }),
|
||||
title: t('setting.equalizerPreamp'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -625,9 +626,8 @@ export const EqSettings = memo(() => {
|
||||
))}
|
||||
</Group>
|
||||
),
|
||||
description:
|
||||
'Per-band gain. Drag up/down or type a value. Range: -12 to +12 dB.',
|
||||
title: 'Bands',
|
||||
description: t('setting.equalizerBands', { context: 'description' }),
|
||||
title: t('setting.equalizerBands'),
|
||||
},
|
||||
] as SettingOption[])
|
||||
: []),
|
||||
@@ -644,60 +644,57 @@ export const EqSettings = memo(() => {
|
||||
unit: string;
|
||||
}[] = [
|
||||
{
|
||||
description: 'Signal level above which compression begins.',
|
||||
description: t('setting.compressorThreshold', { context: 'description' }),
|
||||
key: 'threshold',
|
||||
max: 0,
|
||||
min: -60,
|
||||
step: 1,
|
||||
title: 'Threshold',
|
||||
title: t('setting.compressorThreshold'),
|
||||
unit: 'dB',
|
||||
},
|
||||
{
|
||||
description: 'Compression ratio, e.g. 4 = 4:1.',
|
||||
description: t('setting.compressorRatio', { context: 'description' }),
|
||||
key: 'ratio',
|
||||
max: 20,
|
||||
min: 1,
|
||||
step: 0.5,
|
||||
title: 'Ratio',
|
||||
title: t('setting.compressorRatio'),
|
||||
unit: ':1',
|
||||
},
|
||||
{
|
||||
description:
|
||||
'How quickly the compressor engages after the signal exceeds the threshold.',
|
||||
description: t('setting.compressorAttack', { context: 'description' }),
|
||||
key: 'attack',
|
||||
max: 2000,
|
||||
min: 0.1,
|
||||
step: 1,
|
||||
title: 'Attack',
|
||||
title: t('setting.compressorAttack'),
|
||||
unit: 'ms',
|
||||
},
|
||||
{
|
||||
description:
|
||||
'How quickly the compressor releases after the signal drops below the threshold.',
|
||||
description: t('setting.compressorRelease', { context: 'description' }),
|
||||
key: 'release',
|
||||
max: 9000,
|
||||
min: 1,
|
||||
step: 10,
|
||||
title: 'Release',
|
||||
title: t('setting.compressorRelease'),
|
||||
unit: 'ms',
|
||||
},
|
||||
{
|
||||
description: 'Output gain applied after compression to restore loudness.',
|
||||
description: t('setting.compressorMakeupGain', { context: 'description' }),
|
||||
key: 'makeup',
|
||||
max: 30,
|
||||
min: 0,
|
||||
step: 0.5,
|
||||
title: 'Makeup Gain',
|
||||
title: t('setting.compressorMakeupGain'),
|
||||
unit: 'dB',
|
||||
},
|
||||
{
|
||||
description:
|
||||
'Soft-knee width. Higher values make the transition into compression more gradual.',
|
||||
description: t('setting.compressorKnee', { context: 'description' }),
|
||||
key: 'knee',
|
||||
max: 10,
|
||||
min: 1,
|
||||
step: 0.5,
|
||||
title: 'Knee',
|
||||
title: t('setting.compressorKnee'),
|
||||
unit: 'dB',
|
||||
},
|
||||
];
|
||||
@@ -713,9 +710,9 @@ export const EqSettings = memo(() => {
|
||||
),
|
||||
description:
|
||||
settings.type === PlayerType.LOCAL
|
||||
? 'Dynamic range compressor via FFmpeg acompressor (MPV)'
|
||||
: 'Dynamic range compressor via Web Audio API',
|
||||
title: 'Compressor',
|
||||
? t('setting.compressor', { context: 'descriptionMpv' })
|
||||
: t('setting.compressor', { context: 'descriptionWebAudio' }),
|
||||
title: t('setting.compressor'),
|
||||
},
|
||||
...(settings.compressor.enabled
|
||||
? ([
|
||||
@@ -730,7 +727,7 @@ export const EqSettings = memo(() => {
|
||||
const preset = customCompPresets[name] ?? COMP_PRESETS[name];
|
||||
if (preset) applyCompPreset(preset);
|
||||
}}
|
||||
placeholder="Select preset"
|
||||
placeholder={t('setting.equalizerPresetSelectPlaceholder')}
|
||||
searchable
|
||||
value={null}
|
||||
w={180}
|
||||
@@ -746,15 +743,15 @@ export const EqSettings = memo(() => {
|
||||
if (!name) return;
|
||||
handleDeleteCompPreset(name);
|
||||
}}
|
||||
placeholder="Delete custom..."
|
||||
placeholder={t('setting.equalizerPresetDeletePlaceholder')}
|
||||
value={null}
|
||||
w={160}
|
||||
/>
|
||||
)}
|
||||
</Group>
|
||||
),
|
||||
description: 'Apply a built-in or saved custom compressor setting',
|
||||
title: 'Preset',
|
||||
description: t('setting.compressorPreset', { context: 'description' }),
|
||||
title: t('setting.equalizerPreset'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
@@ -764,7 +761,7 @@ export const EqSettings = memo(() => {
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter') handleSaveCompPreset();
|
||||
}}
|
||||
placeholder="Preset name..."
|
||||
placeholder={t('setting.equalizerPresetNamePlaceholder')}
|
||||
value={saveCompName}
|
||||
w={180}
|
||||
/>
|
||||
@@ -773,12 +770,12 @@ export const EqSettings = memo(() => {
|
||||
onClick={handleSaveCompPreset}
|
||||
variant="subtle"
|
||||
>
|
||||
Save
|
||||
{t('common.save')}
|
||||
</Button>
|
||||
</Group>
|
||||
),
|
||||
description: 'Save the current compressor settings as a named preset',
|
||||
title: 'Save preset',
|
||||
description: t('setting.compressorSavePreset', { context: 'description' }),
|
||||
title: t('setting.equalizerSavePreset'),
|
||||
},
|
||||
// One SettingOption per compressor parameter — Slider + NumberInput
|
||||
...compParams.map(({ description, key, max, min, step, title, unit }) => ({
|
||||
@@ -834,11 +831,11 @@ export const EqSettings = memo(() => {
|
||||
{
|
||||
control: (
|
||||
<Button onClick={handleResetComp} variant="subtle">
|
||||
Reset to defaults
|
||||
{t('common.resetToDefault')}
|
||||
</Button>
|
||||
),
|
||||
description: 'Restore all compressor parameters to their default values',
|
||||
title: 'Reset',
|
||||
description: t('setting.compressorReset', { context: 'description' }),
|
||||
title: t('common.reset'),
|
||||
},
|
||||
] as SettingOption[])
|
||||
: []),
|
||||
|
||||
@@ -63,6 +63,30 @@ export const WindowSettings = memo(() => {
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.windowBarStyle'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
aria-label="Toggle track info in Window Bar"
|
||||
defaultChecked={settings.windowBarTrackinfo}
|
||||
onChange={(e) => {
|
||||
if (!e) return;
|
||||
setSettings({
|
||||
window: {
|
||||
windowBarTrackinfo: e.currentTarget.checked,
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
),
|
||||
description: t('setting.windowBarTrackinfo', {
|
||||
context: 'description',
|
||||
}),
|
||||
// tab is hidden entirely right now
|
||||
// but if it was shown we would want to show this option
|
||||
// as it also controls the tab title in web
|
||||
isHidden: false,
|
||||
title: t('setting.windowBarTrackinfo'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
|
||||
@@ -823,18 +823,38 @@ const GENRE_LIST_FILTERS: Partial<
|
||||
},
|
||||
],
|
||||
[ServerType.NAVIDROME]: [
|
||||
{
|
||||
defaultOrder: SortOrder.ASC,
|
||||
name: i18n.t('filter.albumCount'),
|
||||
value: GenreListSort.ALBUM_COUNT,
|
||||
},
|
||||
{
|
||||
defaultOrder: SortOrder.ASC,
|
||||
name: i18n.t('filter.name'),
|
||||
value: GenreListSort.NAME,
|
||||
},
|
||||
{
|
||||
defaultOrder: SortOrder.ASC,
|
||||
name: i18n.t('filter.songCount'),
|
||||
value: GenreListSort.SONG_COUNT,
|
||||
},
|
||||
],
|
||||
[ServerType.SUBSONIC]: [
|
||||
{
|
||||
defaultOrder: SortOrder.ASC,
|
||||
name: i18n.t('filter.albumCount'),
|
||||
value: GenreListSort.ALBUM_COUNT,
|
||||
},
|
||||
{
|
||||
defaultOrder: SortOrder.ASC,
|
||||
name: i18n.t('filter.name'),
|
||||
value: GenreListSort.NAME,
|
||||
},
|
||||
{
|
||||
defaultOrder: SortOrder.ASC,
|
||||
name: i18n.t('filter.albumCount'),
|
||||
value: GenreListSort.SONG_COUNT,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { parseStringParam, setSearchParam } from '/@/renderer/utils/query-params
|
||||
import { runInUrlTransition } from '/@/renderer/utils/url-transition';
|
||||
import { ItemListKey } from '/@/shared/types/types';
|
||||
|
||||
export const useSortByFilter = <TSortBy>(defaultValue: null | string, listKey: ItemListKey) => {
|
||||
export const useSortByFilter = <TSortBy>(defaultValue: string, listKey: ItemListKey) => {
|
||||
const server = useCurrentServer();
|
||||
const { getFilter, setFilter } = useListFilterPersistence(server.id, listKey);
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
|
||||
@@ -43,8 +43,18 @@ export const ShareItemContextModal = ({
|
||||
});
|
||||
|
||||
const handleSubmit = form.onSubmit(async (values) => {
|
||||
shareItemMutation.mutate(
|
||||
{
|
||||
const canUseClipboard = Boolean(navigator.clipboard) && window.isSecureContext;
|
||||
|
||||
// The share URL only exists once the create request resolves. Calling
|
||||
// navigator.clipboard.writeText() from that async callback runs outside
|
||||
// the click's user activation, so Firefox/Safari reject it ("Clipboard
|
||||
// write was blocked due to lack of user activation") and nothing is
|
||||
// copied. Instead, call clipboard.write() synchronously within this
|
||||
// gesture with a ClipboardItem whose value is a promise that resolves to
|
||||
// the URL — this preserves the activation while the share is created.
|
||||
// Falls back to writeText, then to the "click to open" toast.
|
||||
const shareUrlPromise = shareItemMutation
|
||||
.mutateAsync({
|
||||
apiClientProps: { serverId: server?.id || '' },
|
||||
body: {
|
||||
description: values.description,
|
||||
@@ -53,51 +63,63 @@ export const ShareItemContextModal = ({
|
||||
resourceIds: itemIds.join(),
|
||||
resourceType,
|
||||
},
|
||||
})
|
||||
.then((data) => {
|
||||
if (!server) throw new Error('Server not found');
|
||||
if (!data?.id) throw new Error('Failed to share item');
|
||||
|
||||
const serverUrl = getServerUrl(server, true);
|
||||
if (!serverUrl) throw new Error('Server URL not found');
|
||||
return `${serverUrl}/share/${data.id}`;
|
||||
});
|
||||
|
||||
let copied = false;
|
||||
if (canUseClipboard) {
|
||||
try {
|
||||
if (typeof ClipboardItem !== 'undefined') {
|
||||
await navigator.clipboard.write([
|
||||
new ClipboardItem({
|
||||
'text/plain': shareUrlPromise.then(
|
||||
(url) => new Blob([url], { type: 'text/plain' }),
|
||||
),
|
||||
}),
|
||||
]);
|
||||
} else {
|
||||
await navigator.clipboard.writeText(await shareUrlPromise);
|
||||
}
|
||||
copied = true;
|
||||
} catch {
|
||||
copied = false;
|
||||
}
|
||||
}
|
||||
|
||||
let shareUrl: string;
|
||||
try {
|
||||
shareUrl = await shareUrlPromise;
|
||||
} catch {
|
||||
toast.error({
|
||||
message: t('form.shareItem.createFailed'),
|
||||
});
|
||||
closeModal(id);
|
||||
return;
|
||||
}
|
||||
|
||||
toast.success({
|
||||
autoClose: copied ? 5000 : 15000,
|
||||
id: 'share-item-toast',
|
||||
message: t(copied ? 'form.shareItem.success' : 'form.shareItem.successMustClick', {}),
|
||||
onClick: (a) => {
|
||||
if (!(a.target instanceof HTMLElement)) return;
|
||||
|
||||
// Make sure we weren't clicking close (otherwise clicking close /also/ opens the url)
|
||||
if (a.target.nodeName !== 'svg') {
|
||||
window.open(shareUrl);
|
||||
toast.hide('share-item-toast');
|
||||
}
|
||||
},
|
||||
{
|
||||
onError: () => {
|
||||
toast.error({
|
||||
message: t('form.shareItem.createFailed'),
|
||||
});
|
||||
},
|
||||
onSuccess: (_data) => {
|
||||
if (!server) throw new Error('Server not found');
|
||||
if (!_data?.id) throw new Error('Failed to share item');
|
||||
|
||||
const serverUrl = getServerUrl(server, true);
|
||||
if (!serverUrl) throw new Error('Server URL not found');
|
||||
const shareUrl = `${serverUrl}/share/${_data.id}`;
|
||||
|
||||
const canUseClipboard = navigator.clipboard && window.isSecureContext;
|
||||
if (canUseClipboard) {
|
||||
navigator.clipboard.writeText(shareUrl);
|
||||
}
|
||||
|
||||
toast.success({
|
||||
autoClose: canUseClipboard ? 5000 : 15000,
|
||||
id: 'share-item-toast',
|
||||
message: t(
|
||||
canUseClipboard
|
||||
? 'form.shareItem.success'
|
||||
: 'form.shareItem.successMustClick',
|
||||
{},
|
||||
),
|
||||
onClick: (a) => {
|
||||
if (!(a.target instanceof HTMLElement)) return;
|
||||
|
||||
// Make sure we weren't clicking close (otherwise clicking close /also/ opens the url)
|
||||
if (a.target.nodeName !== 'svg') {
|
||||
window.open(shareUrl);
|
||||
toast.hide('share-item-toast');
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
closeModal(id);
|
||||
return null;
|
||||
});
|
||||
|
||||
return (
|
||||
|
||||
@@ -136,6 +136,10 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.name-active {
|
||||
color: var(--theme-colors-primary);
|
||||
}
|
||||
|
||||
.image-container {
|
||||
flex-shrink: 0;
|
||||
width: 3rem;
|
||||
|
||||
@@ -28,6 +28,7 @@ import { useDragDrop } from '/@/renderer/hooks/use-drag-drop';
|
||||
import { useDragMonitor } from '/@/renderer/hooks/use-drag-monitor';
|
||||
import { AppRoute } from '/@/renderer/router/routes';
|
||||
import {
|
||||
useCurrentPlaylistContextId,
|
||||
useCurrentServer,
|
||||
useCurrentServerId,
|
||||
usePermissions,
|
||||
@@ -116,6 +117,8 @@ export const PlaylistRowButton = memo(
|
||||
const sidebarPlaylistSorting = useSidebarPlaylistSorting();
|
||||
const sidebarPlaylistMode = useSidebarPlaylistMode();
|
||||
const isCompact = sidebarPlaylistMode === 'compact';
|
||||
const activePlaylistId = useCurrentPlaylistContextId();
|
||||
const isActive = activePlaylistId === item.id;
|
||||
|
||||
const [isHovered, setIsHovered] = useState(false);
|
||||
const isSmartPlaylist = Boolean(item.rules);
|
||||
@@ -292,7 +295,13 @@ export const PlaylistRowButton = memo(
|
||||
>
|
||||
{isCompact ? (
|
||||
<>
|
||||
<Text className={styles.compactName} fw={500} size="md">
|
||||
<Text
|
||||
className={clsx(styles.compactName, {
|
||||
[styles.nameActive]: isActive,
|
||||
})}
|
||||
fw={500}
|
||||
size="md"
|
||||
>
|
||||
{name}
|
||||
</Text>
|
||||
{isHovered && (
|
||||
@@ -307,7 +316,13 @@ export const PlaylistRowButton = memo(
|
||||
<div className={styles.rowGroup}>
|
||||
<Image containerClassName={styles.imageContainer} src={imageUrl} />
|
||||
<div className={styles.metadata}>
|
||||
<Text className={styles.name} fw={500} size="md">
|
||||
<Text
|
||||
className={clsx(styles.name, {
|
||||
[styles.nameActive]: isActive,
|
||||
})}
|
||||
fw={500}
|
||||
size="md"
|
||||
>
|
||||
{name}
|
||||
</Text>
|
||||
<div className={styles.metadataGroup}>
|
||||
|
||||
@@ -14,7 +14,13 @@ import macMin from './assets/min-mac.png';
|
||||
import styles from './window-bar.module.css';
|
||||
|
||||
import { useRadioPlayer } from '/@/renderer/features/radio/hooks/use-radio-player';
|
||||
import { useAppStore, usePlayerData, usePlayerStatus, useWindowSettings } from '/@/renderer/store';
|
||||
import {
|
||||
useAppStore,
|
||||
usePlayerData,
|
||||
usePlayerStatus,
|
||||
useWindowBarTrackinfo,
|
||||
useWindowSettings,
|
||||
} from '/@/renderer/store';
|
||||
import { Text } from '/@/shared/components/text/text';
|
||||
import { Platform, PlayerStatus } from '/@/shared/types/types';
|
||||
|
||||
@@ -130,6 +136,8 @@ const MacOsControls = ({ controls, title }: WindowBarControlsProps) => {
|
||||
export const WindowBar = () => {
|
||||
const { t } = useTranslation();
|
||||
const { windowBarStyle } = useWindowSettings();
|
||||
const windowBarTrackinfo = useWindowBarTrackinfo();
|
||||
|
||||
const playerStatus = usePlayerStatus();
|
||||
const privateMode = useAppStore((state) => state.privateMode);
|
||||
const handleMinimize = () => minimize();
|
||||
@@ -153,6 +161,10 @@ export const WindowBar = () => {
|
||||
const title = useMemo(() => {
|
||||
const privateModeString = privateMode ? t('page.windowBar.privateMode') : '';
|
||||
|
||||
if (!windowBarTrackinfo) {
|
||||
return `Feishin${privateMode ? ` ${privateModeString}` : ''}`;
|
||||
}
|
||||
|
||||
// Show radio information if radio is active
|
||||
if (isRadioActive) {
|
||||
const radioStatusString = !isRadioPlaying ? t('page.windowBar.paused') : '';
|
||||
@@ -194,6 +206,7 @@ export const WindowBar = () => {
|
||||
queueLength,
|
||||
stationName,
|
||||
t,
|
||||
windowBarTrackinfo,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -1640,6 +1640,7 @@ export const usePlayerStoreBase = createWithEqualityFn<PlayerState>()(
|
||||
const excludedPlayerKeys = ['playerNum', 'seekToTimestamp', 'status'];
|
||||
|
||||
// If we're not restoring the play queue, we don't need the index property
|
||||
// (it is meaningless without the queue)
|
||||
if (!shouldRestorePlayQueue) {
|
||||
excludedPlayerKeys.push('index');
|
||||
}
|
||||
@@ -2076,6 +2077,7 @@ export const updateQueueSong = (songId: string, updatedSong: Song) => {
|
||||
const uniqueId = song._uniqueId;
|
||||
state.queue.songs[song._uniqueId] = {
|
||||
...updatedSong,
|
||||
_contextPlaylistId: song._contextPlaylistId,
|
||||
_uniqueId: uniqueId,
|
||||
};
|
||||
}
|
||||
@@ -2083,6 +2085,10 @@ export const updateQueueSong = (songId: string, updatedSong: Song) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const useCurrentPlaylistContextId = () => {
|
||||
return usePlayerStoreBase((state) => state.getCurrentSong()?._contextPlaylistId ?? null);
|
||||
};
|
||||
|
||||
export const usePlayerMuted = () => {
|
||||
return usePlayerStoreBase((state) => state.player.muted);
|
||||
};
|
||||
|
||||
@@ -576,7 +576,9 @@ const LyricsSettingsSchema = z.object({
|
||||
alignment: z.enum(['center', 'left', 'right']),
|
||||
delayMs: z.number(),
|
||||
enableAutoTranslation: z.boolean(),
|
||||
enableFurigana: z.boolean().optional(),
|
||||
enableNeteaseTranslation: z.boolean(),
|
||||
enableRomaji: z.boolean().optional(),
|
||||
fetch: z.boolean(),
|
||||
follow: z.boolean(),
|
||||
preferLocalLyrics: z.boolean(),
|
||||
@@ -676,6 +678,7 @@ const WindowSettingsSchema = z.object({
|
||||
startMinimized: z.boolean(),
|
||||
tray: z.boolean(),
|
||||
windowBarStyle: z.nativeEnum(Platform),
|
||||
windowBarTrackinfo: z.boolean(),
|
||||
});
|
||||
|
||||
const QueryValueInputTypeSchema = z.enum([
|
||||
@@ -1845,7 +1848,9 @@ const initialState: SettingsState = {
|
||||
alignment: 'center',
|
||||
delayMs: 0,
|
||||
enableAutoTranslation: false,
|
||||
enableFurigana: false,
|
||||
enableNeteaseTranslation: false,
|
||||
enableRomaji: false,
|
||||
fetch: true,
|
||||
follow: true,
|
||||
preferLocalLyrics: true,
|
||||
@@ -2010,6 +2015,7 @@ const initialState: SettingsState = {
|
||||
startMinimized: false,
|
||||
tray: true,
|
||||
windowBarStyle: platformDefaultWindowBarStyle,
|
||||
windowBarTrackinfo: true,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -2556,6 +2562,9 @@ export const useWindowSettings = () => useSettingsStore((state) => state.window,
|
||||
export const useWindowBarStyle = () =>
|
||||
useSettingsStore((state) => state.window.windowBarStyle, shallow);
|
||||
|
||||
export const useWindowBarTrackinfo = () =>
|
||||
useSettingsStore((state) => state.window.windowBarTrackinfo, shallow);
|
||||
|
||||
export const useHotkeySettings = () => useSettingsStore((state) => state.hotkeys, shallow);
|
||||
|
||||
export const useHotkeyBindings = () => useSettingsStore((state) => state.hotkeys.bindings, shallow);
|
||||
|
||||
@@ -2,7 +2,7 @@ import DomPurify, { Config } from 'dompurify';
|
||||
|
||||
const SANITIZE_OPTIONS: Config = {
|
||||
ALLOWED_ATTR: ['href'],
|
||||
ALLOWED_TAGS: ['a', 'b', 'div', 'em', 'i', 'p', 'span', 'strong'],
|
||||
ALLOWED_TAGS: ['a', 'b', 'div', 'em', 'i', 'p', 'span', 'strong', 'ruby', 'rt', 'rp'],
|
||||
// allow http://, https://, and // (mapped to https)
|
||||
ALLOWED_URI_REGEXP: /^(http(s?):)?\/\/.+/i,
|
||||
};
|
||||
|
||||
@@ -27,7 +27,9 @@ export enum NDAlbumListSort {
|
||||
}
|
||||
|
||||
export enum NDGenreListSort {
|
||||
ALBUM_COUNT = 'albumCount',
|
||||
NAME = 'name',
|
||||
SONG_COUNT = 'songCount',
|
||||
}
|
||||
|
||||
export enum NDPlaylistListSort {
|
||||
@@ -754,6 +756,8 @@ const tag = z.object({
|
||||
const tagList = z.array(tag);
|
||||
|
||||
export enum NDTagListSort {
|
||||
ALBUM_COUNT = 'albumCount',
|
||||
SONG_COUNT = 'songCount',
|
||||
TAG_VALUE = 'tagValue',
|
||||
}
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ export interface QueueData {
|
||||
}
|
||||
|
||||
export type QueueSong = Song & {
|
||||
_contextPlaylistId?: null | string;
|
||||
_uniqueId: string;
|
||||
};
|
||||
|
||||
@@ -154,7 +155,9 @@ export enum ExternalType {
|
||||
}
|
||||
|
||||
export enum GenreListSort {
|
||||
ALBUM_COUNT = 'albumCount',
|
||||
NAME = 'name',
|
||||
SONG_COUNT = 'songCount',
|
||||
}
|
||||
|
||||
export enum ImageType {
|
||||
@@ -165,7 +168,9 @@ export enum ImageType {
|
||||
}
|
||||
|
||||
export enum TagListSort {
|
||||
ALBUM_COUNT = 'albumCount',
|
||||
NAME = 'name',
|
||||
SONG_COUNT = 'songCount',
|
||||
}
|
||||
|
||||
export type Album = {
|
||||
@@ -429,19 +434,25 @@ type BaseEndpointArgs = {
|
||||
|
||||
type GenreListSortMap = {
|
||||
jellyfin: Record<GenreListSort, JFGenreListSort | undefined>;
|
||||
navidrome: Record<GenreListSort, NDGenreListSort | undefined>;
|
||||
subsonic: Record<UserListSort, undefined>;
|
||||
navidrome: Record<GenreListSort, NDGenreListSort>;
|
||||
subsonic: Record<GenreListSort, undefined>;
|
||||
};
|
||||
|
||||
export const genreListSortMap: GenreListSortMap = {
|
||||
jellyfin: {
|
||||
albumCount: undefined,
|
||||
name: JFGenreListSort.NAME,
|
||||
songCount: undefined,
|
||||
},
|
||||
navidrome: {
|
||||
albumCount: NDGenreListSort.NAME,
|
||||
name: NDGenreListSort.NAME,
|
||||
songCount: NDGenreListSort.NAME,
|
||||
},
|
||||
subsonic: {
|
||||
albumCount: undefined,
|
||||
name: undefined,
|
||||
songCount: undefined,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -453,13 +464,19 @@ type TagListSortMap = {
|
||||
|
||||
export const tagListSortMap: TagListSortMap = {
|
||||
jellyfin: {
|
||||
albumCount: undefined,
|
||||
name: undefined,
|
||||
songCount: undefined,
|
||||
},
|
||||
navidrome: {
|
||||
albumCount: NDTagListSort.ALBUM_COUNT,
|
||||
name: NDTagListSort.TAG_VALUE,
|
||||
songCount: NDTagListSort.SONG_COUNT,
|
||||
},
|
||||
subsonic: {
|
||||
albumCount: undefined,
|
||||
name: undefined,
|
||||
songCount: undefined,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user