mirror of
https://github.com/jeffvli/feishin.git
synced 2026-08-03 19:03:31 +02:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 18b62ae22b | |||
| 56a552f893 | |||
| d11c3fa58c | |||
| 54f181c542 | |||
| 1bf51d1d72 | |||
| 37df94bd3b | |||
| dd60499185 | |||
| 009732e745 |
@@ -114,11 +114,8 @@ These variables override app settings **on first run** when no persisted setting
|
||||
|
||||
| Setting path | Default | Env variable | Available values / Description |
|
||||
|-------------|---------|--------------|--------------------------------|
|
||||
| `autoDJ.albumStrategy` | `similar` | `FS_AUTO_DJ_ALBUM_STRATEGY` | `similar` / `library_random`. |
|
||||
| `autoDJ.enabled` | `false` | `FS_AUTO_DJ_ENABLED` | `true` / `false`. |
|
||||
| `autoDJ.itemCount` | `5` | `FS_AUTO_DJ_ITEM_COUNT` | Number of items to add. |
|
||||
| `autoDJ.mode` | `songs` | `FS_AUTO_DJ_MODE` | `songs` / `albums`. |
|
||||
| `autoDJ.songStrategy` | `similar` | `FS_AUTO_DJ_SONG_STRATEGY` | `similar` / `library_random`. |
|
||||
| `autoDJ.timing` | `1` | `FS_AUTO_DJ_TIMING` | Timing value (number). |
|
||||
|
||||
---
|
||||
|
||||
@@ -88,11 +88,8 @@ window.FS_LYRICS_TRANSLATION_API_KEY = "${FS_LYRICS_TRANSLATION_API_KEY}";
|
||||
window.FS_LYRICS_TRANSLATION_TARGET_LANGUAGE = "${FS_LYRICS_TRANSLATION_TARGET_LANGUAGE}";
|
||||
window.FS_LYRICS_ALIGNMENT = "${FS_LYRICS_ALIGNMENT}";
|
||||
|
||||
window.FS_AUTO_DJ_ALBUM_STRATEGY = "${FS_AUTO_DJ_ALBUM_STRATEGY}";
|
||||
window.FS_AUTO_DJ_ENABLED = "${FS_AUTO_DJ_ENABLED}";
|
||||
window.FS_AUTO_DJ_ITEM_COUNT = "${FS_AUTO_DJ_ITEM_COUNT}";
|
||||
window.FS_AUTO_DJ_MODE = "${FS_AUTO_DJ_MODE}";
|
||||
window.FS_AUTO_DJ_SONG_STRATEGY = "${FS_AUTO_DJ_SONG_STRATEGY}";
|
||||
window.FS_AUTO_DJ_TIMING = "${FS_AUTO_DJ_TIMING}";
|
||||
|
||||
window.FS_CSS_CONTENT = "${FS_CSS_CONTENT}";
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"viewPlaylists": "$t(entity.playlist, {\"count\": 2}) anzeigen",
|
||||
"refresh": "$t(common.refresh)",
|
||||
"removeFromQueue": "Aus wiedergabeliste entfernen",
|
||||
"setRating": "Bewertung setzen",
|
||||
"setRating": "Bewerten",
|
||||
"toggleSmartPlaylistEditor": "Editor für $t(entity.smartPlaylist) ein-/ausblenden",
|
||||
"removeFromFavorites": "Aus $t(entity.favorite, {\"count\": 2}) entfernen",
|
||||
"openIn": {
|
||||
@@ -41,9 +41,7 @@
|
||||
"selectRangeOfItems": "Wählen sie eine reihe von elementen",
|
||||
"holdToMoveToTop": "Halten um nach oben zu bewegen",
|
||||
"holdToMoveToBottom": "Halten um nach unten zu bewegen",
|
||||
"goToCurrent": "Zu aktuellem eintrag wechseln",
|
||||
"collapseAllFolders": "Alle Ordner einklappen",
|
||||
"expandAllFolders": "Alle Ordner ausklappen"
|
||||
"goToCurrent": "Zu aktuellem eintrag wechseln"
|
||||
},
|
||||
"common": {
|
||||
"backward": "Zurück",
|
||||
|
||||
@@ -415,11 +415,6 @@
|
||||
},
|
||||
"shuffleAll": {
|
||||
"title": "Play random",
|
||||
"input_kind_albums": "Albums",
|
||||
"input_kind_songs": "Songs",
|
||||
"input_kind": "Random picks",
|
||||
"input_limit_albums": "How many albums?",
|
||||
"input_limit_songs": "How many songs?",
|
||||
"input_genre": "$t(entity.genre, {\"count\": 1})",
|
||||
"input_limit": "How many songs?",
|
||||
"input_minYear": "From year",
|
||||
@@ -736,19 +731,11 @@
|
||||
},
|
||||
"setting": {
|
||||
"autoDJ": "Auto DJ",
|
||||
"autoDJ_description": "Automatically add similar songs to the queue",
|
||||
"autoDJ_itemCount": "Item count",
|
||||
"autoDJ_itemCount_description": "The number of items attempted to be added to the queue",
|
||||
"autoDJ_itemCount_description": "The number of items attempted to be added to the queue when auto DJ is enabled",
|
||||
"autoDJ_timing": "Timing",
|
||||
"autoDJ_timing_description": "The number of songs remaining in the queue before auto DJ is triggered",
|
||||
"autoDJ_mode": "Mode",
|
||||
"autoDJ_mode_albums": "Albums",
|
||||
"autoDJ_mode_description": "Choose to add either songs or entire albums to the queue",
|
||||
"autoDJ_mode_songs": "Songs",
|
||||
"autoDJ_enabled": "Enable Auto DJ",
|
||||
"autoDJ_albumStrategy": "Album selection mode",
|
||||
"autoDJ_songStrategy": "Song selection mode",
|
||||
"autoDJ_strategy_option_library_random": "Random",
|
||||
"autoDJ_strategy_option_similar": "Similar",
|
||||
"autosave": "Automatically save play queue",
|
||||
"autosave_description": "Enable automatically saving the play queue to your server. This is only possible when using Navidrome/Subsonic, and you cannot have a mixed play queue.",
|
||||
"autosaveCount": "Automatic play queue save frequency",
|
||||
|
||||
+62
-126
@@ -16,10 +16,7 @@
|
||||
"viewPlaylists": "Lihat $t(entity.playlist, {\"count\": 2})",
|
||||
"openIn": {
|
||||
"lastfm": "Buka di Last.fm",
|
||||
"musicbrainz": "Buka di MusicBrainz",
|
||||
"listenbrainz": "Buka di ListenBrainz",
|
||||
"qobuz": "Buka di Qobuz",
|
||||
"spotify": "Buka di Spotify"
|
||||
"musicbrainz": "Buka di MusicBrainz"
|
||||
},
|
||||
"addToFavorites": "Tambahkan ke $t(entity.favorite, {\"count\": 2})",
|
||||
"clearQueue": "Kosongkan antrian",
|
||||
@@ -41,14 +38,12 @@
|
||||
"shuffleSelected": "Acak yang dipilih",
|
||||
"viewMore": "Lihat lebih banyak",
|
||||
"openApplicationDirectory": "Buka direktori aplikasi",
|
||||
"goToCurrent": "Pergi ke item saat ini",
|
||||
"collapseAllFolders": "Ciutkan semua folder",
|
||||
"expandAllFolders": "Bentangkan semua folder"
|
||||
"goToCurrent": "Pergi ke item saat ini"
|
||||
},
|
||||
"common": {
|
||||
"clear": "Bersihkan",
|
||||
"action_other": "Aksi",
|
||||
"codec": "Kodek",
|
||||
"codec": "Koded",
|
||||
"channel_other": "Saluran",
|
||||
"duration": "Durasi",
|
||||
"create": "Buat",
|
||||
@@ -101,7 +96,7 @@
|
||||
"random": "Acak",
|
||||
"rating": "Penilaian",
|
||||
"refresh": "Segarkan",
|
||||
"reload": "Muat ulang",
|
||||
"reload": "Muat Ulang",
|
||||
"reset": "Reset",
|
||||
"resetToDefault": "Reset ke default",
|
||||
"restartRequired": "Restart diperlukan",
|
||||
@@ -116,7 +111,7 @@
|
||||
"sortOrder": "Urutkan",
|
||||
"title": "Judul",
|
||||
"trackNumber": "Pista",
|
||||
"trackGain": "Gain trek",
|
||||
"trackGain": "Gain pista",
|
||||
"trackPeak": "Puncak lagu",
|
||||
"unknown": "Tidak dikenal",
|
||||
"version": "Versi",
|
||||
@@ -161,11 +156,7 @@
|
||||
"clean": "Bersih",
|
||||
"gridRows": "Baris kisi",
|
||||
"tableColumns": "Kolom tabel",
|
||||
"itemsMore": "{{count}} lagi",
|
||||
"back": "Kembali",
|
||||
"grouping": "Pengelompokan",
|
||||
"numberOfResults": "{{numberOfResults}} hasil",
|
||||
"newVersionAvailable": "Versi baru tersedia"
|
||||
"itemsMore": "{{count}} lagi"
|
||||
},
|
||||
"entity": {
|
||||
"album_other": "Album",
|
||||
@@ -182,7 +173,7 @@
|
||||
"playlist_other": "Daftar Putar",
|
||||
"play_other": "Putar {{count}}",
|
||||
"playlistWithCount_other": "{{count}} daftar putar",
|
||||
"smartPlaylist": "Cerdas $t(entity.playlist, {\"count\": 1})",
|
||||
"smartPlaylist": "$t(entity.playlist, {\"count\": 1}) pintar",
|
||||
"track_other": "Pista",
|
||||
"song_other": "Lagu",
|
||||
"trackWithCount_other": "{{count}} pista",
|
||||
@@ -193,7 +184,7 @@
|
||||
"apiRouteError": "Tidak dapat mengarahkan permintaan",
|
||||
"audioDeviceFetchError": "Terjadi kesalahan saat mencoba mengambil perangkat audio",
|
||||
"authenticationFailed": "Autentikasi gagal",
|
||||
"badAlbum": "Anda melihat halaman ini karena lagu ini bukan bagian dari album. Masalah ini kemungkinan besar muncul jika Anda memiliki lagu di tingkat teratas folder musik Anda. Jellyfin hanya mengelompokkan trek jika berada di dalam folder",
|
||||
"badAlbum": "Anda melihat halaman ini karena lagu ini tidak termasuk dalam album. Masalah ini bisa terjadi jika Anda memiliki lagu di tingkat atas folder musik Anda. Jellyfin hanya mengelompokkan lagu jika mereka berada di dalam folder",
|
||||
"credentialsRequired": "Kredensial diperlukan",
|
||||
"endpointNotImplementedError": "Endpoint {{endpoint}} tidak diimplementasikan untuk {{serverType}}",
|
||||
"genericError": "Terjadi kesalahan",
|
||||
@@ -220,8 +211,7 @@
|
||||
"saveQueueFailed": "Gagal menyimpan antrean",
|
||||
"settingsSyncError": "Ditemukan ketidaksesuaian antara pengaturan di perender dan proses utama. mulai ulang aplikasi untuk menerapkan perubahan",
|
||||
"invalidJson": "JSON tidak valid",
|
||||
"serverLockSingleServer": "Hanya satu server yang diizinkan ketika server dikunci",
|
||||
"playbackPausedDueToError": "Pemutaran dijeda karena terjadi kesalahan"
|
||||
"serverLockSingleServer": "Hanya satu server yang diizinkan ketika server dikunci"
|
||||
},
|
||||
"filter": {
|
||||
"album": "$t(entity.album, {\"count\": 1})",
|
||||
@@ -296,8 +286,7 @@
|
||||
"success": "Ditambahkan $t(entity.trackWithCount, {\"count\": {{message}} }) ke $t(entity.playlistWithCount, {\"count\": {{numOfPlaylists}} })",
|
||||
"title": "Tambahkan ke $t(entity.playlist, {\"count\": 1})",
|
||||
"create": "Buat $t(entity.playlist, {\"count\": 1}) {{playlist}}",
|
||||
"searchOrCreate": "Cari $t(entity.playlist, {\"count\": 2}) atau ketik untuk membuat yang baru",
|
||||
"noneAdded": "Tidak ada trek yang ditambahkan ke $t(entity.playlist, {\"count\": 1}) '{{playlist}}'"
|
||||
"searchOrCreate": "Cari $t(entity.playlist, {\"count\": 2}) atau ketik untuk membuat yang baru"
|
||||
},
|
||||
"createPlaylist": {
|
||||
"input_description": "$t(common.description)",
|
||||
@@ -332,12 +321,12 @@
|
||||
"clearFilters": "Hapus filter"
|
||||
},
|
||||
"shareItem": {
|
||||
"allowDownloading": "Izinkan pengunduhan",
|
||||
"allowDownloading": "Izinkan unduhan",
|
||||
"description": "Deskripsi",
|
||||
"setExpiration": "Atur masa berlaku",
|
||||
"success": "Tautan bagikan disalin ke papan klip (atau klik di sini untuk membukanya)",
|
||||
"expireInvalid": "Masa berlaku harus di waktu mendatang",
|
||||
"createFailed": "Gagal membuat bagikanan (apakah fitur berbagi diaktifkan?)",
|
||||
"success": "Tautan berbagi berhasil disalin ke papan klip (atau klik di sini untuk membuka)",
|
||||
"expireInvalid": "Masa berlaku harus di masa depan",
|
||||
"createFailed": "Tidak dapat membuat sumber daya berbagi (Apakah berbagi diaktifkan?)",
|
||||
"copyToClipboard": "Salin ke clipboard: Ctrl+C, enter",
|
||||
"successMustClick": "Berbagi berhasil dibuat. klik di sini untuk membuka"
|
||||
},
|
||||
@@ -379,22 +368,19 @@
|
||||
"enabled": "Mode pribadi diaktifkan, status pemutaran kini disembunyikan dari integrasi eksternal",
|
||||
"disabled": "Mode pribadi dinonaktifkan, status pemutaran kini terlihat oleh integrasi eksternal yang diaktifkan",
|
||||
"title": "Mode pribadi"
|
||||
},
|
||||
"editRadioStation": {
|
||||
"success": "Stasiun radio berhasil diperbarui"
|
||||
}
|
||||
},
|
||||
"page": {
|
||||
"albumArtistDetail": {
|
||||
"about": "Tentang {{artist}}",
|
||||
"recentReleases": "Rilisan terbaru",
|
||||
"recentReleases": "Rilis terbaru",
|
||||
"viewDiscography": "Lihat diskografi",
|
||||
"relatedArtists": "$t(entity.artist, {\"count\": 2}) terkait",
|
||||
"topSongs": "Lagu teratas",
|
||||
"topSongsFrom": "Lagu teratas dari {{title}}",
|
||||
"relatedArtists": "$t(entity.artist, {\"count\": 2}) serupa",
|
||||
"topSongs": "Lagu terbaik",
|
||||
"topSongsFrom": "Lagu terbaik dari {{title}}",
|
||||
"viewAll": "Lihat semua",
|
||||
"viewAllTracks": "Lihat semua $t(entity.track, {\"count\": 2})",
|
||||
"appearsOn": "Muncul di",
|
||||
"appearsOn": "Tampil di",
|
||||
"groupingTypeAll": "Semua jenis rilis",
|
||||
"groupingTypePrimary": "Jenis rilis utama",
|
||||
"favoriteSongs": "Lagu favorit",
|
||||
@@ -461,7 +447,7 @@
|
||||
"setRating": "$t(action.setRating)",
|
||||
"playShuffled": "$t(player.shuffle)",
|
||||
"shareItem": "Bagikan item",
|
||||
"showDetails": "Dapatkan info",
|
||||
"showDetails": "Lihat detail",
|
||||
"moveToTop": "$t(action.moveToTop)",
|
||||
"play": "$t(player.play)",
|
||||
"moveItems": "$t(action.moveItems)",
|
||||
@@ -484,9 +470,7 @@
|
||||
"unsynchronized": "Tidak sinkronisasi",
|
||||
"useImageAspectRatio": "Gunakan rasio aspek gambar",
|
||||
"lyricOffset": "Offset lirik (ms)",
|
||||
"lyricGap": "Jarak lirik",
|
||||
"lyricOpacityNonActive": "Opasitas lirik nonaktif",
|
||||
"lyricScaleNonActive": "Skala lirik nonaktif"
|
||||
"lyricGap": "Jarak lirik"
|
||||
},
|
||||
"lyrics": "Lirik",
|
||||
"related": "Terkait",
|
||||
@@ -519,7 +503,7 @@
|
||||
"itemDetail": {
|
||||
"copyPath": "Salin jalur ke papan klip",
|
||||
"copiedPath": "Jalur berhasil disalin",
|
||||
"openFile": "Tampilkan trek di pengelola file"
|
||||
"openFile": "Tampilkan lagu di pengelola file"
|
||||
},
|
||||
"playlist": {
|
||||
"reorder": "Pengurutan ulang hanya diaktifkan saat mengurutkan berdasarkan ID"
|
||||
@@ -647,20 +631,19 @@
|
||||
"sleepTimer_off": "Mati",
|
||||
"sleepTimer_timeRemaining": "{{time}} tersisa",
|
||||
"sleepTimer_setCustom": "Atur pengatur waktu",
|
||||
"sleepTimer_cancel": "Batalkan pengatur waktu",
|
||||
"scrobbleForceSubmit": "Paksa scrobble"
|
||||
"sleepTimer_cancel": "Batalkan pengatur waktu"
|
||||
},
|
||||
"setting": {
|
||||
"accentColor": "Warna sorotan",
|
||||
"accentColor_description": "Menetapkan warna sorotan aplikasi",
|
||||
"albumBackground": "Gambar latar belakang album",
|
||||
"albumBackground_description": "Menambahkan gambar latar belakang untuk halaman album yang berisi sampul album",
|
||||
"albumBackgroundBlur": "Ukuran keburaman gambar latar belakang album",
|
||||
"albumBackgroundBlur_description": "Menyesuaikan tingkat keburaman yang diterapkan pada gambar latar belakang album",
|
||||
"albumBackground_description": "Tambahkan gambar latar belakang ke halaman album yang berisi sampul album",
|
||||
"albumBackgroundBlur": "Ukuran blur gambar latar belakang album",
|
||||
"albumBackgroundBlur_description": "Atur tingkat blur gambar latar belakang album",
|
||||
"applicationHotkeys": "Tombol pintasan aplikasi",
|
||||
"applicationHotkeys_description": "Menetapkan tombol pintasan aplikasi. centang untuk menjadikannya tombol pintasan global (desktop saja)",
|
||||
"artistConfiguration": "Konfigurasi halaman artis album",
|
||||
"artistConfiguration_description": "Atur item apa saja yang ditampilkan, dan dalam urutan apa, pada halaman artis album",
|
||||
"artistConfiguration": "Pengaturan halaman artis album",
|
||||
"artistConfiguration_description": "Atur elemen apa yang ditampilkan dan urutannya di halaman artis album",
|
||||
"audioDevice": "Perangkat audio",
|
||||
"audioDevice_description": "Pilih perangkat audio yang digunakan untuk pemutaran",
|
||||
"audioExclusiveMode": "Mode audio eksklusif",
|
||||
@@ -674,12 +657,12 @@
|
||||
"windowBarStyle_description": "Pilih gaya bilah jendela",
|
||||
"zoom": "Persentase zoom",
|
||||
"zoom_description": "Tentukan persentase zoom aplikasi",
|
||||
"clearCache_description": "'Pembersihan keras' Feishin. Selain membersihkan cache Feishin, cache browser juga dikosongkan (gambar tersimpan dan aset lainnya). Kredensial server dan pengaturan tetap dipertahankan",
|
||||
"clearCache_description": "'Pembersihan keras' Feishin. Untuk membersihkan cache Feishin, kosongkan cache browser (gambar yang disimpan dan elemen lainnya). Kredensial dan pengaturan server tetap terjaga",
|
||||
"clearQueryCache": "Bersihkan cache Feishin",
|
||||
"clearQueryCache_description": "'Pembersihan lunak' Feishin. Ini akan menyegarkan daftar putar, metadata trek, dan mengatur ulang lirik yang disimpan. Pengaturan, kredensial server, dan gambar yang dicache tetap dipertahankan",
|
||||
"clearCacheSuccess": "Cache berhasil dikosongkan",
|
||||
"contextMenu": "Konfigurasi menu konteks (klik kanan)",
|
||||
"contextMenu_description": "Memungkinkan Anda menyembunyikan item yang ditampilkan di menu saat Anda mengeklik kanan suatu item. Item yang tidak dicentang akan disembunyikan",
|
||||
"clearQueryCache_description": "'Pembersihan lunak' Feishin. Ini akan menyegarkan daftar putar, metadata lagu, dan mengatur ulang lirik yang disimpan. Pengaturan, kredensial server, dan gambar cache tetap terjaga",
|
||||
"clearCacheSuccess": "Cache berhasil dibersihkan",
|
||||
"contextMenu": "Pengaturan menu konteks (klik kanan)",
|
||||
"contextMenu_description": "Memungkinkan Anda menyembunyikan elemen yang ditampilkan dalam menu saat Anda klik kanan pada elemen. Elemen yang tidak dipilih akan disembunyikan",
|
||||
"crossfadeDuration": "Durasi crossfade",
|
||||
"crossfadeDuration_description": "Atur durasi efek crossfade",
|
||||
"crossfadeStyle_description": "Pilih gaya crossfade yang digunakan oleh pemutar audio",
|
||||
@@ -694,7 +677,7 @@
|
||||
"discordApplicationId_description": "ID aplikasi untuk rich presence {{discord}} (default: {{defaultId}})",
|
||||
"discordIdleStatus": "Tampilkan status tidak aktif dalam status aktivitas",
|
||||
"discordIdleStatus_description": "Ketika diaktifkan, memperbarui status saat pemutar tidak aktif",
|
||||
"discordListening": "Tampilkan status sebagai sedang mendengarkan",
|
||||
"discordListening": "Tampilkan status sebagai mendengarkan",
|
||||
"discordListening_description": "Tampilkan status sebagai mendengarkan alih-alih bermain",
|
||||
"discordRichPresence_description": "Aktifkan status pemutaran di status aktivitas {{discord}}. Gambar tombol adalah: {{icon}}, {{playing}}, dan {{paused}}",
|
||||
"discordUpdateInterval": "Interval pembaruan status aktivitas {{discord}}",
|
||||
@@ -702,7 +685,7 @@
|
||||
"enableRemote": "Aktifkan kontrol jarak jauh server",
|
||||
"enableRemote_description": "Aktifkan kontrol jarak jauh server untuk memungkinkan perangkat lain mengontrol aplikasi",
|
||||
"externalLinks": "Tampilkan tautan eksternal",
|
||||
"externalLinks_description": "Mengaktifkan penampilan tautan eksternal (Last.fm, MusicBrainz) pada halaman artis/album",
|
||||
"externalLinks_description": "Izinkan untuk menampilkan tautan eksternal (Last.fm, MusicBrainz) di halaman artis/album",
|
||||
"exitToTray": "Keluar ke baki",
|
||||
"exitToTray_description": "Keluar dari aplikasi ke baki sistem",
|
||||
"followLyric": "Ikuti lirik saat ini",
|
||||
@@ -719,14 +702,14 @@
|
||||
"gaplessAudio_optionWeak": "Lemah (disarankan)",
|
||||
"globalMediaHotkeys": "Tombol pintasan media global",
|
||||
"globalMediaHotkeys_description": "Aktifkan atau nonaktifkan penggunaan tombol pintasan sistem media untuk mengontrol pemutaran",
|
||||
"homeConfiguration": "Konfigurasi halaman beranda",
|
||||
"homeConfiguration_description": "Atur item apa saja yang ditampilkan, dan dalam urutan apa, pada halaman beranda",
|
||||
"homeFeature": "Karusel unggulan beranda",
|
||||
"homeFeature_description": "Mengatur apakah karusel unggulan besar ditampilkan di halaman beranda",
|
||||
"homeConfiguration": "Pengaturan halaman beranda",
|
||||
"homeConfiguration_description": "Mengatur elemen mana yang ditampilkan dan urutannya di halaman beranda",
|
||||
"homeFeature": "Karusel fitur beranda",
|
||||
"homeFeature_description": "Mengontrol apakah karusel besar fitur ditampilkan di halaman beranda",
|
||||
"hotkey_browserBack": "Mundur",
|
||||
"hotkey_browserForward": "Maju",
|
||||
"hotkey_favoriteCurrentSong": "Favoritkan $t(common.currentSong)",
|
||||
"hotkey_favoritePreviousSong": "Favoritkan $t(common.previousSong)",
|
||||
"hotkey_favoriteCurrentSong": "$t(common.currentSong) favorit",
|
||||
"hotkey_favoritePreviousSong": "$t(common.previousSong) favorit",
|
||||
"hotkey_globalSearch": "Pencarian global",
|
||||
"hotkey_localSearch": "Pencarian di halaman",
|
||||
"hotkey_playbackNext": "Lagu berikutnya",
|
||||
@@ -735,7 +718,7 @@
|
||||
"hotkey_playbackPlayPause": "Putar / jeda",
|
||||
"hotkey_playbackPrevious": "Lagu sebelumnya",
|
||||
"hotkey_playbackStop": "Berhenti",
|
||||
"hotkey_rate0": "Hapus penilaian",
|
||||
"hotkey_rate0": "Bersihkan penilaian",
|
||||
"hotkey_rate1": "Beri penilaian 1 bintang",
|
||||
"hotkey_rate2": "Beri penilaian 2 bintang",
|
||||
"hotkey_rate3": "Beri penilaian 3 bintang",
|
||||
@@ -749,15 +732,15 @@
|
||||
"hotkey_toggleQueue": "Ubah antrean",
|
||||
"hotkey_toggleRepeat": "Toggle ulangi",
|
||||
"hotkey_toggleShuffle": "Toggle acak",
|
||||
"hotkey_unfavoriteCurrentSong": "Batalkan favorit $t(common.currentSong)",
|
||||
"hotkey_unfavoritePreviousSong": "Batalkan favorit $t(common.previousSong)",
|
||||
"hotkey_unfavoriteCurrentSong": "$t(common.currentSong) tidak favorit",
|
||||
"hotkey_unfavoritePreviousSong": "$t(common.previousSong) tidak favorit",
|
||||
"hotkey_volumeDown": "Turunkan volume",
|
||||
"hotkey_volumeMute": "Senyapkan volume",
|
||||
"hotkey_volumeUp": "Naikkan volume",
|
||||
"hotkey_zoomIn": "Perbesar",
|
||||
"hotkey_zoomOut": "Perkecil",
|
||||
"imageAspectRatio": "Gunakan rasio aspek asli sampul",
|
||||
"imageAspectRatio_description": "Jika diaktifkan, sampul akan ditampilkan menggunakan rasio aspek aslinya. Untuk sampul yang tidak 1:1, ruang yang tersisa akan kosong",
|
||||
"imageAspectRatio": "Gunakan rasio aspek sampul asli",
|
||||
"imageAspectRatio_description": "Jika diaktifkan, sampul akan ditampilkan dengan rasio aspek aslinya. Untuk seni yang tidak 1:1, ruang yang tersisa akan kosong",
|
||||
"language_description": "Menetapkan bahasa untuk aplikasi ($t(common.restartRequired))",
|
||||
"lastfmApiKey": "Kunci API untuk {{lastfm}}",
|
||||
"lastfmApiKey_description": "Kunci API untuk {{lastfm}}. Diperlukan untuk sampul",
|
||||
@@ -786,8 +769,8 @@
|
||||
"playButtonBehavior_optionAddLast": "$t(player.addLast)",
|
||||
"playButtonBehavior_optionAddNext": "$t(player.addNext)",
|
||||
"playButtonBehavior_optionPlayShuffled": "$t(player.shuffle)",
|
||||
"playerbarOpenDrawer": "Tombol alih layar penuh bilah pemutar",
|
||||
"playerbarOpenDrawer_description": "Memungkinkan bilah pemutar diklik untuk membuka pemutar layar penuh",
|
||||
"playerbarOpenDrawer": "Buka pemutar ke layar penuh",
|
||||
"playerbarOpenDrawer_description": "Izinkan mengklik bilah pemutar untuk membuka pemutar di layar penuh",
|
||||
"remotePassword": "Kata sandi kontrol jarak jauh server",
|
||||
"remotePassword_description": "Tentukan kata sandi untuk kontrol jarak jauh server. Kredensial ini dikirimkan dengan tidak aman secara default, jadi Anda harus menggunakan kata sandi unik untuk menghindari masalah",
|
||||
"remotePort": "Port kontrol jarak jauh server",
|
||||
@@ -846,7 +829,7 @@
|
||||
"translationApiKey_description": "Kunci API untuk terjemahan (hanya endpoint layanan global)",
|
||||
"translationTargetLanguage": "Bahasa tujuan penerjemahan",
|
||||
"translationTargetLanguage_description": "Bahasa tujuan untuk penerjemahan",
|
||||
"trayEnabled": "Tampilkan baki",
|
||||
"trayEnabled": "Tampilkan di area pemberitahuan",
|
||||
"trayEnabled_description": "Tampilkan/sembunyikan ikon/menu di area pemberitahuan. Jika dinonaktifkan, juga menonaktifkan meminimalkan/keluar ke baki",
|
||||
"useSystemTheme": "Gunakan tema sistem",
|
||||
"useSystemTheme_description": "Ikuti preferensi terang atau gelap yang ditetapkan oleh sistem",
|
||||
@@ -855,13 +838,13 @@
|
||||
"volumeWidth": "Lebar penggeser volume",
|
||||
"volumeWidth_description": "Lebar penggeser volume",
|
||||
"webAudio": "Gunakan audio web",
|
||||
"clearCache": "Kosongkan cache browser",
|
||||
"clearCache": "Bersihkan cache browser",
|
||||
"disableLibraryUpdateOnStartup": "Nonaktifkan pemeriksaan versi baru saat startup",
|
||||
"mpvExecutablePath": "Jalur executable mpv",
|
||||
"playButtonBehavior_optionPlay": "$t(player.play)",
|
||||
"sampleRate": "Rasio sampel",
|
||||
"savePlayQueue": "Simpan antrean pemutaran",
|
||||
"autoDJ": "DJ Otomatis",
|
||||
"autoDJ": "DJ otomatis",
|
||||
"autoDJ_description": "Tambahkan lagu serupa secara otomatis ke antrean",
|
||||
"autoDJ_itemCount": "Jumlah item",
|
||||
"autoDJ_itemCount_description": "Jumlah item yang dicoba ditambahkan ke antrean saat DJ otomatis diaktifkan",
|
||||
@@ -1007,76 +990,36 @@
|
||||
"playerItemConfiguration": "Konfigurasi item pemutar",
|
||||
"sidebarPlaylistListFilterRegex_description": "Sembunyikan playlist di bilah sisi yang cocok dengan ekspresi reguler ini",
|
||||
"sidebarPlaylistListFilterRegex_placeholder": "Mis. ^daily mix.*",
|
||||
"sidebarPlaylistListFilterRegex": "Regex filter playlist",
|
||||
"autosave": "Simpan antrean putar secara otomatis",
|
||||
"autosave_description": "Aktifkan penyimpanan otomatis antrean putar ke server Anda. Ini hanya dimungkinkan saat menggunakan Navidrome/Subsonic, dan Anda tidak dapat memiliki antrean putar campuran.",
|
||||
"autosaveCount": "Frekuensi penyimpanan otomatis antrean putar",
|
||||
"autosaveCount_description": "Berapa banyak perubahan trek sebelum antrean disimpan. 1 (minimum) berarti setiap pergantian lagu",
|
||||
"hotkey_listShowPlayingSong": "Tampilkan lagu yang sedang diputar dalam daftar",
|
||||
"listenbrainz_description": "Tampilkan tautan ke ListenBrainz pada halaman artis/album",
|
||||
"listenbrainz": "Tampilkan tautan ListenBrainz",
|
||||
"qobuz_description": "Tampilkan tautan ke Qobuz pada halaman artis/album",
|
||||
"qobuz": "Tampilkan tautan Qobuz",
|
||||
"spotify_description": "Tampilkan tautan ke Spotify pada halaman artis/album",
|
||||
"spotify": "Tampilkan tautan Spotify",
|
||||
"nativeSpotify_description": "Buka di aplikasi Spotify alih-alih di browser Anda",
|
||||
"nativeSpotify": "Gunakan aplikasi Spotify",
|
||||
"playerbarWaveformStretch": "Peregangan bentuk gelombang",
|
||||
"playerbarWaveformStretch_description": "Meregangkan bentuk gelombang untuk memenuhi ruang yang tersedia",
|
||||
"preventSuspendOnPlayback_description": "Cegah aplikasi ditangguhkan saat musik diputar",
|
||||
"preventSuspendOnPlayback": "Cegah penangguhan saat pemutaran",
|
||||
"sidebarPlaylistFolders_description": "Buat tampilan folder untuk daftar putar yang menyertakan pemisah yang dikonfigurasi dalam namanya",
|
||||
"sidebarPlaylistFolders": "Aktifkan folder",
|
||||
"sidebarPlaylistFolderSeparator_description": "Karakter (atau string) yang memisahkan tingkat folder dalam nama daftar putar",
|
||||
"sidebarPlaylistFolderSeparator": "Pemisah folder",
|
||||
"sidebarPlaylistFolderView_description": "Cara folder ditampilkan di bilah sisi",
|
||||
"sidebarPlaylistFolderView": "Tampilan folder",
|
||||
"sidebarPlaylistFolderView_optionSingle": "Folder tunggal",
|
||||
"sidebarPlaylistFolderView_optionTree": "Tampilan pohon",
|
||||
"sidebarPlaylistFolderView_optionNavigation": "Tampilan navigasi",
|
||||
"sidebarPlaylistFolderTreeIndent_description": "Jumlah piksel indentasi tiap tingkat pohon",
|
||||
"sidebarPlaylistFolderTreeIndent": "Indentasi pohon",
|
||||
"sidebarPlaylistFolderTreeLineColor_description": "Warna garis penghubung pohon (biarkan kosong untuk default tema)",
|
||||
"sidebarPlaylistFolderTreeLineColor": "Warna garis pohon",
|
||||
"sidebarPlaylistMode_description": "Cara setiap daftar putar ditampilkan dalam daftar bilah sisi",
|
||||
"sidebarPlaylistMode": "Mode daftar putar bilah sisi",
|
||||
"sidebarPlaylistMode_optionCompact": "Ringkas",
|
||||
"sidebarPlaylistMode_optionExpanded": "Diperluas",
|
||||
"sidePlayQueueLayout": "Tata letak antrean putar samping",
|
||||
"sidePlayQueueLayout_description": "Mengatur tata letak antrean putar samping yang terlampir",
|
||||
"sidePlayQueueLayout_optionHorizontal": "Horizontal",
|
||||
"sidePlayQueueLayout_optionVertical": "Vertikal",
|
||||
"waveformLoadingDelay": "Penundaan pemuatan bentuk gelombang",
|
||||
"waveformLoadingDelay_description": "Penundaan dalam detik sebelum memuat bentuk gelombang. Tingkatkan nilai ini jika Anda mengalami tersendat saat menggunakan pemutar web."
|
||||
"sidebarPlaylistListFilterRegex": "Regex filter playlist"
|
||||
},
|
||||
"table": {
|
||||
"column": {
|
||||
"album": "Album",
|
||||
"albumArtist": "Artis album",
|
||||
"albumCount": "Album",
|
||||
"artist": "Artis",
|
||||
"albumCount": "$t(entity.album, {\"count\": 2})",
|
||||
"artist": "$t(entity.artist, {\"count\": 1})",
|
||||
"biography": "Biografi",
|
||||
"bitrate": "Bitrate",
|
||||
"bpm": "Lpm",
|
||||
"channels": "Saluran",
|
||||
"codec": "Kodek",
|
||||
"channels": "$t(common.channel, {\"count\": 2})",
|
||||
"codec": "$t(common.codec)",
|
||||
"comment": "Komentar",
|
||||
"dateAdded": "Tanggal ditambahkan",
|
||||
"discNumber": "Nomor disk",
|
||||
"favorite": "Favorit",
|
||||
"genre": "Genre",
|
||||
"genre": "$t(entity.genre, {\"count\": 1})",
|
||||
"lastPlayed": "Terakhir diputar",
|
||||
"path": "Jalur",
|
||||
"playCount": "Putaran",
|
||||
"rating": "Penilaian",
|
||||
"releaseDate": "Tanggal rilis",
|
||||
"releaseYear": "Tahun",
|
||||
"size": "Ukuran",
|
||||
"songCount": "Trek",
|
||||
"size": "$t(common.size)",
|
||||
"songCount": "$t(entity.track, {\"count\": 2})",
|
||||
"title": "Judul",
|
||||
"trackNumber": "Pista",
|
||||
"bitDepth": "Kedalaman Bit",
|
||||
"sampleRate": "Laju Sampel",
|
||||
"bitDepth": "$t(common.bitDepth)",
|
||||
"sampleRate": "$t(common.sampleRate)",
|
||||
"owner": "Pemilik"
|
||||
},
|
||||
"config": {
|
||||
@@ -1364,13 +1307,6 @@
|
||||
"d": "D",
|
||||
"z": "Z"
|
||||
}
|
||||
},
|
||||
"systemAudioConsentAllow": "Izinkan",
|
||||
"systemAudioConsentBody": "Visualizer memerlukan akses ke audio sistem agar dapat berfungsi",
|
||||
"systemAudioConsentDecline": "Tolak",
|
||||
"systemAudioConsentTitle": "Izinkan akses ke audio sistem?",
|
||||
"systemAudioCaptureFailed": "Tidak dapat memulai pengambilan: {{message}}",
|
||||
"systemAudioNoAudioTrack": "Tidak ada trek audio yang dikembalikan. Pastikan pengambilan audio diaktifkan saat diminta.",
|
||||
"systemAudioExclusiveModeNotSupported": "Visualizer tidak tersedia saat mode audio eksklusif diaktifkan. Nonaktifkan Mode Audio Eksklusif di pengaturan MPV lalu coba lagi."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+17
-348
@@ -20,25 +20,8 @@
|
||||
"viewPlaylists": "Ver $t(entity.playlist, {\"count\": 2})",
|
||||
"openIn": {
|
||||
"lastfm": "Abrir em Last.fm",
|
||||
"musicbrainz": "Abrir em MusicBrainz",
|
||||
"listenbrainz": "Abrir no ListenBrainz",
|
||||
"qobuz": "Abrir no Qobuz",
|
||||
"spotify": "Abrir no Spotify"
|
||||
},
|
||||
"addOrRemoveFromSelection": "Adicionar ou remover da seleção",
|
||||
"goToCurrent": "Ir para o elemento atual",
|
||||
"collapseAllFolders": "Colapsar todas as pastas",
|
||||
"expandAllFolders": "Expandir todas as pastas",
|
||||
"createRadioStation": "Criar $t(entity.radioStation, {\"count\": 1})",
|
||||
"deleteRadioStation": "Apagar $t(entity.radioStation, {\"count\": 1})",
|
||||
"selectAll": "Selecionar tudo",
|
||||
"moveUp": "Mover para cima",
|
||||
"moveDown": "Mover para baixo",
|
||||
"holdToMoveToTop": "Segure para ir ao topo",
|
||||
"holdToMoveToBottom": "Mover para ir ao fundo",
|
||||
"moveItems": "Mover elementos",
|
||||
"viewMore": "Ver mais",
|
||||
"openApplicationDirectory": "Abrir a pasta da aplicação"
|
||||
"musicbrainz": "Abrir em MusicBrainz"
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"action_one": "Ação",
|
||||
@@ -139,21 +122,7 @@
|
||||
"unknown": "Desconhecido",
|
||||
"version": "Versão",
|
||||
"year": "Ano",
|
||||
"yes": "Sim",
|
||||
"countSelected": "{{count}} selecionado",
|
||||
"bitDepth": "Profundidade de bits",
|
||||
"example": "Exemplo",
|
||||
"externalLinks": "Ligações externas",
|
||||
"mood": "Humor",
|
||||
"private": "Privado",
|
||||
"public": "Público",
|
||||
"retry": "Tentar novamente",
|
||||
"rename": "Renomear",
|
||||
"sampleRate": "Taxa de amostragem",
|
||||
"sort": "Ordenar",
|
||||
"clean": "Limpar",
|
||||
"itemsMore": "{{count}} mais",
|
||||
"newVersionAvailable": "Uma nova versão está disponível"
|
||||
"yes": "Sim"
|
||||
},
|
||||
"entity": {
|
||||
"album_one": "Álbum",
|
||||
@@ -232,9 +201,7 @@
|
||||
"serverNotSelectedError": "Nenhum servidor selecionado",
|
||||
"serverRequired": "Servidor necessário",
|
||||
"sessionExpiredError": "A sua sessão expirou",
|
||||
"systemFontError": "Ocorreu um erro ao tentar obter fontes do sistema",
|
||||
"invalidJson": "JSON inválido",
|
||||
"noNetwork": "Servidor não disponível"
|
||||
"systemFontError": "Ocorreu um erro ao tentar obter fontes do sistema"
|
||||
},
|
||||
"filter": {
|
||||
"album": "$t(entity.album, {\"count\": 1})",
|
||||
@@ -278,10 +245,7 @@
|
||||
"songCount": "Contador de músicas",
|
||||
"title": "Titulo",
|
||||
"toYear": "Até o ano",
|
||||
"trackNumber": "Faixa",
|
||||
"matchAnd": "E",
|
||||
"matchOr": "Ou",
|
||||
"sortName": "Ordenar por nome"
|
||||
"trackNumber": "Faixa"
|
||||
},
|
||||
"form": {
|
||||
"addServer": {
|
||||
@@ -295,8 +259,7 @@
|
||||
"input_url": "Url",
|
||||
"input_username": "Nome de utilizador",
|
||||
"success": "Servidor adicionado com sucesso",
|
||||
"title": "Adicionar servidor",
|
||||
"input_remoteUrl": "URL público"
|
||||
"title": "Adicionar servidor"
|
||||
},
|
||||
"addToPlaylist": {
|
||||
"input_playlists": "$t(entity.playlist, {\"count\": 2})",
|
||||
@@ -329,9 +292,7 @@
|
||||
},
|
||||
"queryEditor": {
|
||||
"input_optionMatchAll": "Corresponder todos",
|
||||
"input_optionMatchAny": "Corresponder qualquer um",
|
||||
"resetToDefault": "Restaurar à predefinição",
|
||||
"clearFilters": "Limpar filtros"
|
||||
"input_optionMatchAny": "Corresponder qualquer um"
|
||||
},
|
||||
"shareItem": {
|
||||
"allowDownloading": "Permitir descargas",
|
||||
@@ -344,21 +305,6 @@
|
||||
"updateServer": {
|
||||
"success": "Servidor atualizado com sucesso",
|
||||
"title": "Atualizar servidor"
|
||||
},
|
||||
"createRadioStation": {
|
||||
"title": "Criar estação de rádio",
|
||||
"input_name": "Nome"
|
||||
},
|
||||
"lyricsExport": {
|
||||
"input_synced": "Exportar letras sincronizadas"
|
||||
},
|
||||
"shuffleAll": {
|
||||
"title": "Tocar aleatório",
|
||||
"input_minYear": "A partir do ano",
|
||||
"input_maxYear": "Até o ano"
|
||||
},
|
||||
"privateMode": {
|
||||
"title": "Modo Privado"
|
||||
}
|
||||
},
|
||||
"page": {
|
||||
@@ -371,9 +317,7 @@
|
||||
"topSongs": "Músicas mais tocadas",
|
||||
"topSongsFrom": "Músicas mais tocadas de {{title}}",
|
||||
"viewAll": "Ver tudo",
|
||||
"viewAllTracks": "Ver todas as $t(entity.track, {\"count\": 2})",
|
||||
"topSongsCommunity": "Comunidade",
|
||||
"topSongsPersonal": "Pessoal"
|
||||
"viewAllTracks": "Ver todas as $t(entity.track, {\"count\": 2})"
|
||||
},
|
||||
"albumArtistList": {
|
||||
"title": "$t(entity.albumArtist, {\"count\": 2})"
|
||||
@@ -430,8 +374,7 @@
|
||||
"setRating": "$t(action.setRating)",
|
||||
"playShuffled": "$t(player.shuffle)",
|
||||
"shareItem": "Partilhar elemento",
|
||||
"showDetails": "Obter informações",
|
||||
"goTo": "Ir para"
|
||||
"showDetails": "Obter informações"
|
||||
},
|
||||
"fullscreenPlayer": {
|
||||
"config": {
|
||||
@@ -474,8 +417,7 @@
|
||||
"mostPlayed": "Mais tocado",
|
||||
"newlyAdded": "Lançamentos recém-adicionados",
|
||||
"recentlyPlayed": "Tocado recentemente",
|
||||
"title": "$t(common.home)",
|
||||
"genres": "$t(entity.genre, {\"count\": 2})"
|
||||
"title": "$t(common.home)"
|
||||
},
|
||||
"itemDetail": {
|
||||
"copyPath": "Copiar caminho para a área de transferência",
|
||||
@@ -493,18 +435,7 @@
|
||||
"generalTab": "Geral",
|
||||
"hotkeysTab": "Teclas de atalho",
|
||||
"playbackTab": "Reprodução",
|
||||
"windowTab": "Janela",
|
||||
"application": "Aplicação",
|
||||
"queryBuilder": "Construtor de Consultas",
|
||||
"theme": "Tema",
|
||||
"controls": "Controles",
|
||||
"sidebar": "Barra lateral",
|
||||
"remote": "Remoto",
|
||||
"exportImport": "Importar/exportar",
|
||||
"audio": "Áudio",
|
||||
"lyrics": "Letras",
|
||||
"transcoding": "Transcodificar",
|
||||
"discord": "Discord"
|
||||
"windowTab": "Janela"
|
||||
},
|
||||
"sidebar": {
|
||||
"albumArtists": "$t(entity.albumArtist, {\"count\": 2})",
|
||||
@@ -519,19 +450,12 @@
|
||||
"search": "$t(common.search)",
|
||||
"settings": "$t(common.setting, {\"count\": 2})",
|
||||
"shared": "$t(entity.playlist, {\"count\": 2}) partilhada",
|
||||
"tracks": "$t(entity.track, {\"count\": 2})",
|
||||
"collections": "Coleções"
|
||||
"tracks": "$t(entity.track, {\"count\": 2})"
|
||||
},
|
||||
"trackList": {
|
||||
"artistTracks": "Faixas de {{artist}}",
|
||||
"genreTracks": "\"{{genre}}\" $t(entity.track, {\"count\": 2})",
|
||||
"title": "$t(entity.track, {\"count\": 2})"
|
||||
},
|
||||
"radioList": {
|
||||
"title": "Estações de rádio"
|
||||
},
|
||||
"folderList": {
|
||||
"title": "$t(entity.folder, {\"count\": 2})"
|
||||
}
|
||||
},
|
||||
"player": {
|
||||
@@ -565,11 +489,7 @@
|
||||
"toggleFullscreenPlayer": "Alternar player de ecrã cheio",
|
||||
"unfavorite": "Remover favorito",
|
||||
"pause": "Pausar",
|
||||
"viewQueue": "Ver fila",
|
||||
"lyrics": "Letra",
|
||||
"sleepTimer_minutes": "{{count}} min",
|
||||
"sleepTimer_hours": "{{count}} hr",
|
||||
"sleepTimer_off": "Desligado"
|
||||
"viewQueue": "Ver fila"
|
||||
},
|
||||
"setting": {
|
||||
"accentColor": "Cor de realce",
|
||||
@@ -608,269 +528,18 @@
|
||||
"discordApplicationId": "{{discord}} ID da aplicação",
|
||||
"discordIdleStatus_description": "Quando ativado, atualiza o estado enquanto o player está ocioso",
|
||||
"discordUpdateInterval_description": "O tempo em segundos entre cada atualização (mínimo 15 segundos)",
|
||||
"playButtonBehavior_description": "Define o comportamento padrão do botão play ao adicionar músicas à fila",
|
||||
"autoDJ_itemCount": "Número de elementos",
|
||||
"autoDJ_timing": "Tempo",
|
||||
"customCss_description": "Conteúdo CSS personalizado. Observação: conteúdo e urls remotas são propriedades não permitidas. Uma pré-visualização do seu conteúdo é exibida abaixo. Campos adicionais que não definiu estão presentes devido à sanitização",
|
||||
"automaticUpdates": "Atualizações automáticas",
|
||||
"releaseChannel_optionBeta": "Beta",
|
||||
"releaseChannel_optionLatest": "Mais recente",
|
||||
"discordApplicationId_description": "O ID da aplicação para o rich presence do {{discord}} (defaults: {{defaultId}})",
|
||||
"discordDisplayType_artistname": "Nome(s) do(s) artista(s)",
|
||||
"discordDisplayType": "Tipo de exibição da presença do {{discord}}",
|
||||
"discordIdleStatus": "Mostrar estado ocioso do rich presence",
|
||||
"discordLinkType_mbz_lastfm": "{{musicbrainz}} com alternativa para {{lastfm}}",
|
||||
"discordLinkType_none": "$t(common.none)",
|
||||
"discordLinkType": "Ligações de presença do {{discord}}",
|
||||
"discordServeImage_description": "Partilhar a capa para o rich presence do {{discord}} a partir do próprio servidor, disponível apenas para Jellyfin e Navidrome. O {{discord}} usa um bot para buscar imagens, portanto o seu servidor deve estar acessível pela internet pública",
|
||||
"discordUpdateInterval": "Intervalo de atualização do rich presence do {{discord}}",
|
||||
"exportImportSettings_control_importText": "Importar configurações",
|
||||
"exportImportSettings_control_title": "Importar / exportar configurações",
|
||||
"exportImportSettings_importBtn": "Importar configurações",
|
||||
"exportImportSettings_importModalTitle": "Importar configurações do Feishin",
|
||||
"externalLinks": "Mostrar ligações externas",
|
||||
"font": "Fonte",
|
||||
"fontType_optionBuiltIn": "Fonte embutida",
|
||||
"fontType_optionCustom": "Fonte personalizada",
|
||||
"fontType_optionSystem": "Fonte do sistema",
|
||||
"fontType": "Tipo da fonte",
|
||||
"homeFeatureStyle_optionMultiple": "Múltiplos",
|
||||
"hotkey_globalSearch": "Pequisa global",
|
||||
"hotkey_playbackPause": "Pausar",
|
||||
"hotkey_playbackPlay": "Tocar",
|
||||
"hotkey_playbackPlayPause": "Play / pausar",
|
||||
"hotkey_playbackStop": "Parar",
|
||||
"hotkey_volumeMute": "Volume mudo",
|
||||
"hotkey_volumeUp": "Aumentar volume",
|
||||
"hotkey_zoomIn": "Aproximar",
|
||||
"hotkey_zoomOut": "Afastar",
|
||||
"imageAspectRatio_description": "Se ativado, a capa será exibida usando a sua proporção nativa. Para capas que não forem 1:1, o espaço restante ficará vazio",
|
||||
"imageAspectRatio": "Usar proporção nativa da capa",
|
||||
"language_description": "Define o idioma da aplicação ($t(common.restartRequired))",
|
||||
"lastfm_description": "Exibir ligações para o Last.fm nas páginas de artista/álbum",
|
||||
"lastfm": "Mostrar ligações do Last.fm",
|
||||
"lastfmApiKey_description": "A chave de API para {{lastfm}}. Necessária para capas de álbuns",
|
||||
"lastfmApiKey": "{{lastfm}} chave API",
|
||||
"lyricFetch_description": "Buscar letras em várias fontes da internet",
|
||||
"lyricFetch": "Buscar letras na internet",
|
||||
"lyricFetchProvider": "Provedores para buscar letras",
|
||||
"lyricOffset_description": "Compensar a letra pelo valor especificado em milissegundos",
|
||||
"lyricOffset": "Compensação da letra (ms)",
|
||||
"minimizeToTray_description": "Minimizar a aplicação para a bandeja do sistema",
|
||||
"minimizeToTray": "Minimizar para a bandeja",
|
||||
"minimumScrobblePercentage_description": "O percentual mínimo da música que deve ser reproduzido antes de ser scrobblada",
|
||||
"minimumScrobblePercentage": "Duração mínima para scrobble (percentual)",
|
||||
"minimumScrobbleSeconds_description": "A duração mínima em segundos da música que deve ser reproduzida antes de ser scrobblada",
|
||||
"minimumScrobbleSeconds": "Scrobble mínimo (segundos)",
|
||||
"mpvExecutablePath": "Caminho do executável do mpv",
|
||||
"mpvExtraParameters_help": "Um por linha",
|
||||
"musicbrainz_description": "Exibir ligações para o MusicBrainz nas páginas de artista/álbum, quando o ID do MusicBrainz existir",
|
||||
"musicbrainz": "Mostrar ligações do MusicBrainz",
|
||||
"neteaseTranslation_description": "Quando ativado, busca e exibe letras traduzidas do NetEase, se disponíveis",
|
||||
"neteaseTranslation": "Ativar traduções do NetEase",
|
||||
"passwordStore_description": "Qual armazenamento de palavras-passe/segredos usar. Altere isto se tem problemas para armazenar palavras-passe",
|
||||
"playbackStyle_description": "Selecione o estilo de reprodução a ser usado pelo reprodutor de áudio",
|
||||
"playbackStyle_optionCrossFade": "Transição suave",
|
||||
"playbackStyle_optionNormal": "Normal",
|
||||
"playbackStyle": "Estilo de reprodução",
|
||||
"playButtonBehavior_optionAddLast": "$t(player.addLast)",
|
||||
"playButtonBehavior_optionAddNext": "$t(player.addNext)",
|
||||
"playButtonBehavior_optionPlay": "$t(player.play)",
|
||||
"playButtonBehavior_optionPlayShuffled": "$t(player.shuffle)",
|
||||
"playButtonBehavior": "Comportamento do botão de reprodução",
|
||||
"imageResolution_optionSidebar": "Barra lateral",
|
||||
"imageResolution_optionHeader": "Cabeçalho",
|
||||
"imageResolution_optionFullScreenPlayer": "Reprodutor de ecrã cheio",
|
||||
"playerbarOpenDrawer_description": "Permite clicar na barra do reprodutor para abrir o reprodutor em ecrã cheio",
|
||||
"playerbarOpenDrawer": "Alternar ecrã cheio na barra do reprodutor",
|
||||
"playerbarSliderType_optionWaveform": "Forma de onda",
|
||||
"playerbarWaveformAlign_optionTop": "Topo",
|
||||
"playerbarWaveformAlign_optionCenter": "Centro",
|
||||
"playerbarWaveformAlign_optionBottom": "Fundo",
|
||||
"showRatings_description": "Exibir ou ocultar as avaliações por estrelas",
|
||||
"showRatings": "Exibir avaliações por estrelas",
|
||||
"remotePassword_description": "Define a palavra-passe do servidor de controlo remoto. Estas credenciais, por padrão, são transferidas de forma insegura — use uma palavra-passe única da qualnão dependa",
|
||||
"remotePort": "Porta do servidor de controlo remoto",
|
||||
"replayGainClipping_description": "Evitar clipping causado pelo {{ReplayGain}} reduzindo automaticamente o ganho",
|
||||
"replayGainClipping": "Clipping do {{ReplayGain}}",
|
||||
"replayGainFallback": "Fallback do {{ReplayGain}}",
|
||||
"replayGainMode_optionAlbum": "$t(entity.album, {\"count\": 1})",
|
||||
"replayGainMode_optionNone": "$t(common.none)",
|
||||
"replayGainMode_optionTrack": "$t(entity.track, {\"count\": 1})",
|
||||
"replayGainMode": "Modo {{ReplayGain}}",
|
||||
"replayGainPreamp": "Pré-amplificador {{ReplayGain}} (db)",
|
||||
"sampleRate": "Taxa de amostragem",
|
||||
"sidebarPlaylistFolderView_optionNavigation": "Vista de navegação",
|
||||
"sidebarPlaylistMode_optionCompact": "Compacto",
|
||||
"sidebarPlaylistMode_optionExpanded": "Expandido",
|
||||
"sidePlayQueueStyle_optionAttached": "Anexado",
|
||||
"sidePlayQueueLayout_optionHorizontal": "Horizontal",
|
||||
"sidePlayQueueLayout_optionVertical": "Vertical",
|
||||
"startMinimized": "Abrir minimizado",
|
||||
"theme": "Tema",
|
||||
"themeDark": "Tema (escuro)",
|
||||
"transcode": "Ativar transcodificação",
|
||||
"translationTargetLanguage": "Idioma de destino para tradução",
|
||||
"useSystemTheme": "Usar tema do sistema",
|
||||
"queryBuilderCustomFields_inputLabel": "Etiqueta"
|
||||
"playButtonBehavior_description": "Define o comportamento padrão do botão play ao adicionar músicas à fila"
|
||||
},
|
||||
"table": {
|
||||
"column": {
|
||||
"discNumber": "Disco",
|
||||
"size": "Tamanho",
|
||||
"title": "Titulo",
|
||||
"album": "Álbum",
|
||||
"albumArtist": "Artista do álbum",
|
||||
"albumCount": "Álbuns",
|
||||
"artist": "Artista",
|
||||
"biography": "Bibliografia",
|
||||
"bitDepth": "Profundidade de Bits",
|
||||
"bitrate": "Bitrate",
|
||||
"bpm": "Bpm",
|
||||
"channels": "Canais",
|
||||
"codec": "Codec",
|
||||
"comment": "Comentário",
|
||||
"dateAdded": "Data Adicionada",
|
||||
"favorite": "Favorito",
|
||||
"genre": "Gênero",
|
||||
"lastPlayed": "Última tocada",
|
||||
"path": "Caminho",
|
||||
"playCount": "Reproduções",
|
||||
"rating": "Avaliação",
|
||||
"releaseDate": "Data de Lançamento",
|
||||
"releaseYear": "Ano",
|
||||
"sampleRate": "Taxa de amostragem",
|
||||
"trackNumber": "Faixa",
|
||||
"owner": "Dono"
|
||||
"size": "$t(common.size)",
|
||||
"title": "Titulo"
|
||||
},
|
||||
"config": {
|
||||
"label": {
|
||||
"discNumber": "Numero do disco",
|
||||
"titleCombined": "$t(common.title) (combinado)",
|
||||
"album": "$t(entity.album, {\"count\": 1})",
|
||||
"albumCount": "$t(entity.album, {\"count\": 2})",
|
||||
"albumArtist": "$t(entity.albumArtist, {\"count\": 1})",
|
||||
"artist": "$t(entity.artist, {\"count\": 1})",
|
||||
"biography": "$t(common.biography)",
|
||||
"bitrate": "$t(common.bitrate)",
|
||||
"bpm": "$t(common.bpm)",
|
||||
"codec": "$t(common.codec)",
|
||||
"composer": "Compositor",
|
||||
"duration": "$t(common.duration)",
|
||||
"favorite": "$t(common.favorite)",
|
||||
"genre": "$t(entity.genre, {\"count\": 1})",
|
||||
"image": "Imagem",
|
||||
"lastPlayed": "Última reprodução",
|
||||
"note": "$t(common.note)",
|
||||
"owner": "$t(common.owner)",
|
||||
"path": "$t(common.path)",
|
||||
"playCount": "Contador de Reprodução",
|
||||
"rating": "$t(common.rating)",
|
||||
"releaseDate": "Data de Lançamento",
|
||||
"size": "$t(common.size)",
|
||||
"songCount": "$t(entity.track, {\"count\": 2})",
|
||||
"title": "$t(common.title)",
|
||||
"year": "$t(common.year)"
|
||||
},
|
||||
"general": {
|
||||
"advancedSettings": "Configurações avançadas",
|
||||
"moveUp": "Mover para cima",
|
||||
"moveDown": "Mover para baixo",
|
||||
"alignLeft": "Alinhar à esquerda",
|
||||
"alignCenter": "Alinhar ao centro",
|
||||
"alignRight": "Alinhar à direita",
|
||||
"displayType": "Tipo do ecrã",
|
||||
"gap": "$t(common.gap)",
|
||||
"size": "$t(common.size)",
|
||||
"size_default": "Predefinição",
|
||||
"size_compact": "Compacto",
|
||||
"size_large": "Grande",
|
||||
"tableColumns": "Colunas das tabelas",
|
||||
"pagination": "Paginação",
|
||||
"pagination_itemsPerPage": "Elementos por página",
|
||||
"pagination_infinite": "Infinito",
|
||||
"pagination_paginate": "Paginado",
|
||||
"showHeader": "Exibir cabeçalho"
|
||||
},
|
||||
"view": {
|
||||
"grid": "Grade"
|
||||
}
|
||||
}
|
||||
},
|
||||
"filterOperator": {
|
||||
"contains": "Contém",
|
||||
"endsWith": "Termina com",
|
||||
"is": "É",
|
||||
"isNot": "Não é",
|
||||
"isGreaterThan": "É maior que",
|
||||
"isLessThan": "É menor que",
|
||||
"notContains": "Não contém",
|
||||
"startsWith": "Começa com"
|
||||
},
|
||||
"releaseType": {
|
||||
"primary": {
|
||||
"broadcast": "Broadcast",
|
||||
"ep": "EP",
|
||||
"other": "Outros",
|
||||
"single": "Simples"
|
||||
},
|
||||
"secondary": {
|
||||
"compilation": "Compilação",
|
||||
"djMix": "Mixagem de DJ",
|
||||
"demo": "Demo",
|
||||
"interview": "Entrevista",
|
||||
"live": "Ao Vivo"
|
||||
}
|
||||
},
|
||||
"visualizer": {
|
||||
"systemAudioConsentAllow": "Permitir",
|
||||
"systemAudioConsentDecline": "Recusar",
|
||||
"ignoredPresets": "Predefinições Ignoradas",
|
||||
"selectedPresets": "84",
|
||||
"presets": "Predefinições",
|
||||
"applyPreset": "Aplicar Predefinição",
|
||||
"saveAsPreset": "Gravar como Predefinição",
|
||||
"updatePreset": "Atualizar Predefinição",
|
||||
"copyConfiguration": "Copiar Configuração",
|
||||
"pasteConfiguration": "Colar Configuração",
|
||||
"presetNamePlaceholder": "Digite o nome da predefinição",
|
||||
"general": "Geral",
|
||||
"mode": "Modo",
|
||||
"mode1To8": "Modo 1 - 8",
|
||||
"mode10": "Modo 10",
|
||||
"lineWidth": "Largura da Linha",
|
||||
"opacity": "Opacidade",
|
||||
"vertical": "Vertical",
|
||||
"horizontal": "Horizontal",
|
||||
"level": "Nível",
|
||||
"remove": "Remover",
|
||||
"custom": "Personalizado",
|
||||
"builtIn": "Embutido",
|
||||
"colors": "Cores",
|
||||
"gradient": "Gradiente",
|
||||
"smoothing": "Suavizamento",
|
||||
"sensitivity": "Sensibilidade",
|
||||
"gravity": "Gravidade",
|
||||
"radial": "Radial",
|
||||
"radius": "Raio",
|
||||
"options": {
|
||||
"colorMode": {
|
||||
"gradient": "Gradiente"
|
||||
},
|
||||
"gradient": {
|
||||
"classic": "Clássico",
|
||||
"rainbow": "Arco-íris"
|
||||
},
|
||||
"frequencyScale": {
|
||||
"none": "Nenhum"
|
||||
},
|
||||
"weightingFilter": {
|
||||
"none": "Nenhum",
|
||||
"a": "A",
|
||||
"b": "B",
|
||||
"c": "C",
|
||||
"d": "D",
|
||||
"z": "Z"
|
||||
"titleCombined": "$t(common.title) (combinado)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
export const disableAutoUpdates = () => {
|
||||
return process.env['DISABLE_AUTO_UPDATES'];
|
||||
};
|
||||
|
||||
export const isMacOS = () => {
|
||||
return process.platform === 'darwin';
|
||||
};
|
||||
|
||||
export const isWindows = () => {
|
||||
return process.platform === 'win32';
|
||||
};
|
||||
|
||||
export const isLinux = () => {
|
||||
return process.platform === 'linux';
|
||||
};
|
||||
@@ -7,10 +7,9 @@ import { pid } from 'node:process';
|
||||
import process from 'process';
|
||||
|
||||
import { getMainWindow, sendToastToRenderer } from '../../../index';
|
||||
import { createLog } from '../../../utils';
|
||||
import { createLog, isMacOS, isWindows } from '../../../utils';
|
||||
import { store } from '../settings';
|
||||
|
||||
import { isMacOS, isWindows } from '/@/main/env';
|
||||
import { PlayerData } from '/@/shared/types/domain-types';
|
||||
|
||||
declare module 'node-mpv';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { BrowserWindow, globalShortcut, systemPreferences } from 'electron';
|
||||
|
||||
import { isLinux, isMacOS } from '../../../utils';
|
||||
import { store } from '../settings';
|
||||
|
||||
import { isLinux, isMacOS } from '/@/main/env';
|
||||
import { PlayerType } from '/@/shared/types/types';
|
||||
|
||||
export const enableMediaKeys = (window: BrowserWindow | null) => {
|
||||
|
||||
@@ -9,8 +9,8 @@ import { deflate, gzip } from 'zlib';
|
||||
|
||||
import manifest from './manifest.json';
|
||||
|
||||
import { isLinux } from '/@/main/env';
|
||||
import { getMainWindow } from '/@/main/index';
|
||||
import { isLinux } from '/@/main/utils';
|
||||
import { QueueSong } from '/@/shared/types/domain-types';
|
||||
import { ClientEvent, ServerEvent } from '/@/shared/types/remote-types';
|
||||
import { PlayerRepeat, PlayerStatus, SongState } from '/@/shared/types/types';
|
||||
|
||||
+13
-41
@@ -16,7 +16,6 @@ import {
|
||||
protocol,
|
||||
Rectangle,
|
||||
screen,
|
||||
session,
|
||||
shell,
|
||||
Tray,
|
||||
} from 'electron';
|
||||
@@ -34,9 +33,16 @@ import { store } from './features/core/settings';
|
||||
import { canHandleVisualizerDisplayMedia } from './features/core/visualizer';
|
||||
import MenuBuilder, { MenuPlaybackState } from './menu';
|
||||
import './features';
|
||||
import { autoUpdaterLogInterface, createLog, hotkeyToElectronAccelerator } from './utils';
|
||||
import {
|
||||
autoUpdaterLogInterface,
|
||||
createLog,
|
||||
disableAutoUpdates,
|
||||
hotkeyToElectronAccelerator,
|
||||
isLinux,
|
||||
isMacOS,
|
||||
isWindows,
|
||||
} from './utils';
|
||||
|
||||
import { disableAutoUpdates, isLinux, isMacOS, isWindows } from '/@/main/env';
|
||||
import { PlayerRepeat, PlayerStatus, PlayerType, TitleTheme } from '/@/shared/types/types';
|
||||
|
||||
const ALPHA_UPDATER_CONFIG: {
|
||||
@@ -280,16 +286,6 @@ let currentRepeatMode: PlayerRepeat = PlayerRepeat.NONE;
|
||||
let currentSidebarCollapsed = false;
|
||||
let currentShuffleEnabled = false;
|
||||
let playbackMenuAccelerators: MenuPlaybackState['accelerators'] = {};
|
||||
let inputFocused = false;
|
||||
|
||||
ipcMain.on('input-focus-state', (_event, focused: boolean) => {
|
||||
const next = !!focused;
|
||||
if (inputFocused === next) return;
|
||||
inputFocused = next;
|
||||
if (isMacOS()) {
|
||||
rebuildMainMenu();
|
||||
}
|
||||
});
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
import('source-map-support').then((sourceMapSupport) => {
|
||||
@@ -350,7 +346,7 @@ const rebuildMainMenu = () => {
|
||||
if (!menuBuilder || !mainWindow) return;
|
||||
|
||||
menuBuilder.buildMenu({
|
||||
accelerators: inputFocused ? {} : playbackMenuAccelerators,
|
||||
accelerators: playbackMenuAccelerators,
|
||||
playbackStatus: currentPlaybackStatus,
|
||||
privateMode: currentPrivateMode,
|
||||
repeatMode: currentRepeatMode,
|
||||
@@ -481,15 +477,6 @@ const createTray = () => {
|
||||
tray.setContextMenu(contextMenu);
|
||||
};
|
||||
|
||||
const validateUrl = (url: string): boolean => {
|
||||
// Minor security, really. Enforce only loading websites (http/https). file://
|
||||
// URLs and the like should've already been blocked, but this is another check.
|
||||
// Note that arbitrary web URLs are still allowed under this scheme, although
|
||||
// that should really only be hit by Subsonic share url (or if artist homepage
|
||||
// is allowed for ND extensions)
|
||||
return url.startsWith('http://') || url.startsWith('https://');
|
||||
};
|
||||
|
||||
async function createWindow(first = true): Promise<void> {
|
||||
if (isDevelopment) {
|
||||
await installExtensions().catch(console.log);
|
||||
@@ -531,7 +518,7 @@ async function createWindow(first = true): Promise<void> {
|
||||
devTools: true,
|
||||
nodeIntegration: false,
|
||||
preload: join(__dirname, '../preload/index.js'),
|
||||
sandbox: true,
|
||||
sandbox: false,
|
||||
webSecurity: !store.get('ignore_cors'),
|
||||
},
|
||||
width: 1440,
|
||||
@@ -743,9 +730,7 @@ async function createWindow(first = true): Promise<void> {
|
||||
|
||||
// Open URLs in the user's browser
|
||||
mainWindow.webContents.setWindowOpenHandler((edata) => {
|
||||
if (validateUrl(edata.url)) {
|
||||
shell.openExternal(edata.url);
|
||||
}
|
||||
shell.openExternal(edata.url);
|
||||
return { action: 'deny' };
|
||||
});
|
||||
|
||||
@@ -785,9 +770,7 @@ async function createWindow(first = true): Promise<void> {
|
||||
nativeTheme.themeSource = theme || 'dark';
|
||||
|
||||
mainWindow.webContents.setWindowOpenHandler((details) => {
|
||||
if (validateUrl(details.url)) {
|
||||
shell.openExternal(details.url);
|
||||
}
|
||||
shell.openExternal(details.url);
|
||||
return { action: 'deny' };
|
||||
});
|
||||
|
||||
@@ -1034,17 +1017,6 @@ if (!singleInstance) {
|
||||
return response;
|
||||
});
|
||||
|
||||
session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
|
||||
callback({
|
||||
responseHeaders: {
|
||||
...details.responseHeaders,
|
||||
'Content-Security-Policy': [
|
||||
"script-src 'self' 'unsafe-inline' https://umami.jeffvli.org; style-src 'self' 'unsafe-inline'; media-src 'self' http: https: data: blob:; img-src 'self' http: https: data: blob:; connect-src 'self' http: https: ws: wss:; default-src 'self';",
|
||||
],
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
createWindow();
|
||||
if (store.get('window_enable_tray', true)) {
|
||||
createTray();
|
||||
|
||||
@@ -18,6 +18,22 @@ if (process.env.NODE_ENV === 'development') {
|
||||
};
|
||||
}
|
||||
|
||||
export const disableAutoUpdates = () => {
|
||||
return process.env['DISABLE_AUTO_UPDATES'];
|
||||
};
|
||||
|
||||
export const isMacOS = () => {
|
||||
return process.platform === 'darwin';
|
||||
};
|
||||
|
||||
export const isWindows = () => {
|
||||
return process.platform === 'win32';
|
||||
};
|
||||
|
||||
export const isLinux = () => {
|
||||
return process.platform === 'linux';
|
||||
};
|
||||
|
||||
export const hotkeyToElectronAccelerator = (hotkey: string) => {
|
||||
let accelerator = hotkey;
|
||||
|
||||
|
||||
@@ -8,11 +8,21 @@ const send = (channel: string, ...args: any[]) => {
|
||||
ipcRenderer.send(channel, ...args);
|
||||
};
|
||||
|
||||
const invoke = (channel: string, ...args: any[]) => {
|
||||
return ipcRenderer.invoke(channel, ...args);
|
||||
};
|
||||
|
||||
const on = (channel: string, listener: (event: any, ...args: any[]) => void) => {
|
||||
ipcRenderer.on(channel, listener);
|
||||
};
|
||||
|
||||
const removeListener = (channel: string, listener: (event: any, ...args: any[]) => void) => {
|
||||
ipcRenderer.removeListener(channel, listener);
|
||||
};
|
||||
|
||||
export const ipc = {
|
||||
invoke,
|
||||
on,
|
||||
removeAllListeners,
|
||||
removeListener,
|
||||
send,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ipcRenderer, OpenDialogOptions, webFrame } from 'electron';
|
||||
import { ipcRenderer, IpcRendererEvent, OpenDialogOptions, webFrame } from 'electron';
|
||||
|
||||
import { TitleTheme } from '/@/shared/types/types';
|
||||
|
||||
@@ -41,8 +41,8 @@ const setZoomFactor = (zoomFactor: number) => {
|
||||
webFrame.setZoomFactor(zoomFactor / 100);
|
||||
};
|
||||
|
||||
const fontError = (cb: (file: string) => void) => {
|
||||
ipcRenderer.on('custom-font-error', (_, file) => cb(file));
|
||||
const fontError = (cb: (event: IpcRendererEvent, file: string) => void) => {
|
||||
ipcRenderer.on('custom-font-error', cb);
|
||||
};
|
||||
|
||||
const themeSet = (theme: TitleTheme): void => {
|
||||
|
||||
+15
-11
@@ -1,4 +1,4 @@
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { ipcRenderer, IpcRendererEvent } from 'electron';
|
||||
|
||||
import { QueueSong } from '/@/shared/types/domain-types';
|
||||
import { PlayerRepeat, PlayerStatus } from '/@/shared/types/types';
|
||||
@@ -31,24 +31,28 @@ const updateSong = (song: QueueSong | undefined, imageUrl?: null | string) => {
|
||||
ipcRenderer.send('update-song', song, imageUrl);
|
||||
};
|
||||
|
||||
const requestSeek = (cb: (data: { offset: number }) => void) => {
|
||||
ipcRenderer.on('request-seek', (_, data) => cb(data));
|
||||
const requestSeek = (cb: (event: IpcRendererEvent, data: { offset: number }) => void) => {
|
||||
ipcRenderer.on('request-seek', cb);
|
||||
};
|
||||
|
||||
const requestPosition = (cb: (data: { position: number }) => void) => {
|
||||
ipcRenderer.on('request-position', (_, data) => cb(data));
|
||||
const requestPosition = (cb: (event: IpcRendererEvent, data: { position: number }) => void) => {
|
||||
ipcRenderer.on('request-position', cb);
|
||||
};
|
||||
|
||||
const requestToggleRepeat = (cb: (data: { repeat: PlayerRepeat }) => void) => {
|
||||
ipcRenderer.on('mpris-request-toggle-repeat', (_, data) => cb(data));
|
||||
const requestToggleRepeat = (
|
||||
cb: (event: IpcRendererEvent, data: { repeat: PlayerRepeat }) => void,
|
||||
) => {
|
||||
ipcRenderer.on('mpris-request-toggle-repeat', cb);
|
||||
};
|
||||
|
||||
const requestToggleShuffle = (cb: (data: { shuffle: boolean }) => void) => {
|
||||
ipcRenderer.on('mpris-request-toggle-shuffle', (_, data) => cb(data));
|
||||
const requestToggleShuffle = (
|
||||
cb: (event: IpcRendererEvent, data: { shuffle: boolean }) => void,
|
||||
) => {
|
||||
ipcRenderer.on('mpris-request-toggle-shuffle', cb);
|
||||
};
|
||||
|
||||
const requestVolume = (cb: (data: { volume: number }) => void) => {
|
||||
ipcRenderer.on('request-volume', (_, data) => cb(data));
|
||||
const requestVolume = (cb: (event: IpcRendererEvent, data: { volume: number }) => void) => {
|
||||
ipcRenderer.on('request-volume', cb);
|
||||
};
|
||||
|
||||
export const mpris = {
|
||||
|
||||
+37
-37
@@ -1,4 +1,4 @@
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { ipcRenderer, IpcRendererEvent } from 'electron';
|
||||
|
||||
import { PlayerData } from '/@/shared/types/domain-types';
|
||||
|
||||
@@ -102,76 +102,76 @@ const getAudioDevices = async () => {
|
||||
return ipcRenderer.invoke('player-get-audio-devices');
|
||||
};
|
||||
|
||||
const rendererAutoNext = (cb: (data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-auto-next', (_, data) => cb(data));
|
||||
const rendererAutoNext = (cb: (event: IpcRendererEvent, data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-auto-next', cb);
|
||||
};
|
||||
|
||||
const rendererCurrentTime = (cb: (data: number) => void) => {
|
||||
ipcRenderer.on('renderer-player-current-time', (_, data) => cb(data));
|
||||
const rendererCurrentTime = (cb: (event: IpcRendererEvent, data: number) => void) => {
|
||||
ipcRenderer.on('renderer-player-current-time', cb);
|
||||
};
|
||||
|
||||
const rendererNext = (cb: (data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-next', (_, data) => cb(data));
|
||||
const rendererNext = (cb: (event: IpcRendererEvent, data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-next', cb);
|
||||
};
|
||||
|
||||
const rendererPause = (cb: (data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-pause', (_, data) => cb(data));
|
||||
const rendererPause = (cb: (event: IpcRendererEvent, data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-pause', cb);
|
||||
};
|
||||
|
||||
const rendererPlay = (cb: (data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-play', (_, data) => cb(data));
|
||||
const rendererPlay = (cb: (event: IpcRendererEvent, data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-play', cb);
|
||||
};
|
||||
|
||||
const rendererPlayPause = (cb: (data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-play-pause', (_, data) => cb(data));
|
||||
const rendererPlayPause = (cb: (event: IpcRendererEvent, data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-play-pause', cb);
|
||||
};
|
||||
|
||||
const rendererPrevious = (cb: (data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-previous', (_, data) => cb(data));
|
||||
const rendererPrevious = (cb: (event: IpcRendererEvent, data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-previous', cb);
|
||||
};
|
||||
|
||||
const rendererStop = (cb: (data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-stop', (_, data) => cb(data));
|
||||
const rendererStop = (cb: (event: IpcRendererEvent, data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-stop', cb);
|
||||
};
|
||||
|
||||
const rendererSkipForward = (cb: (data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-skip-forward', (_, data) => cb(data));
|
||||
const rendererSkipForward = (cb: (event: IpcRendererEvent, data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-skip-forward', cb);
|
||||
};
|
||||
|
||||
const rendererSkipBackward = (cb: (data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-skip-backward', (_, data) => cb(data));
|
||||
const rendererSkipBackward = (cb: (event: IpcRendererEvent, data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-skip-backward', cb);
|
||||
};
|
||||
|
||||
const rendererVolumeUp = (cb: (data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-volume-up', (_, data) => cb(data));
|
||||
const rendererVolumeUp = (cb: (event: IpcRendererEvent, data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-volume-up', cb);
|
||||
};
|
||||
|
||||
const rendererVolumeDown = (cb: (data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-volume-down', (_, data) => cb(data));
|
||||
const rendererVolumeDown = (cb: (event: IpcRendererEvent, data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-volume-down', cb);
|
||||
};
|
||||
|
||||
const rendererVolumeMute = (cb: (data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-volume-mute', (_, data) => cb(data));
|
||||
const rendererVolumeMute = (cb: (event: IpcRendererEvent, data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-volume-mute', cb);
|
||||
};
|
||||
|
||||
const rendererToggleRepeat = (cb: (data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-toggle-repeat', (_, data) => cb(data));
|
||||
const rendererToggleRepeat = (cb: (event: IpcRendererEvent, data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-toggle-repeat', cb);
|
||||
};
|
||||
|
||||
const rendererToggleShuffle = (cb: (data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-toggle-shuffle', (_, data) => cb(data));
|
||||
const rendererToggleShuffle = (cb: (event: IpcRendererEvent, data: PlayerData) => void) => {
|
||||
ipcRenderer.on('renderer-player-toggle-shuffle', cb);
|
||||
};
|
||||
|
||||
const rendererQuit = (cb: () => void) => {
|
||||
ipcRenderer.on('renderer-player-quit', () => cb());
|
||||
const rendererQuit = (cb: (event: IpcRendererEvent) => void) => {
|
||||
ipcRenderer.on('renderer-player-quit', cb);
|
||||
};
|
||||
|
||||
const rendererError = (cb: (data: string) => void) => {
|
||||
ipcRenderer.on('renderer-player-error', (_, data) => cb(data));
|
||||
const rendererError = (cb: (event: IpcRendererEvent, data: string) => void) => {
|
||||
ipcRenderer.on('renderer-player-error', cb);
|
||||
};
|
||||
|
||||
const rendererPlayerFallback = (cb: (data: boolean) => void) => {
|
||||
ipcRenderer.on('renderer-player-fallback', (_, data) => cb(data));
|
||||
const rendererPlayerFallback = (cb: (event: IpcRendererEvent, data: boolean) => void) => {
|
||||
ipcRenderer.on('renderer-player-fallback', cb);
|
||||
};
|
||||
|
||||
export const mpvPlayer = {
|
||||
|
||||
+16
-11
@@ -1,28 +1,33 @@
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { ipcRenderer, IpcRendererEvent } from 'electron';
|
||||
|
||||
import { QueueSong } from '/@/shared/types/domain-types';
|
||||
import { PlayerStatus } from '/@/shared/types/types';
|
||||
|
||||
const requestFavorite = (
|
||||
cb: (data: { favorite: boolean; id: string; serverId: string }) => void,
|
||||
cb: (
|
||||
event: IpcRendererEvent,
|
||||
data: { favorite: boolean; id: string; serverId: string },
|
||||
) => void,
|
||||
) => {
|
||||
ipcRenderer.on('request-favorite', (_, data) => cb(data));
|
||||
ipcRenderer.on('request-favorite', cb);
|
||||
};
|
||||
|
||||
const requestPosition = (cb: (data: { position: number }) => void) => {
|
||||
ipcRenderer.on('request-position', (_, data) => cb(data));
|
||||
const requestPosition = (cb: (event: IpcRendererEvent, data: { position: number }) => void) => {
|
||||
ipcRenderer.on('request-position', cb);
|
||||
};
|
||||
|
||||
const requestRating = (cb: (data: { id: string; rating: number; serverId: string }) => void) => {
|
||||
ipcRenderer.on('request-rating', (_, data) => cb(data));
|
||||
const requestRating = (
|
||||
cb: (event: IpcRendererEvent, data: { id: string; rating: number; serverId: string }) => void,
|
||||
) => {
|
||||
ipcRenderer.on('request-rating', cb);
|
||||
};
|
||||
|
||||
const requestSeek = (cb: (data: { offset: number }) => void) => {
|
||||
ipcRenderer.on('request-seek', (_, data) => cb(data));
|
||||
const requestSeek = (cb: (event: IpcRendererEvent, data: { offset: number }) => void) => {
|
||||
ipcRenderer.on('request-seek', cb);
|
||||
};
|
||||
|
||||
const requestVolume = (cb: (data: { volume: number }) => void) => {
|
||||
ipcRenderer.on('request-volume', (_, data) => cb(data));
|
||||
const requestVolume = (cb: (event: IpcRendererEvent, data: { volume: number }) => void) => {
|
||||
ipcRenderer.on('request-volume', cb);
|
||||
};
|
||||
|
||||
const setRemoteEnabled = (enabled: boolean): Promise<null | string> => {
|
||||
|
||||
+33
-37
@@ -1,6 +1,6 @@
|
||||
import { ipcRenderer, webFrame } from 'electron';
|
||||
import { ipcRenderer, IpcRendererEvent, webFrame } from 'electron';
|
||||
|
||||
import { disableAutoUpdates, isLinux, isMacOS, isWindows } from '../main/env';
|
||||
import { disableAutoUpdates, isLinux, isMacOS, isWindows } from '../main/utils';
|
||||
|
||||
const openItem = async (path: string) => {
|
||||
return ipcRenderer.invoke('open-item', path);
|
||||
@@ -10,14 +10,29 @@ const openApplicationDirectory = async () => {
|
||||
return ipcRenderer.invoke('open-application-directory');
|
||||
};
|
||||
|
||||
const playerErrorListener = (cb: (data: { code: number }) => void) => {
|
||||
ipcRenderer.on('player-error-listener', (_, data) => cb(data));
|
||||
const playerErrorListener = (cb: (event: IpcRendererEvent, data: { code: number }) => void) => {
|
||||
ipcRenderer.on('player-error-listener', cb);
|
||||
};
|
||||
|
||||
const mainMessageListener = (
|
||||
cb: (data: { message: string; type: 'error' | 'info' | 'success' | 'warning' }) => void,
|
||||
cb: (
|
||||
event: IpcRendererEvent,
|
||||
data: { message: string; type: 'error' | 'info' | 'success' | 'warning' },
|
||||
) => void,
|
||||
) => {
|
||||
ipcRenderer.on('toast-from-main', (_, data) => cb(data));
|
||||
ipcRenderer.on('toast-from-main', cb);
|
||||
};
|
||||
|
||||
const logger = (
|
||||
cb: (
|
||||
event: IpcRendererEvent,
|
||||
data: {
|
||||
message: string;
|
||||
type: 'debug' | 'error' | 'info' | 'verbose' | 'warning';
|
||||
},
|
||||
) => void,
|
||||
) => {
|
||||
ipcRenderer.send('logger', cb);
|
||||
};
|
||||
|
||||
const download = (url: string) => {
|
||||
@@ -28,14 +43,6 @@ const checkForUpdates = (): Promise<{ updateAvailable: boolean; version?: string
|
||||
return ipcRenderer.invoke('app-check-for-updates');
|
||||
};
|
||||
|
||||
const startPowerSaveBlocker = (full: boolean) => {
|
||||
return ipcRenderer.invoke('power-save-blocker-start', { full });
|
||||
};
|
||||
|
||||
const stopPowerSaveBlocker = () => {
|
||||
return ipcRenderer.invoke('power-save-blocker-stop');
|
||||
};
|
||||
|
||||
const forceGarbageCollection = (): boolean => {
|
||||
try {
|
||||
if (typeof global.gc === 'function') {
|
||||
@@ -54,36 +61,28 @@ const forceGarbageCollection = (): boolean => {
|
||||
}
|
||||
};
|
||||
|
||||
const setInputFocused = (focused: boolean) => {
|
||||
ipcRenderer.send('input-focus-state', focused);
|
||||
const rendererOpenSettings = (cb: (event: IpcRendererEvent) => void) => {
|
||||
ipcRenderer.on('renderer-open-settings', cb);
|
||||
};
|
||||
|
||||
const rendererOpenSettings = (cb: () => void) => {
|
||||
ipcRenderer.on('renderer-open-settings', () => cb());
|
||||
const rendererOpenCommandPalette = (cb: (event: IpcRendererEvent) => void) => {
|
||||
ipcRenderer.on('renderer-open-command-palette', cb);
|
||||
};
|
||||
|
||||
const rendererOpenCommandPalette = (cb: () => void) => {
|
||||
ipcRenderer.on('renderer-open-command-palette', () => cb());
|
||||
const rendererOpenManageServers = (cb: (event: IpcRendererEvent) => void) => {
|
||||
ipcRenderer.on('renderer-open-manage-servers', cb);
|
||||
};
|
||||
|
||||
const rendererOpenManageServers = (cb: () => void) => {
|
||||
ipcRenderer.on('renderer-open-manage-servers', () => cb());
|
||||
};
|
||||
|
||||
const rendererTogglePrivateMode = (cb: () => void) => {
|
||||
const rendererTogglePrivateMode = (cb: (event: IpcRendererEvent) => void) => {
|
||||
ipcRenderer.on('renderer-toggle-private-mode', cb);
|
||||
};
|
||||
|
||||
const rendererToggleSidebar = (cb: () => void) => {
|
||||
ipcRenderer.on('renderer-toggle-sidebar', () => cb());
|
||||
const rendererToggleSidebar = (cb: (event: IpcRendererEvent) => void) => {
|
||||
ipcRenderer.on('renderer-toggle-sidebar', cb);
|
||||
};
|
||||
|
||||
const rendererOpenReleaseNotes = (cb: () => void) => {
|
||||
ipcRenderer.on('renderer-open-release-notes', () => cb());
|
||||
};
|
||||
|
||||
const rendererUpdateAvailable = (cb: (version: string) => void) => {
|
||||
ipcRenderer.on('update-available', (_, version) => cb(version));
|
||||
const rendererOpenReleaseNotes = (cb: (event: IpcRendererEvent) => void) => {
|
||||
ipcRenderer.on('renderer-open-release-notes', cb);
|
||||
};
|
||||
|
||||
export const utils = {
|
||||
@@ -94,6 +93,7 @@ export const utils = {
|
||||
isLinux,
|
||||
isMacOS,
|
||||
isWindows,
|
||||
logger,
|
||||
mainMessageListener,
|
||||
openApplicationDirectory,
|
||||
openItem,
|
||||
@@ -104,10 +104,6 @@ export const utils = {
|
||||
rendererOpenSettings,
|
||||
rendererTogglePrivateMode,
|
||||
rendererToggleSidebar,
|
||||
rendererUpdateAvailable,
|
||||
setInputFocused,
|
||||
startPowerSaveBlocker,
|
||||
stopPowerSaveBlocker,
|
||||
};
|
||||
|
||||
export type Utils = typeof utils;
|
||||
|
||||
@@ -93,7 +93,6 @@ const AppEffects = () => (
|
||||
<GlobalShortcutsEffect />
|
||||
<LanguageEffect />
|
||||
<NativeMenuSyncEffect />
|
||||
<InputFocusEffect />
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -171,42 +170,3 @@ const NativeMenuSyncEffect = () => {
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
const InputFocusEffect = () => {
|
||||
useEffect(() => {
|
||||
if (!isElectron()) return;
|
||||
|
||||
const handleFocusIn = (e: FocusEvent) => {
|
||||
const target = e.target as Element | null;
|
||||
if (
|
||||
target instanceof HTMLInputElement ||
|
||||
target instanceof HTMLTextAreaElement ||
|
||||
(target instanceof HTMLElement && target.isContentEditable)
|
||||
) {
|
||||
window.api?.utils?.setInputFocused?.(true);
|
||||
}
|
||||
};
|
||||
|
||||
const handleFocusOut = (e: FocusEvent) => {
|
||||
const related = e.relatedTarget as Element | null;
|
||||
if (
|
||||
related instanceof HTMLInputElement ||
|
||||
related instanceof HTMLTextAreaElement ||
|
||||
(related instanceof HTMLElement && related.isContentEditable)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
window.api?.utils?.setInputFocused?.(false);
|
||||
};
|
||||
|
||||
document.addEventListener('focusin', handleFocusIn);
|
||||
document.addEventListener('focusout', handleFocusOut);
|
||||
|
||||
return () => {
|
||||
document.removeEventListener('focusin', handleFocusIn);
|
||||
document.removeEventListener('focusout', handleFocusOut);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -112,7 +112,7 @@ export const useMainPlayerListener = () => {
|
||||
decreaseVolume(volumeWheelStep);
|
||||
});
|
||||
|
||||
mpvPlayerListener.rendererError((message: string) => {
|
||||
mpvPlayerListener.rendererError((_event: any, message: string) => {
|
||||
handleMpvError(message);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,202 +0,0 @@
|
||||
import type { QueryClient } from '@tanstack/react-query';
|
||||
|
||||
import { autoDjGenreIdsForSongGenre, autoDjPushUniqueAlbumIds } from './auto-dj-utils';
|
||||
|
||||
import { queryKeys } from '/@/renderer/api/query-keys';
|
||||
import { albumQueries } from '/@/renderer/features/albums/api/album-api';
|
||||
import { songsQueries } from '/@/renderer/features/songs/api/songs-api';
|
||||
import { AUTO_DJ_STRATEGY, type AutoDJStrategy } from '/@/renderer/store/settings.store';
|
||||
import { shuffle } from '/@/renderer/utils/shuffle';
|
||||
import {
|
||||
AlbumListSort,
|
||||
type QueueSong,
|
||||
type ServerListItem,
|
||||
SortOrder,
|
||||
} from '/@/shared/types/domain-types';
|
||||
|
||||
export type AutoDjAlbumCollectArgs = {
|
||||
albumStrategy: AutoDJStrategy;
|
||||
currentSong: QueueSong;
|
||||
itemCount: number;
|
||||
musicFolderId: string | string[] | undefined;
|
||||
queryClient: QueryClient;
|
||||
queueAlbumIdSet: Set<string>;
|
||||
server: null | ServerListItem | undefined;
|
||||
serverId: string;
|
||||
trySimilarSongs: boolean;
|
||||
};
|
||||
|
||||
export const runAutoDjAlbumIds = async (args: AutoDjAlbumCollectArgs): Promise<string[]> => {
|
||||
switch (args.albumStrategy) {
|
||||
case AUTO_DJ_STRATEGY.LIBRARY_RANDOM: {
|
||||
return collectAlbumsLibraryRandom(args);
|
||||
}
|
||||
default: {
|
||||
return collectAlbumsSimilar(args);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const collectAlbumsLibraryRandom = async (args: AutoDjAlbumCollectArgs): Promise<string[]> => {
|
||||
const page = await args.queryClient.fetchQuery({
|
||||
...albumQueries.list({
|
||||
query: {
|
||||
limit: Math.max(args.itemCount, 1),
|
||||
musicFolderId: args.musicFolderId,
|
||||
sortBy: AlbumListSort.RANDOM,
|
||||
sortOrder: SortOrder.ASC,
|
||||
startIndex: 0,
|
||||
},
|
||||
serverId: args.serverId,
|
||||
}),
|
||||
queryKey: queryKeys.player.fetch({ autoDjAlbumLibraryRandom: args.currentSong?.id }),
|
||||
});
|
||||
|
||||
const ids = page.items.map((a) => a.id).filter((id) => id && !args.queueAlbumIdSet.has(id));
|
||||
return shuffle(ids).slice(0, args.itemCount);
|
||||
};
|
||||
|
||||
const collectAlbumsSimilar = async (args: AutoDjAlbumCollectArgs): Promise<string[]> => {
|
||||
const targetAlbumCount = args.itemCount;
|
||||
const candidateAlbumIds: string[] = [];
|
||||
const seenAlbumCandidates = new Set<string>();
|
||||
|
||||
if (args.trySimilarSongs && args.currentSong?.id) {
|
||||
const similarSongsFromSimilarApi = await args.queryClient.fetchQuery({
|
||||
...songsQueries.similar({
|
||||
query: {
|
||||
count: args.itemCount * 4,
|
||||
songId: args.currentSong.id,
|
||||
},
|
||||
serverId: args.serverId,
|
||||
}),
|
||||
queryKey: queryKeys.player.fetch({
|
||||
similarSongAlbumDj: args.currentSong.id,
|
||||
}),
|
||||
});
|
||||
|
||||
autoDjPushUniqueAlbumIds(
|
||||
candidateAlbumIds,
|
||||
seenAlbumCandidates,
|
||||
args.queueAlbumIdSet,
|
||||
...similarSongsFromSimilarApi.map((s) => s.albumId),
|
||||
);
|
||||
}
|
||||
|
||||
if (candidateAlbumIds.length < targetAlbumCount && args.currentSong && args.server) {
|
||||
const genre = args.currentSong.genres?.[0];
|
||||
if (genre) {
|
||||
const genreIds = autoDjGenreIdsForSongGenre(genre, args.server.type);
|
||||
|
||||
const genreAlbums = await args.queryClient.fetchQuery({
|
||||
...albumQueries.list({
|
||||
query: {
|
||||
genreIds,
|
||||
limit: 50,
|
||||
musicFolderId: args.musicFolderId,
|
||||
sortBy: AlbumListSort.RANDOM,
|
||||
sortOrder: SortOrder.ASC,
|
||||
startIndex: 0,
|
||||
},
|
||||
serverId: args.serverId,
|
||||
}),
|
||||
queryKey: queryKeys.player.fetch({
|
||||
genreAlbumDj: genreIds,
|
||||
song: args.currentSong.id,
|
||||
}),
|
||||
});
|
||||
|
||||
autoDjPushUniqueAlbumIds(
|
||||
candidateAlbumIds,
|
||||
seenAlbumCandidates,
|
||||
args.queueAlbumIdSet,
|
||||
...genreAlbums.items.map((album) => album.id),
|
||||
);
|
||||
|
||||
if (!args.trySimilarSongs) {
|
||||
const randomAlbumMixCount = Math.max(1, Math.ceil(50 * 0.2));
|
||||
const randomAlbumsMix = await args.queryClient.fetchQuery({
|
||||
...albumQueries.list({
|
||||
query: {
|
||||
limit: randomAlbumMixCount,
|
||||
musicFolderId: args.musicFolderId,
|
||||
sortBy: AlbumListSort.RANDOM,
|
||||
sortOrder: SortOrder.ASC,
|
||||
startIndex: 0,
|
||||
},
|
||||
serverId: args.serverId,
|
||||
}),
|
||||
queryKey: queryKeys.player.fetch({
|
||||
genreAlbumDjMixRandom: args.currentSong.id,
|
||||
}),
|
||||
});
|
||||
|
||||
autoDjPushUniqueAlbumIds(
|
||||
candidateAlbumIds,
|
||||
seenAlbumCandidates,
|
||||
args.queueAlbumIdSet,
|
||||
...randomAlbumsMix.items.map((album) => album.id),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (candidateAlbumIds.length < targetAlbumCount && args.currentSong) {
|
||||
const albumArtist = args.currentSong.albumArtists?.[0];
|
||||
|
||||
if (albumArtist) {
|
||||
const albumsByArtist = await args.queryClient.fetchQuery({
|
||||
...albumQueries.list({
|
||||
query: {
|
||||
artistIds: [albumArtist.id],
|
||||
limit: 50,
|
||||
musicFolderId: args.musicFolderId,
|
||||
sortBy: AlbumListSort.RANDOM,
|
||||
sortOrder: SortOrder.ASC,
|
||||
startIndex: 0,
|
||||
},
|
||||
serverId: args.serverId,
|
||||
}),
|
||||
queryKey: queryKeys.player.fetch({
|
||||
artistAlbumDj: albumArtist.id,
|
||||
song: args.currentSong.id,
|
||||
}),
|
||||
});
|
||||
|
||||
autoDjPushUniqueAlbumIds(
|
||||
candidateAlbumIds,
|
||||
seenAlbumCandidates,
|
||||
args.queueAlbumIdSet,
|
||||
...albumsByArtist.items.map((album) => album.id),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (candidateAlbumIds.length < targetAlbumCount && args.currentSong) {
|
||||
const randomAlbumsFallback = await args.queryClient.fetchQuery({
|
||||
...albumQueries.list({
|
||||
query: {
|
||||
limit: 80,
|
||||
musicFolderId: args.musicFolderId,
|
||||
sortBy: AlbumListSort.RANDOM,
|
||||
sortOrder: SortOrder.ASC,
|
||||
startIndex: 0,
|
||||
},
|
||||
serverId: args.serverId,
|
||||
}),
|
||||
queryKey: queryKeys.player.fetch({
|
||||
fallbackAlbumDj: args.currentSong.id,
|
||||
}),
|
||||
});
|
||||
|
||||
autoDjPushUniqueAlbumIds(
|
||||
candidateAlbumIds,
|
||||
seenAlbumCandidates,
|
||||
args.queueAlbumIdSet,
|
||||
...randomAlbumsFallback.items.map((album) => album.id),
|
||||
);
|
||||
}
|
||||
|
||||
const shuffledAlbums = shuffle(candidateAlbumIds);
|
||||
return shuffledAlbums.slice(0, targetAlbumCount);
|
||||
};
|
||||
@@ -1,164 +0,0 @@
|
||||
import type { QueryClient } from '@tanstack/react-query';
|
||||
|
||||
import { queryKeys } from '/@/renderer/api/query-keys';
|
||||
import { songsQueries } from '/@/renderer/features/songs/api/songs-api';
|
||||
import { AUTO_DJ_STRATEGY, type AutoDJStrategy } from '/@/renderer/store/settings.store';
|
||||
import { shuffleInPlace } from '/@/renderer/utils/shuffle';
|
||||
import {
|
||||
Played,
|
||||
type QueueSong,
|
||||
type ServerListItem,
|
||||
Song,
|
||||
SongListSort,
|
||||
SortOrder,
|
||||
} from '/@/shared/types/domain-types';
|
||||
|
||||
export type AutoDjSongCollectArgs = {
|
||||
currentSong: QueueSong;
|
||||
itemCount: number;
|
||||
musicFolderId: string | string[] | undefined;
|
||||
queryClient: QueryClient;
|
||||
queueSongIdSet: Set<string>;
|
||||
server: null | ServerListItem | undefined;
|
||||
serverId: string;
|
||||
songStrategy: AutoDJStrategy;
|
||||
trySimilarSongs: boolean;
|
||||
};
|
||||
|
||||
export const runAutoDjSongs = async (args: AutoDjSongCollectArgs): Promise<Song[]> => {
|
||||
switch (args.songStrategy) {
|
||||
case AUTO_DJ_STRATEGY.LIBRARY_RANDOM: {
|
||||
return collectSongsLibraryRandom(args);
|
||||
}
|
||||
default: {
|
||||
return collectSongsSimilar(args);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const collectSongsLibraryRandom = async (args: AutoDjSongCollectArgs): Promise<Song[]> => {
|
||||
const randomSongs = await args.queryClient.fetchQuery({
|
||||
...songsQueries.random({
|
||||
query: {
|
||||
limit: Math.max(args.itemCount * 3, 50),
|
||||
played: Played.All,
|
||||
},
|
||||
serverId: args.serverId,
|
||||
}),
|
||||
queryKey: queryKeys.player.fetch({ autoDjLibraryRandomSongs: args.currentSong.id }),
|
||||
});
|
||||
|
||||
const pool = randomSongs.items.filter((song) => !args.queueSongIdSet.has(song.id));
|
||||
const shuffled = shuffleInPlace(pool);
|
||||
return shuffled.slice(0, args.itemCount);
|
||||
};
|
||||
|
||||
const collectSongsSimilar = async (args: AutoDjSongCollectArgs): Promise<Song[]> => {
|
||||
let uniqueSimilarSongs: Song[] = [];
|
||||
|
||||
if (args.trySimilarSongs) {
|
||||
const similarSongs = await args.queryClient.fetchQuery({
|
||||
...songsQueries.similar({
|
||||
query: {
|
||||
count: args.itemCount,
|
||||
songId: args.currentSong?.id,
|
||||
},
|
||||
serverId: args.serverId,
|
||||
}),
|
||||
queryKey: queryKeys.player.fetch({ similarSongs: args.currentSong?.id }),
|
||||
});
|
||||
|
||||
uniqueSimilarSongs = similarSongs.filter((song) => !args.queueSongIdSet.has(song.id));
|
||||
}
|
||||
|
||||
if (uniqueSimilarSongs.length < args.itemCount) {
|
||||
const genre = args.currentSong?.genres?.[0];
|
||||
|
||||
if (genre) {
|
||||
const genreLimit = 50;
|
||||
const genreSimilarSongs = await args.queryClient.fetchQuery({
|
||||
...songsQueries.random({
|
||||
query: {
|
||||
genre: genre.id,
|
||||
limit: genreLimit,
|
||||
played: Played.All,
|
||||
},
|
||||
serverId: args.serverId,
|
||||
}),
|
||||
queryKey: queryKeys.player.fetch({
|
||||
genre,
|
||||
similarSongs: args.currentSong?.id,
|
||||
}),
|
||||
});
|
||||
|
||||
const genreSongs = genreSimilarSongs.items.filter(
|
||||
(song) => !args.queueSongIdSet.has(song.id),
|
||||
);
|
||||
|
||||
if (!args.trySimilarSongs) {
|
||||
const randomSongCount = Math.max(1, Math.ceil(genreLimit * 0.2));
|
||||
|
||||
const randomSongs = await args.queryClient.fetchQuery({
|
||||
...songsQueries.random({
|
||||
query: { limit: randomSongCount, played: Played.All },
|
||||
serverId: args.serverId,
|
||||
}),
|
||||
});
|
||||
|
||||
const uniqueRandomSongs = randomSongs.items.filter(
|
||||
(song) => !args.queueSongIdSet.has(song.id),
|
||||
);
|
||||
|
||||
const randomSongsToAdd = uniqueRandomSongs.slice(0, randomSongCount);
|
||||
uniqueSimilarSongs.push(...randomSongsToAdd, ...genreSongs);
|
||||
} else {
|
||||
uniqueSimilarSongs.push(...genreSongs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (uniqueSimilarSongs.length < args.itemCount) {
|
||||
const albumArtist = args.currentSong?.albumArtists?.[0];
|
||||
|
||||
if (albumArtist) {
|
||||
const albumArtistSimilarSongs = await args.queryClient.fetchQuery({
|
||||
...songsQueries.list({
|
||||
query: {
|
||||
albumArtistIds: [albumArtist.id],
|
||||
limit: 50,
|
||||
sortBy: SongListSort.RANDOM,
|
||||
sortOrder: SortOrder.ASC,
|
||||
startIndex: 0,
|
||||
},
|
||||
serverId: args.serverId,
|
||||
}),
|
||||
queryKey: queryKeys.player.fetch({
|
||||
albumArtist,
|
||||
similarSongs: args.currentSong?.id,
|
||||
}),
|
||||
});
|
||||
|
||||
uniqueSimilarSongs.push(
|
||||
...albumArtistSimilarSongs.items.filter(
|
||||
(song) => !args.queueSongIdSet.has(song.id),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (uniqueSimilarSongs.length < args.itemCount) {
|
||||
const randomSongs = await args.queryClient.fetchQuery({
|
||||
...songsQueries.random({
|
||||
query: { limit: 50, played: Played.All },
|
||||
serverId: args.serverId,
|
||||
}),
|
||||
});
|
||||
|
||||
uniqueSimilarSongs.push(
|
||||
...randomSongs.items.filter((song) => !args.queueSongIdSet.has(song.id)),
|
||||
);
|
||||
}
|
||||
|
||||
const shuffledSongs = shuffleInPlace(uniqueSimilarSongs);
|
||||
return shuffledSongs.slice(0, args.itemCount);
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
import type { Genre } from '/@/shared/types/domain-types';
|
||||
|
||||
import { ServerType } from '/@/shared/types/domain-types';
|
||||
|
||||
export const autoDjPushUniqueAlbumIds = (
|
||||
accumulator: string[],
|
||||
seenAlbums: Set<string>,
|
||||
queueAlbumIdSet: Set<string>,
|
||||
...ids: (string | undefined)[]
|
||||
) => {
|
||||
for (const id of ids) {
|
||||
if (!id || queueAlbumIdSet.has(id) || seenAlbums.has(id)) continue;
|
||||
seenAlbums.add(id);
|
||||
accumulator.push(id);
|
||||
}
|
||||
};
|
||||
|
||||
export const autoDjGenreIdsForSongGenre = (genre: Genre, serverType: ServerType): string[] => {
|
||||
if (serverType === ServerType.JELLYFIN) {
|
||||
return [genre.id];
|
||||
}
|
||||
|
||||
if (serverType === ServerType.NAVIDROME || serverType === ServerType.SUBSONIC) {
|
||||
return [genre.name];
|
||||
}
|
||||
|
||||
return [genre.id];
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
import { t } from 'i18next';
|
||||
import { useCallback, useEffect, useMemo, useState, WheelEvent } from 'react';
|
||||
import { useCallback, useEffect, useState, WheelEvent } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { PopoverPlayQueue } from '/@/renderer/features/now-playing/components/popover-play-queue';
|
||||
@@ -12,9 +12,6 @@ import { useCreateFavorite } from '/@/renderer/features/shared/mutations/create-
|
||||
import { useDeleteFavorite } from '/@/renderer/features/shared/mutations/delete-favorite-mutation';
|
||||
import { useHotkeys } from '/@/renderer/hooks/use-hotkeys';
|
||||
import {
|
||||
AUTO_DJ_MODE,
|
||||
AUTO_DJ_STRATEGY,
|
||||
type AutoDJStrategy,
|
||||
useAppStoreActions,
|
||||
useAutoDJSettings,
|
||||
useCurrentServer,
|
||||
@@ -37,15 +34,7 @@ import { ActionIcon } from '/@/shared/components/action-icon/action-icon';
|
||||
import { Button } from '/@/shared/components/button/button';
|
||||
import { Flex } from '/@/shared/components/flex/flex';
|
||||
import { Group } from '/@/shared/components/group/group';
|
||||
import { NumberInput } from '/@/shared/components/number-input/number-input';
|
||||
import { Paper } from '/@/shared/components/paper/paper';
|
||||
import { Popover } from '/@/shared/components/popover/popover';
|
||||
import { Rating } from '/@/shared/components/rating/rating';
|
||||
import { SegmentedControl } from '/@/shared/components/segmented-control/segmented-control';
|
||||
import { Select } from '/@/shared/components/select/select';
|
||||
import { Stack } from '/@/shared/components/stack/stack';
|
||||
import { Switch } from '/@/shared/components/switch/switch';
|
||||
import { Text } from '/@/shared/components/text/text';
|
||||
import { useMediaQuery } from '/@/shared/hooks/use-media-query';
|
||||
import { useThrottledCallback } from '/@/shared/hooks/use-throttled-callback';
|
||||
import { useThrottledValue } from '/@/shared/hooks/use-throttled-value';
|
||||
@@ -101,148 +90,28 @@ const AutoDJButton = () => {
|
||||
const settings = useAutoDJSettings();
|
||||
const { setSettings } = useSettingsStoreActions();
|
||||
|
||||
const itemLabels = useMemo(() => {
|
||||
return {
|
||||
description: t('setting.autoDJ_itemCount_description'),
|
||||
title: t('setting.autoDJ_itemCount'),
|
||||
};
|
||||
}, [t]);
|
||||
|
||||
const strategySelectData = useMemo(
|
||||
() => [
|
||||
{
|
||||
label: t('setting.autoDJ_strategy_option_similar'),
|
||||
value: AUTO_DJ_STRATEGY.SIMILAR,
|
||||
const toggleAutoDJ = () => {
|
||||
setSettings({
|
||||
autoDJ: {
|
||||
...settings,
|
||||
enabled: !settings.enabled,
|
||||
},
|
||||
{
|
||||
label: t('setting.autoDJ_strategy_option_library_random'),
|
||||
value: AUTO_DJ_STRATEGY.LIBRARY_RANDOM,
|
||||
},
|
||||
],
|
||||
[t],
|
||||
);
|
||||
|
||||
const strategyLabels =
|
||||
settings.mode === AUTO_DJ_MODE.ALBUMS
|
||||
? {
|
||||
description: '',
|
||||
title: t('setting.autoDJ_albumStrategy'),
|
||||
}
|
||||
: {
|
||||
description: '',
|
||||
title: t('setting.autoDJ_songStrategy'),
|
||||
};
|
||||
|
||||
const strategyValue =
|
||||
settings.mode === AUTO_DJ_MODE.ALBUMS
|
||||
? (settings.albumStrategy ?? AUTO_DJ_STRATEGY.SIMILAR)
|
||||
: (settings.songStrategy ?? AUTO_DJ_STRATEGY.SIMILAR);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<Popover position="top-end" withArrow>
|
||||
<Popover.Target>
|
||||
<Button
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
}}
|
||||
size="compact-xs"
|
||||
style={{ color: settings.enabled ? 'var(--theme-colors-primary)' : undefined }}
|
||||
uppercase
|
||||
variant="transparent"
|
||||
>
|
||||
{t('setting.autoDJ')}
|
||||
</Button>
|
||||
</Popover.Target>
|
||||
<Popover.Dropdown maw={320} miw={260} onClick={(e) => e.stopPropagation()} p="sm">
|
||||
<Stack gap="sm">
|
||||
<Paper p="md" radius="md">
|
||||
<Group align="center" gap="xs" justify="space-between" wrap="nowrap">
|
||||
<Text fw={600} isNoSelect size="sm">
|
||||
{t('setting.autoDJ_enabled')}
|
||||
</Text>
|
||||
<Switch
|
||||
checked={settings.enabled}
|
||||
onChange={(e) =>
|
||||
setSettings({
|
||||
autoDJ: { enabled: e.currentTarget.checked },
|
||||
})
|
||||
}
|
||||
/>
|
||||
</Group>
|
||||
</Paper>
|
||||
<SegmentedControl
|
||||
data={[
|
||||
{ label: t('setting.autoDJ_mode_songs'), value: AUTO_DJ_MODE.SONGS },
|
||||
{
|
||||
label: t('setting.autoDJ_mode_albums'),
|
||||
value: AUTO_DJ_MODE.ALBUMS,
|
||||
},
|
||||
]}
|
||||
onChange={(value) =>
|
||||
setSettings({
|
||||
autoDJ: {
|
||||
mode: value as 'albums' | 'songs',
|
||||
},
|
||||
})
|
||||
}
|
||||
value={settings.mode}
|
||||
w="100%"
|
||||
/>
|
||||
<Select
|
||||
comboboxProps={{ withinPortal: false }}
|
||||
data={strategySelectData}
|
||||
description={strategyLabels.description}
|
||||
label={strategyLabels.title}
|
||||
onChange={(value) => {
|
||||
if (!value) return;
|
||||
setSettings({
|
||||
autoDJ:
|
||||
settings.mode === AUTO_DJ_MODE.ALBUMS
|
||||
? { albumStrategy: value as AutoDJStrategy }
|
||||
: { songStrategy: value as AutoDJStrategy },
|
||||
});
|
||||
}}
|
||||
size="md"
|
||||
value={strategyValue}
|
||||
w="100%"
|
||||
/>
|
||||
<NumberInput
|
||||
aria-label={itemLabels.title}
|
||||
description={itemLabels.description}
|
||||
hideControls={false}
|
||||
label={itemLabels.title}
|
||||
max={50}
|
||||
min={1}
|
||||
onChange={(e) =>
|
||||
setSettings({
|
||||
autoDJ: {
|
||||
itemCount: Number(e),
|
||||
},
|
||||
})
|
||||
}
|
||||
size="md"
|
||||
value={Number(settings.itemCount)}
|
||||
/>
|
||||
<NumberInput
|
||||
aria-label={t('setting.autoDJ_timing')}
|
||||
description={t('setting.autoDJ_timing_description')}
|
||||
hideControls={false}
|
||||
label={t('setting.autoDJ_timing')}
|
||||
max={5}
|
||||
min={1}
|
||||
onChange={(e) =>
|
||||
setSettings({
|
||||
autoDJ: {
|
||||
timing: Number(e),
|
||||
},
|
||||
})
|
||||
}
|
||||
size="md"
|
||||
value={Number(settings.timing)}
|
||||
/>
|
||||
</Stack>
|
||||
</Popover.Dropdown>
|
||||
</Popover>
|
||||
<Button
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
toggleAutoDJ();
|
||||
}}
|
||||
size="compact-xs"
|
||||
style={{ color: settings.enabled ? 'var(--theme-colors-primary)' : undefined }}
|
||||
uppercase
|
||||
variant="transparent"
|
||||
>
|
||||
{t('setting.autoDJ')}
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import { createWithEqualityFn } from 'zustand/traditional';
|
||||
import i18n from '/@/i18n/i18n';
|
||||
import { api } from '/@/renderer/api';
|
||||
import { queryKeys } from '/@/renderer/api/query-keys';
|
||||
import { albumQueries } from '/@/renderer/features/albums/api/album-api';
|
||||
import { useGenreList } from '/@/renderer/features/genres/api/genres-api';
|
||||
import { usePlayer } from '/@/renderer/features/player/context/player-context';
|
||||
import { PlayButtonGroup } from '/@/renderer/features/shared/components/play-button-group';
|
||||
@@ -19,18 +18,9 @@ import { Checkbox } from '/@/shared/components/checkbox/checkbox';
|
||||
import { Divider } from '/@/shared/components/divider/divider';
|
||||
import { Group } from '/@/shared/components/group/group';
|
||||
import { NumberInput } from '/@/shared/components/number-input/number-input';
|
||||
import { SegmentedControl } from '/@/shared/components/segmented-control/segmented-control';
|
||||
import { Select } from '/@/shared/components/select/select';
|
||||
import { Stack } from '/@/shared/components/stack/stack';
|
||||
import {
|
||||
AlbumListQuery,
|
||||
AlbumListSort,
|
||||
LibraryItem,
|
||||
Played,
|
||||
RandomSongListQuery,
|
||||
ServerType,
|
||||
SortOrder,
|
||||
} from '/@/shared/types/domain-types';
|
||||
import { Played, RandomSongListQuery, ServerType } from '/@/shared/types/domain-types';
|
||||
import { Play } from '/@/shared/types/types';
|
||||
|
||||
interface ShuffleAllSlice extends RandomSongListQuery {
|
||||
@@ -39,7 +29,6 @@ interface ShuffleAllSlice extends RandomSongListQuery {
|
||||
};
|
||||
enableMaxYear: boolean;
|
||||
enableMinYear: boolean;
|
||||
playbackKind: 'albums' | 'songs';
|
||||
}
|
||||
|
||||
const useShuffleAllStore = createWithEqualityFn<ShuffleAllSlice>()(
|
||||
@@ -53,28 +42,16 @@ const useShuffleAllStore = createWithEqualityFn<ShuffleAllSlice>()(
|
||||
enableMaxYear: false,
|
||||
enableMinYear: false,
|
||||
genre: '',
|
||||
limit: 100,
|
||||
maxYear: 2020,
|
||||
minYear: 2000,
|
||||
musicFolder: '',
|
||||
playbackKind: 'songs',
|
||||
played: Played.All,
|
||||
songCount: 100,
|
||||
})),
|
||||
{
|
||||
merge: (persistedState, currentState) => merge(currentState, persistedState),
|
||||
migrate: (persisted, version: number) => {
|
||||
if (!persisted) {
|
||||
return persisted;
|
||||
}
|
||||
|
||||
if (version >= 2) {
|
||||
return persisted;
|
||||
}
|
||||
|
||||
return persisted;
|
||||
},
|
||||
name: 'store_shuffle_all',
|
||||
version: 2,
|
||||
version: 1,
|
||||
},
|
||||
),
|
||||
);
|
||||
@@ -89,24 +66,13 @@ export const useShuffleAllStoreActions = () => useShuffleAllStore((state) => sta
|
||||
|
||||
export const ShuffleAllContextModal = () => {
|
||||
const server = useCurrentServer();
|
||||
const { addToQueueByData, addToQueueByFetch } = usePlayer();
|
||||
const { addToQueueByData } = usePlayer();
|
||||
const { t } = useTranslation();
|
||||
const {
|
||||
enableMaxYear,
|
||||
enableMinYear,
|
||||
genre,
|
||||
limit,
|
||||
maxYear,
|
||||
minYear,
|
||||
musicFolderId,
|
||||
playbackKind,
|
||||
played,
|
||||
} = useShuffleAllStore();
|
||||
const { enableMaxYear, enableMinYear, genre, limit, maxYear, minYear, musicFolderId, played } =
|
||||
useShuffleAllStore();
|
||||
const { setStore } = useShuffleAllStoreActions();
|
||||
|
||||
const clampedLimit = Math.min(500, Math.max(1, limit || 100));
|
||||
|
||||
const { isFetching: isFetchingSongs, refetch: refetchSongs } = useQuery({
|
||||
const { isFetching, refetch } = useQuery({
|
||||
...randomFetchQuery({
|
||||
query: {
|
||||
genre: genre || undefined,
|
||||
@@ -123,75 +89,22 @@ export const ShuffleAllContextModal = () => {
|
||||
staleTime: 0,
|
||||
});
|
||||
|
||||
const { isFetching: isFetchingAlbums, refetch: refetchAlbums } = useQuery({
|
||||
...shuffleAlbumListQuery({
|
||||
query: {
|
||||
genreIds: genre ? [genre] : undefined,
|
||||
limit: clampedLimit,
|
||||
minYear: enableMinYear ? minYear || undefined : undefined,
|
||||
musicFolderId: musicFolderId || undefined,
|
||||
sortBy: AlbumListSort.RANDOM,
|
||||
sortOrder: SortOrder.ASC,
|
||||
startIndex: 0,
|
||||
},
|
||||
serverId: server.id,
|
||||
}),
|
||||
enabled: false,
|
||||
gcTime: 0,
|
||||
staleTime: 0,
|
||||
});
|
||||
|
||||
const fetchTypeRef = useRef<Play>(null);
|
||||
|
||||
const handlePlay = async (playType: Play) => {
|
||||
fetchTypeRef.current = playType;
|
||||
|
||||
if (playbackKind === 'albums') {
|
||||
const { data } = await refetchAlbums();
|
||||
const { data } = await refetch();
|
||||
|
||||
addToQueueByFetch(
|
||||
server.id,
|
||||
data?.items.map((a) => a.id) ?? [],
|
||||
LibraryItem.ALBUM,
|
||||
playType,
|
||||
);
|
||||
} else {
|
||||
const { data } = await refetchSongs();
|
||||
|
||||
addToQueueByData(data?.items || [], playType);
|
||||
}
|
||||
addToQueueByData(data?.items || [], playType);
|
||||
|
||||
closeAllModals();
|
||||
};
|
||||
|
||||
return (
|
||||
<Stack gap="md">
|
||||
<SegmentedControl
|
||||
data={[
|
||||
{
|
||||
label: t('form.shuffleAll.input_kind_songs'),
|
||||
value: 'songs',
|
||||
},
|
||||
{
|
||||
label: t('form.shuffleAll.input_kind_albums'),
|
||||
value: 'albums',
|
||||
},
|
||||
]}
|
||||
onChange={(value) =>
|
||||
setStore({
|
||||
playbackKind: value as 'albums' | 'songs',
|
||||
})
|
||||
}
|
||||
size="sm"
|
||||
value={playbackKind}
|
||||
w="100%"
|
||||
/>
|
||||
<NumberInput
|
||||
label={
|
||||
playbackKind === 'albums'
|
||||
? t('form.shuffleAll.input_limit_albums')
|
||||
: t('form.shuffleAll.input_limit_songs')
|
||||
}
|
||||
label={t('form.shuffleAll.input_limit')}
|
||||
max={500}
|
||||
min={1}
|
||||
onChange={(e) => setStore({ limit: e ? Number(e) : 500 })}
|
||||
@@ -214,7 +127,6 @@ export const ShuffleAllContextModal = () => {
|
||||
value={minYear}
|
||||
/>
|
||||
<NumberInput
|
||||
disabled={playbackKind === 'albums'}
|
||||
label={t('form.shuffleAll.input_maxYear')}
|
||||
max={2050}
|
||||
min={1850}
|
||||
@@ -222,7 +134,6 @@ export const ShuffleAllContextModal = () => {
|
||||
rightSection={
|
||||
<Checkbox
|
||||
checked={enableMaxYear}
|
||||
disabled={playbackKind === 'albums'}
|
||||
onChange={(e) => setStore({ enableMaxYear: e.currentTarget.checked })}
|
||||
style={{ marginRight: '0.5rem' }}
|
||||
/>
|
||||
@@ -233,7 +144,7 @@ export const ShuffleAllContextModal = () => {
|
||||
<Suspense fallback={<Select data={[]} />}>
|
||||
<GenreSelect />
|
||||
</Suspense>
|
||||
{server?.type === ServerType.JELLYFIN && playbackKind === 'songs' && (
|
||||
{server?.type === ServerType.JELLYFIN && (
|
||||
<Select
|
||||
clearable
|
||||
data={PLAYED_DATA}
|
||||
@@ -245,7 +156,10 @@ export const ShuffleAllContextModal = () => {
|
||||
/>
|
||||
)}
|
||||
<Divider />
|
||||
<PlayButtonGroup loading={isFetchingSongs || isFetchingAlbums} onPlay={handlePlay} />
|
||||
<PlayButtonGroup
|
||||
loading={(isFetching && fetchTypeRef.current) || false}
|
||||
onPlay={handlePlay}
|
||||
/>
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
@@ -272,13 +186,6 @@ const randomFetchQuery = (args: {
|
||||
});
|
||||
};
|
||||
|
||||
const shuffleAlbumListQuery = (args: { query: AlbumListQuery; serverId: string }) => {
|
||||
return albumQueries.list({
|
||||
query: args.query,
|
||||
serverId: args.serverId,
|
||||
});
|
||||
};
|
||||
|
||||
export const openShuffleAllModal = async () => {
|
||||
openContextModal({
|
||||
innerProps: {},
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import React, { useEffect } from 'react';
|
||||
|
||||
import { queryKeys } from '/@/renderer/api/query-keys';
|
||||
import { eventEmitter } from '/@/renderer/events/event-emitter';
|
||||
import { runAutoDjAlbumIds } from '/@/renderer/features/player/auto-dj/auto-dj-albums';
|
||||
import { runAutoDjSongs } from '/@/renderer/features/player/auto-dj/auto-dj-songs';
|
||||
import { useIsPlayerFetching, usePlayer } from '/@/renderer/features/player/context/player-context';
|
||||
import { songsQueries } from '/@/renderer/features/songs/api/songs-api';
|
||||
import {
|
||||
AUTO_DJ_STRATEGY,
|
||||
isShuffleEnabled,
|
||||
mapShuffledToQueueIndex,
|
||||
useAutoDJSettings,
|
||||
@@ -18,8 +17,9 @@ import {
|
||||
} from '/@/renderer/store';
|
||||
import { LogCategory, logFn } from '/@/renderer/utils/logger';
|
||||
import { logMsg } from '/@/renderer/utils/logger-message';
|
||||
import { shuffleInPlace } from '/@/renderer/utils/shuffle';
|
||||
import { hasFeature } from '/@/shared/api/utils';
|
||||
import { LibraryItem } from '/@/shared/types/domain-types';
|
||||
import { Played, Song, SongListSort, SortOrder } from '/@/shared/types/domain-types';
|
||||
import { ServerFeature } from '/@/shared/types/features-types';
|
||||
import { Play } from '/@/shared/types/types';
|
||||
|
||||
@@ -34,9 +34,6 @@ export const useAutoDJ = () => {
|
||||
const hasSimilarSongsMusicFolder = hasFeature(server, ServerFeature.SIMILAR_SONGS_MUSIC_FOLDER);
|
||||
|
||||
useEffect(() => {
|
||||
const albumStrategy = settings.albumStrategy ?? AUTO_DJ_STRATEGY.SIMILAR;
|
||||
const songStrategy = settings.songStrategy ?? AUTO_DJ_STRATEGY.SIMILAR;
|
||||
|
||||
const unsubscribe = usePlayerStoreBase.subscribe(
|
||||
(state) => {
|
||||
const queue = state.getQueue();
|
||||
@@ -57,6 +54,7 @@ export const useAutoDJ = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
// If no current song, don't autoplay
|
||||
if (!properties.song?.id) {
|
||||
return;
|
||||
}
|
||||
@@ -72,76 +70,142 @@ export const useAutoDJ = () => {
|
||||
|
||||
try {
|
||||
const queue = usePlayerStore.getState().getQueue();
|
||||
const queueSongIdSet = new Set(queue.items.map((item) => item.id));
|
||||
let uniqueSimilarSongs: Song[] = [];
|
||||
|
||||
const hasMusicFolder = server?.musicFolderId && server.musicFolderId.length > 0;
|
||||
const musicFolderId =
|
||||
hasMusicFolder && server?.musicFolderId ? server.musicFolderId : undefined;
|
||||
const trySimilarSongs =
|
||||
!hasMusicFolder || (hasMusicFolder && hasSimilarSongsMusicFolder);
|
||||
|
||||
const runnerDepsBase = {
|
||||
itemCount: settings.itemCount,
|
||||
musicFolderId,
|
||||
queryClient,
|
||||
server,
|
||||
serverId,
|
||||
trySimilarSongs,
|
||||
};
|
||||
|
||||
if (settings.mode === 'albums') {
|
||||
if (!serverId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const queueAlbumIdSet = new Set(
|
||||
queue.items
|
||||
.map((item) => item.albumId)
|
||||
.filter((id): id is string => Boolean(id)),
|
||||
);
|
||||
|
||||
const albumsToAdd = await runAutoDjAlbumIds({
|
||||
...runnerDepsBase,
|
||||
albumStrategy,
|
||||
currentSong: properties.song,
|
||||
queueAlbumIdSet,
|
||||
// Skip similar songs fetch if a music folder is selected and does not support musicFolderId on similar songs
|
||||
if (trySimilarSongs) {
|
||||
// First, try to fetch similar songs based on the current song
|
||||
const similarSongs = await queryClient.fetchQuery({
|
||||
...songsQueries.similar({
|
||||
query: {
|
||||
count: settings.itemCount,
|
||||
songId: properties.song?.id,
|
||||
},
|
||||
serverId,
|
||||
}),
|
||||
queryKey: queryKeys.player.fetch({ similarSongs: properties.song?.id }),
|
||||
});
|
||||
|
||||
if (albumsToAdd.length > 0) {
|
||||
await player.addToQueueByFetch(
|
||||
serverId,
|
||||
albumsToAdd,
|
||||
LibraryItem.ALBUM,
|
||||
Play.LAST,
|
||||
uniqueSimilarSongs = similarSongs.filter(
|
||||
(song) => !queueSongIdSet.has(song.id),
|
||||
);
|
||||
}
|
||||
|
||||
// If not enough songs, try to fetch more similar songs based on the genre of the current song
|
||||
if (uniqueSimilarSongs.length < settings.itemCount) {
|
||||
const genre = properties.song?.genres?.[0];
|
||||
|
||||
if (genre) {
|
||||
const genreLimit = 50;
|
||||
const genreSimilarSongs = await queryClient.fetchQuery({
|
||||
...songsQueries.random({
|
||||
query: {
|
||||
genre: genre.id,
|
||||
limit: genreLimit,
|
||||
played: Played.All,
|
||||
},
|
||||
serverId,
|
||||
}),
|
||||
queryKey: queryKeys.player.fetch({
|
||||
genre,
|
||||
similarSongs: properties.song?.id,
|
||||
}),
|
||||
});
|
||||
|
||||
const genreSongs = genreSimilarSongs.items.filter(
|
||||
(song) => !queueSongIdSet.has(song.id),
|
||||
);
|
||||
|
||||
eventEmitter.emit('AUTODJ_QUEUE_ADDED', {
|
||||
songCount: albumsToAdd.length,
|
||||
});
|
||||
// If trySimilarSongs is false, add variation by mixing in random songs
|
||||
if (!trySimilarSongs) {
|
||||
// Calculate how many random songs we need: 20% or at least 1
|
||||
const randomSongCount = Math.max(1, Math.ceil(genreLimit * 0.2));
|
||||
|
||||
const randomSongs = await queryClient.fetchQuery({
|
||||
...songsQueries.random({
|
||||
query: { limit: randomSongCount, played: Played.All },
|
||||
serverId,
|
||||
}),
|
||||
});
|
||||
|
||||
const uniqueRandomSongs = randomSongs.items.filter(
|
||||
(song) => !queueSongIdSet.has(song.id),
|
||||
);
|
||||
|
||||
// Add minimum required random songs for variation
|
||||
const randomSongsToAdd = uniqueRandomSongs.slice(
|
||||
0,
|
||||
randomSongCount,
|
||||
);
|
||||
uniqueSimilarSongs.push(...randomSongsToAdd, ...genreSongs);
|
||||
} else {
|
||||
uniqueSimilarSongs.push(...genreSongs);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!serverId) {
|
||||
return;
|
||||
// If not enough songs, try to fetch more similar songs based on the album artist of the current song
|
||||
if (uniqueSimilarSongs.length < settings.itemCount) {
|
||||
const albumArtist = properties.song?.albumArtists?.[0];
|
||||
|
||||
if (albumArtist) {
|
||||
const albumArtistSimilarSongs = await queryClient.fetchQuery({
|
||||
...songsQueries.list({
|
||||
query: {
|
||||
albumArtistIds: [albumArtist.id],
|
||||
limit: 50,
|
||||
sortBy: SongListSort.RANDOM,
|
||||
sortOrder: SortOrder.ASC,
|
||||
startIndex: 0,
|
||||
},
|
||||
serverId,
|
||||
}),
|
||||
queryKey: queryKeys.player.fetch({
|
||||
albumArtist,
|
||||
similarSongs: properties.song?.id,
|
||||
}),
|
||||
});
|
||||
|
||||
uniqueSimilarSongs.push(
|
||||
...albumArtistSimilarSongs.items.filter(
|
||||
(song) => !queueSongIdSet.has(song.id),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const queueSongIdSet = new Set(queue.items.map((item) => item.id));
|
||||
|
||||
const songsToAdd = await runAutoDjSongs({
|
||||
...runnerDepsBase,
|
||||
currentSong: properties.song,
|
||||
queueSongIdSet,
|
||||
songStrategy,
|
||||
});
|
||||
|
||||
if (songsToAdd.length > 0) {
|
||||
player.addToQueueByData(songsToAdd, Play.LAST);
|
||||
|
||||
eventEmitter.emit('AUTODJ_QUEUE_ADDED', {
|
||||
songCount: songsToAdd.length,
|
||||
// If not enough songs, just fetch fully random songs
|
||||
if (uniqueSimilarSongs.length < settings.itemCount) {
|
||||
const randomSongs = await queryClient.fetchQuery({
|
||||
...songsQueries.random({
|
||||
query: { limit: 50, played: Played.All },
|
||||
serverId,
|
||||
}),
|
||||
});
|
||||
|
||||
uniqueSimilarSongs.push(
|
||||
...randomSongs.items.filter((song) => !queueSongIdSet.has(song.id)),
|
||||
);
|
||||
}
|
||||
|
||||
// Shuffle the songs and then add to the queue
|
||||
const shuffledSongs = shuffleInPlace(uniqueSimilarSongs);
|
||||
|
||||
// Splice the first itemCount songs and add to the queue
|
||||
const songsToAdd = shuffledSongs.slice(0, settings.itemCount);
|
||||
|
||||
// Add to the end of the queue
|
||||
player.addToQueueByData(songsToAdd, Play.LAST);
|
||||
|
||||
// Emit event to trigger queue follow
|
||||
eventEmitter.emit('AUTODJ_QUEUE_ADDED', {
|
||||
songCount: songsToAdd.length,
|
||||
});
|
||||
} catch (error) {
|
||||
logFn.error(logMsg[LogCategory.PLAYER].autoPlayFailed, {
|
||||
category: LogCategory.PLAYER,
|
||||
@@ -165,10 +229,7 @@ export const useAutoDJ = () => {
|
||||
server,
|
||||
serverId,
|
||||
settings.enabled,
|
||||
settings.albumStrategy,
|
||||
settings.itemCount,
|
||||
settings.mode,
|
||||
settings.songStrategy,
|
||||
settings.timing,
|
||||
]);
|
||||
};
|
||||
|
||||
@@ -117,11 +117,11 @@ export const useMPRIS = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
mpris?.requestPosition((data: { position: number }) => {
|
||||
mpris?.requestPosition((_e: unknown, data: { position: number }) => {
|
||||
player.mediaSeekToTimestamp(data.position);
|
||||
});
|
||||
|
||||
mpris?.requestSeek((data: { offset: number }) => {
|
||||
mpris?.requestSeek((_e: unknown, data: { offset: number }) => {
|
||||
player.mediaSkipForward(data.offset);
|
||||
});
|
||||
|
||||
@@ -133,7 +133,7 @@ export const useMPRIS = () => {
|
||||
player.toggleShuffle();
|
||||
});
|
||||
|
||||
mpris?.requestVolume((data: { volume: number }) => {
|
||||
mpris?.requestVolume((_e: unknown, data: { volume: number }) => {
|
||||
player.setVolume(data.volume);
|
||||
});
|
||||
|
||||
|
||||
@@ -4,27 +4,27 @@ import React, { useCallback, useEffect } from 'react';
|
||||
import { usePlayerStatus, useSettingsStore, useWindowSettings } from '/@/renderer/store';
|
||||
import { PlayerStatus } from '/@/shared/types/types';
|
||||
|
||||
const utils = isElectron() ? window.api.utils : null;
|
||||
const ipc = isElectron() ? window.api.ipc : null;
|
||||
|
||||
export const usePowerSaveBlocker = () => {
|
||||
const status = usePlayerStatus();
|
||||
const { preventSleepOnPlayback, preventSuspendOnPlayback } = useWindowSettings();
|
||||
|
||||
const startPowerSaveBlocker = useCallback(async () => {
|
||||
if (!utils) return;
|
||||
if (!ipc) return;
|
||||
|
||||
try {
|
||||
await utils.startPowerSaveBlocker(preventSleepOnPlayback);
|
||||
await ipc.invoke('power-save-blocker-start', { full: preventSleepOnPlayback });
|
||||
} catch (error) {
|
||||
console.error('Failed to start power save blocker:', error);
|
||||
}
|
||||
}, [preventSleepOnPlayback]);
|
||||
|
||||
const stopPowerSaveBlocker = useCallback(async () => {
|
||||
if (!utils) return;
|
||||
if (!ipc) return;
|
||||
|
||||
try {
|
||||
await utils.stopPowerSaveBlocker();
|
||||
await ipc.invoke('power-save-blocker-stop');
|
||||
} catch (error) {
|
||||
console.error('Failed to stop power save blocker:', error);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ export const useRemote = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
remote.requestPosition((data: { position: number }) => {
|
||||
remote.requestPosition((_e: unknown, data: { position: number }) => {
|
||||
logFn.debug(logMsg[LogCategory.REMOTE].requestPositionReceived, {
|
||||
category: LogCategory.REMOTE,
|
||||
meta: { position: data.position },
|
||||
@@ -73,7 +73,7 @@ export const useRemote = () => {
|
||||
player.mediaSeekToTimestamp(newTime);
|
||||
});
|
||||
|
||||
remote.requestSeek((data: { offset: number }) => {
|
||||
remote.requestSeek((_e: unknown, data: { offset: number }) => {
|
||||
logFn.debug(logMsg[LogCategory.REMOTE].requestSeekReceived, {
|
||||
category: LogCategory.REMOTE,
|
||||
meta: { offset: data.offset },
|
||||
@@ -81,15 +81,17 @@ export const useRemote = () => {
|
||||
mediaSkipForward(data.offset);
|
||||
});
|
||||
|
||||
remote.requestRating((data: { id: string; rating: number; serverId: string }) => {
|
||||
logFn.debug(logMsg[LogCategory.REMOTE].requestRatingReceived, {
|
||||
category: LogCategory.REMOTE,
|
||||
meta: { id: data.id, rating: data.rating, serverId: data.serverId },
|
||||
});
|
||||
setRating(data.serverId, [data.id], LibraryItem.SONG, data.rating);
|
||||
});
|
||||
remote.requestRating(
|
||||
(_e: unknown, data: { id: string; rating: number; serverId: string }) => {
|
||||
logFn.debug(logMsg[LogCategory.REMOTE].requestRatingReceived, {
|
||||
category: LogCategory.REMOTE,
|
||||
meta: { id: data.id, rating: data.rating, serverId: data.serverId },
|
||||
});
|
||||
setRating(data.serverId, [data.id], LibraryItem.SONG, data.rating);
|
||||
},
|
||||
);
|
||||
|
||||
remote.requestVolume((data: { volume: number }) => {
|
||||
remote.requestVolume((_e: unknown, data: { volume: number }) => {
|
||||
logFn.debug(logMsg[LogCategory.REMOTE].requestVolumeReceived, {
|
||||
category: LogCategory.REMOTE,
|
||||
meta: { volume: data.volume },
|
||||
@@ -97,20 +99,24 @@ export const useRemote = () => {
|
||||
setVolume(data.volume);
|
||||
});
|
||||
|
||||
remote.requestFavorite((data: { favorite: boolean; id: string; serverId: string }) => {
|
||||
logFn.debug(logMsg[LogCategory.REMOTE].requestFavoriteReceived, {
|
||||
category: LogCategory.REMOTE,
|
||||
meta: { favorite: data.favorite, id: data.id, serverId: data.serverId },
|
||||
});
|
||||
const mutator = data.favorite ? addToFavoritesMutation : removeFromFavoritesMutation;
|
||||
mutator.mutate({
|
||||
apiClientProps: { serverId: data.serverId },
|
||||
query: {
|
||||
id: [data.id],
|
||||
type: LibraryItem.SONG,
|
||||
},
|
||||
});
|
||||
});
|
||||
remote.requestFavorite(
|
||||
(_e: unknown, data: { favorite: boolean; id: string; serverId: string }) => {
|
||||
logFn.debug(logMsg[LogCategory.REMOTE].requestFavoriteReceived, {
|
||||
category: LogCategory.REMOTE,
|
||||
meta: { favorite: data.favorite, id: data.id, serverId: data.serverId },
|
||||
});
|
||||
const mutator = data.favorite
|
||||
? addToFavoritesMutation
|
||||
: removeFromFavoritesMutation;
|
||||
mutator.mutate({
|
||||
apiClientProps: { serverId: data.serverId },
|
||||
query: {
|
||||
id: [data.id],
|
||||
type: LibraryItem.SONG,
|
||||
},
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
return () => {
|
||||
ipc?.removeAllListeners('request-position');
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { IpcRendererEvent } from 'electron';
|
||||
|
||||
import { t } from 'i18next';
|
||||
import isElectron from 'is-electron';
|
||||
import { memo, useCallback, useEffect, useState } from 'react';
|
||||
@@ -122,7 +124,7 @@ export const ApplicationSettings = memo(() => {
|
||||
// }, [fontSettings.custom]);
|
||||
|
||||
const onFontError = useCallback(
|
||||
(file: string) => {
|
||||
(_: IpcRendererEvent, file: string) => {
|
||||
toast.error({
|
||||
message: `${file} is not a valid font file`,
|
||||
});
|
||||
|
||||
@@ -1,112 +1,23 @@
|
||||
import { memo, useMemo } from 'react';
|
||||
import { memo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import {
|
||||
SettingOption,
|
||||
SettingsSection,
|
||||
} from '/@/renderer/features/settings/components/settings-section';
|
||||
import {
|
||||
AUTO_DJ_MODE,
|
||||
AUTO_DJ_STRATEGY,
|
||||
type AutoDJStrategy,
|
||||
useAutoDJSettings,
|
||||
useSettingsStoreActions,
|
||||
} from '/@/renderer/store/settings.store';
|
||||
import { useAutoDJSettings, useSettingsStoreActions } from '/@/renderer/store/settings.store';
|
||||
import { NumberInput } from '/@/shared/components/number-input/number-input';
|
||||
import { SegmentedControl } from '/@/shared/components/segmented-control/segmented-control';
|
||||
import { Select } from '/@/shared/components/select/select';
|
||||
|
||||
export const AutoDJSettings = memo(() => {
|
||||
const { t } = useTranslation();
|
||||
const settings = useAutoDJSettings();
|
||||
const { setSettings } = useSettingsStoreActions();
|
||||
|
||||
const itemLabels = useMemo(() => {
|
||||
return {
|
||||
description: t('setting.autoDJ_itemCount_description'),
|
||||
title: t('setting.autoDJ_itemCount'),
|
||||
};
|
||||
}, [t]);
|
||||
|
||||
const strategySelectData = useMemo(
|
||||
() => [
|
||||
{
|
||||
label: t('setting.autoDJ_strategy_option_similar'),
|
||||
value: AUTO_DJ_STRATEGY.SIMILAR,
|
||||
},
|
||||
{
|
||||
label: t('setting.autoDJ_strategy_option_library_random'),
|
||||
value: AUTO_DJ_STRATEGY.LIBRARY_RANDOM,
|
||||
},
|
||||
],
|
||||
[t],
|
||||
);
|
||||
|
||||
const autoDJOptions: SettingOption[] = [
|
||||
{
|
||||
control: (
|
||||
<SegmentedControl
|
||||
data={[
|
||||
{ label: t('setting.autoDJ_mode_songs'), value: AUTO_DJ_MODE.SONGS },
|
||||
{ label: t('setting.autoDJ_mode_albums'), value: AUTO_DJ_MODE.ALBUMS },
|
||||
]}
|
||||
onChange={(value) => {
|
||||
setSettings({
|
||||
autoDJ: {
|
||||
mode: value as 'albums' | 'songs',
|
||||
},
|
||||
});
|
||||
}}
|
||||
size="sm"
|
||||
value={settings.mode}
|
||||
w="100%"
|
||||
/>
|
||||
),
|
||||
description: t('setting.autoDJ_mode_description'),
|
||||
title: t('setting.autoDJ_mode'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Select
|
||||
data={strategySelectData}
|
||||
onChange={(value) =>
|
||||
value &&
|
||||
setSettings({
|
||||
autoDJ: {
|
||||
songStrategy: value as AutoDJStrategy,
|
||||
},
|
||||
})
|
||||
}
|
||||
value={settings.songStrategy ?? AUTO_DJ_STRATEGY.SIMILAR}
|
||||
w="100%"
|
||||
/>
|
||||
),
|
||||
description: '',
|
||||
title: t('setting.autoDJ_songStrategy'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Select
|
||||
data={strategySelectData}
|
||||
onChange={(value) =>
|
||||
value &&
|
||||
setSettings({
|
||||
autoDJ: {
|
||||
albumStrategy: value as AutoDJStrategy,
|
||||
},
|
||||
})
|
||||
}
|
||||
value={settings.albumStrategy ?? AUTO_DJ_STRATEGY.SIMILAR}
|
||||
w="100%"
|
||||
/>
|
||||
),
|
||||
description: '',
|
||||
title: t('setting.autoDJ_albumStrategy'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<NumberInput
|
||||
aria-label={itemLabels.title}
|
||||
aria-label="Auto DJ item count"
|
||||
hideControls={false}
|
||||
max={50}
|
||||
min={1}
|
||||
@@ -120,8 +31,10 @@ export const AutoDJSettings = memo(() => {
|
||||
value={Number(settings.itemCount)}
|
||||
/>
|
||||
),
|
||||
description: itemLabels.description,
|
||||
title: itemLabels.title,
|
||||
description: t('setting.autoDJ_itemCount', {
|
||||
context: 'description',
|
||||
}),
|
||||
title: t('setting.autoDJ_itemCount'),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
|
||||
Vendored
-3
@@ -1,11 +1,8 @@
|
||||
declare global {
|
||||
interface Window {
|
||||
ANALYTICS_DISABLED?: boolean | string;
|
||||
FS_AUTO_DJ_ALBUM_STRATEGY?: string;
|
||||
FS_AUTO_DJ_ENABLED?: string;
|
||||
FS_AUTO_DJ_ITEM_COUNT?: string;
|
||||
FS_AUTO_DJ_MODE?: string;
|
||||
FS_AUTO_DJ_SONG_STRATEGY?: string;
|
||||
FS_AUTO_DJ_TIMING?: string;
|
||||
FS_CSS_CONTENT?: string;
|
||||
FS_CSS_ENABLED?: string;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="Content-Security-Policy" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
||||
<title>Feishin</title>
|
||||
<% if (web) { %>
|
||||
|
||||
@@ -111,8 +111,6 @@ const SIDE_QUEUE_TYPES = new Set(['sideDrawerQueue', 'sideQueue']);
|
||||
const SIDE_QUEUE_LAYOUTS = new Set(['horizontal', 'vertical']);
|
||||
const SIDEBAR_PLAYLIST_FOLDER_VIEWS = new Set(['navigation', 'single', 'tree']);
|
||||
const SIDEBAR_PLAYLIST_MODES = new Set(['compact', 'expanded']);
|
||||
const AUTO_DJ_MODES = new Set(['albums', 'songs']);
|
||||
const AUTO_DJ_STRATEGIES = new Set(['library_random', 'similar']);
|
||||
|
||||
export type EnvSettingsOverrides = DeepPartial<
|
||||
Pick<SettingsState, 'autoDJ' | 'css' | 'discord' | 'font' | 'general' | 'lyrics' | 'playback'>
|
||||
@@ -424,21 +422,8 @@ const ENV_SETTING_SPECS: EnvSettingSpec[] = [
|
||||
path: ['lyrics', 'alignment'],
|
||||
type: 'enum',
|
||||
},
|
||||
{
|
||||
enumSet: AUTO_DJ_STRATEGIES,
|
||||
key: 'FS_AUTO_DJ_ALBUM_STRATEGY',
|
||||
path: ['autoDJ', 'albumStrategy'],
|
||||
type: 'enum',
|
||||
},
|
||||
{ key: 'FS_AUTO_DJ_ENABLED', path: ['autoDJ', 'enabled'], type: 'bool' },
|
||||
{ key: 'FS_AUTO_DJ_ITEM_COUNT', path: ['autoDJ', 'itemCount'], type: 'num' },
|
||||
{ enumSet: AUTO_DJ_MODES, key: 'FS_AUTO_DJ_MODE', path: ['autoDJ', 'mode'], type: 'enum' },
|
||||
{
|
||||
enumSet: AUTO_DJ_STRATEGIES,
|
||||
key: 'FS_AUTO_DJ_SONG_STRATEGY',
|
||||
path: ['autoDJ', 'songStrategy'],
|
||||
type: 'enum',
|
||||
},
|
||||
{ key: 'FS_AUTO_DJ_TIMING', path: ['autoDJ', 'timing'], type: 'num' },
|
||||
{
|
||||
key: 'FS_CSS_CONTENT',
|
||||
|
||||
@@ -675,28 +675,9 @@ const QueryBuilderSettingsSchema = z.object({
|
||||
tag: z.array(QueryBuilderCustomFieldSchema),
|
||||
});
|
||||
|
||||
export const AUTO_DJ_MODE = {
|
||||
ALBUMS: 'albums',
|
||||
SONGS: 'songs',
|
||||
} as const;
|
||||
|
||||
export type AutoDJMode = (typeof AUTO_DJ_MODE)[keyof typeof AUTO_DJ_MODE];
|
||||
|
||||
export const AUTO_DJ_STRATEGY = {
|
||||
LIBRARY_RANDOM: 'library_random',
|
||||
SIMILAR: 'similar',
|
||||
} as const;
|
||||
|
||||
export type AutoDJStrategy = (typeof AUTO_DJ_STRATEGY)[keyof typeof AUTO_DJ_STRATEGY];
|
||||
|
||||
const autoDjStrategyEnum = z.enum(['similar', 'library_random']);
|
||||
|
||||
const AutoDJSettingsSchema = z.object({
|
||||
albumStrategy: autoDjStrategyEnum,
|
||||
enabled: z.boolean(),
|
||||
itemCount: z.number(),
|
||||
mode: z.enum(['songs', 'albums']),
|
||||
songStrategy: autoDjStrategyEnum,
|
||||
timing: z.number(),
|
||||
});
|
||||
|
||||
@@ -1110,11 +1091,8 @@ const platformDefaultWindowBarStyle: Platform = getPlatformDefaultWindowBarStyle
|
||||
|
||||
const initialState: SettingsState = {
|
||||
autoDJ: {
|
||||
albumStrategy: AUTO_DJ_STRATEGY.SIMILAR,
|
||||
enabled: false,
|
||||
itemCount: 5,
|
||||
mode: 'songs',
|
||||
songStrategy: AUTO_DJ_STRATEGY.SIMILAR,
|
||||
timing: 1,
|
||||
},
|
||||
css: {
|
||||
@@ -2449,41 +2427,10 @@ export const useSettingsStore = createWithEqualityFn<SettingsSlice>()(
|
||||
}
|
||||
}
|
||||
|
||||
if (version < 28) {
|
||||
if (!state.autoDJ) {
|
||||
state.autoDJ = { ...initialState.autoDJ };
|
||||
}
|
||||
|
||||
if (state.autoDJ.mode !== 'albums' && state.autoDJ.mode !== 'songs') {
|
||||
state.autoDJ.mode = initialState.autoDJ.mode;
|
||||
}
|
||||
|
||||
const normalizeAutoDjStrategy = (stored: unknown) => {
|
||||
if (stored === 'library_random') {
|
||||
return AUTO_DJ_STRATEGY.LIBRARY_RANDOM;
|
||||
}
|
||||
|
||||
if (
|
||||
stored === 'similar' ||
|
||||
stored === 'default' ||
|
||||
stored === 'similar_forward'
|
||||
) {
|
||||
return AUTO_DJ_STRATEGY.SIMILAR;
|
||||
}
|
||||
|
||||
return initialState.autoDJ.songStrategy;
|
||||
};
|
||||
|
||||
state.autoDJ.songStrategy = normalizeAutoDjStrategy(state.autoDJ.songStrategy);
|
||||
state.autoDJ.albumStrategy = normalizeAutoDjStrategy(
|
||||
state.autoDJ.albumStrategy,
|
||||
);
|
||||
}
|
||||
|
||||
return persistedState;
|
||||
},
|
||||
name: 'store_settings',
|
||||
version: 28,
|
||||
version: 27,
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
@@ -21,14 +21,14 @@ export const UpdateAvailableDialog = () => {
|
||||
useEffect(() => {
|
||||
if (!isElectron()) return;
|
||||
|
||||
const handleUpdateAvailable = (newVersion: string) => {
|
||||
const handleUpdateAvailable = (_event: any, newVersion: string) => {
|
||||
if (versionDismissed !== newVersion) {
|
||||
setVersion(newVersion);
|
||||
setOpened(true);
|
||||
}
|
||||
};
|
||||
|
||||
window.api.utils.rendererUpdateAvailable(handleUpdateAvailable);
|
||||
window.api.ipc.on('update-available', handleUpdateAvailable);
|
||||
|
||||
return () => {
|
||||
window.api.ipc.removeListener?.('update-available', handleUpdateAvailable);
|
||||
|
||||
Reference in New Issue
Block a user