From e4a6d8d12390e3ae0b88cd775138f6d1a59021ea Mon Sep 17 00:00:00 2001 From: Adrian Date: Sun, 19 Apr 2026 09:31:07 +1000 Subject: [PATCH 1/3] Add an album list/view --- src-tauri/build.rs | 2 + src-tauri/capabilities/main.json | 2 + src-tauri/src/libs/database.rs | 48 +++++++++++++++++ src-tauri/src/plugins/db.rs | 15 ++++++ src/assets/icons/album.svg | 1 + src/components/Icon.tsx | 2 + src/components/Navigation.tsx | 3 ++ src/components/TrackList.tsx | 2 + src/components/TrackListGrouped.tsx | 14 ++++- src/generated/route-tree.ts | 51 ++++++++++++++++++ src/lib/__mocks__/bridge-database.ts | 8 +++ src/lib/bridge-database.ts | 12 +++++ src/routes/albums.$albumID.tsx | 54 +++++++++++++++++++ src/routes/albums.tsx | 78 ++++++++++++++++++++++++++++ src/translations/en.po | 49 +++++++++-------- src/translations/es.po | 49 +++++++++-------- src/translations/fr.po | 49 +++++++++-------- src/translations/ja.po | 49 +++++++++-------- src/translations/ru.po | 49 +++++++++-------- src/translations/zh-CN.po | 49 +++++++++-------- src/translations/zh-TW.po | 49 +++++++++-------- src/types/museeks.ts | 1 + 22 files changed, 481 insertions(+), 155 deletions(-) create mode 100644 src/assets/icons/album.svg create mode 100644 src/routes/albums.$albumID.tsx create mode 100644 src/routes/albums.tsx diff --git a/src-tauri/build.rs b/src-tauri/build.rs index a25cbad89..3a7c6c236 100644 --- a/src-tauri/build.rs +++ b/src-tauri/build.rs @@ -30,6 +30,8 @@ fn main() { "update_track", "get_artists", "get_artist_tracks", + "get_all_albums", + "get_album_tracks", "get_compilation_albums", "has_compilations", "get_all_playlists", diff --git a/src-tauri/capabilities/main.json b/src-tauri/capabilities/main.json index 1af6d65de..5d2848d60 100644 --- a/src-tauri/capabilities/main.json +++ b/src-tauri/capabilities/main.json @@ -41,6 +41,8 @@ "database:allow-remove-tracks", "database:allow-get-artists", "database:allow-get-artist-tracks", + "database:allow-get-all-albums", + "database:allow-get-album-tracks", "database:allow-get-compilation-albums", "database:allow-has-compilations", "database:allow-get-all-playlists", diff --git a/src-tauri/src/libs/database.rs b/src-tauri/src/libs/database.rs index 7879b9b33..1c523b51e 100644 --- a/src-tauri/src/libs/database.rs +++ b/src-tauri/src/libs/database.rs @@ -289,6 +289,23 @@ impl DB { Ok(result) } + /** + * Get the list of albums registered in the database. + */ + pub async fn get_all_albums(&mut self) -> AnyResult> { + let result: Vec = sqlx::query_scalar( + "SELECT DISTINCT album + FROM tracks + ORDER BY + CASE WHEN upper(substr(album, 1, 1)) BETWEEN 'A' AND 'Z' THEN 0 ELSE 1 END, + album COLLATE NOCASE;", + ) + .fetch_all(&mut self.connection) + .await?; + + Ok(result) + } + /** * Returns true if any tracks are flagged as compilations. */ @@ -343,6 +360,37 @@ impl DB { Ok(track_groups) } + /** + * Get all tracks for a given album. + */ + pub async fn get_album_tracks(&mut self, album: String) -> AnyResult> { + let tracks = sqlx::query_as::<_, Track>( + "SELECT * FROM tracks WHERE album = ? ORDER BY disk_no, track_no", + ) + .bind(&album) + .fetch_all(&mut self.connection) + .await?; + + if tracks.is_empty() { + return Ok(Vec::new()); + } + + let track_group = TrackGroup { + label: album, + genres: tracks + .iter() + .flat_map(|s| &s.genres) + .cloned() + .unique() + .collect(), + duration: tracks.iter().map(|t| t.duration).sum(), + year: tracks.first().and_then(|t| t.year), + tracks, + }; + + Ok(vec![track_group]) + } + /** * Get all compilation albums, grouped by album name, sorted by year. */ diff --git a/src-tauri/src/plugins/db.rs b/src-tauri/src/plugins/db.rs index 9e874b13c..85656d673 100644 --- a/src-tauri/src/plugins/db.rs +++ b/src-tauri/src/plugins/db.rs @@ -318,6 +318,19 @@ async fn get_artist_tracks( db_state.get_lock().await.get_artist_tracks(artist).await } +#[tauri::command] +async fn get_all_albums(db_state: State<'_, DBState>) -> AnyResult> { + db_state.get_lock().await.get_all_albums().await +} + +#[tauri::command] +async fn get_album_tracks( + db_state: State<'_, DBState>, + album: String, +) -> AnyResult> { + db_state.get_lock().await.get_album_tracks(album).await +} + #[tauri::command] async fn get_compilation_albums(db_state: State<'_, DBState>) -> AnyResult> { db_state.get_lock().await.get_compilation_albums().await @@ -459,6 +472,8 @@ pub fn init() -> TauriPlugin { update_track, get_artists, get_artist_tracks, + get_all_albums, + get_album_tracks, get_compilation_albums, has_compilations, get_all_playlists, diff --git a/src/assets/icons/album.svg b/src/assets/icons/album.svg new file mode 100644 index 000000000..6f1c443a5 --- /dev/null +++ b/src/assets/icons/album.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/Icon.tsx b/src/components/Icon.tsx index 1c94fc4de..f4ba4840b 100644 --- a/src/components/Icon.tsx +++ b/src/components/Icon.tsx @@ -1,6 +1,7 @@ import * as stylex from '@stylexjs/stylex'; import { error } from '@tauri-apps/plugin-log'; +import album from '../assets/icons/album.svg?react'; import chevronDown from '../assets/icons/chevron-down.svg?react'; import chevronUp from '../assets/icons/chevron-up.svg?react'; import globe from '../assets/icons/globe.svg?react'; @@ -27,6 +28,7 @@ const icons: Record< string, React.FunctionComponent> > = { + album, chevronDown, chevronUp, globe, diff --git a/src/components/Navigation.tsx b/src/components/Navigation.tsx index 94d3ebcc6..8d4a312e6 100644 --- a/src/components/Navigation.tsx +++ b/src/components/Navigation.tsx @@ -54,6 +54,9 @@ export default function Navigation() { + + + diff --git a/src/components/TrackList.tsx b/src/components/TrackList.tsx index 3e791953c..1605772d5 100644 --- a/src/components/TrackList.tsx +++ b/src/components/TrackList.tsx @@ -60,6 +60,7 @@ interface TrackListGroupedLayoutProps extends TrackListProps { layout: 'grouped'; data: Array; showArtistInTitle?: boolean; + showArtistLabel?: boolean; } type Props = TrackListDefaultLayoutProps | TrackListGroupedLayoutProps; @@ -459,6 +460,7 @@ export default function TrackList(props: Props) { onTrackSelect={onTrackSelect} onContextMenu={onContextMenu} onPlaybackStart={onPlaybackStart} + showArtistLabel={props.showArtistLabel} /> )} diff --git a/src/components/TrackListGrouped.tsx b/src/components/TrackListGrouped.tsx index 0157c7a68..3d0ee65f0 100644 --- a/src/components/TrackListGrouped.tsx +++ b/src/components/TrackListGrouped.tsx @@ -24,10 +24,11 @@ type Props = { initialOffset: number; rowHeight: number; showArtistInTitle?: boolean; + showArtistLabel?: boolean; } & TrackRowEvents; export default function TrackListGroupedLayout(props: Props) { - const { ref, trackGroups, rowHeight, showArtistInTitle, ...rest } = props; + const { ref, trackGroups, rowHeight, showArtistInTitle, showArtistLabel, ...rest } = props; const { t } = useLingui(); const tracks = useAllTracks(trackGroups); @@ -66,6 +67,7 @@ export default function TrackListGroupedLayout(props: Props) { tracksGroup={tracksGroup} rowHeight={rowHeight} showArtistInTitle={showArtistInTitle} + showArtistLabel={showArtistLabel} {...rest} /> ); @@ -79,6 +81,7 @@ type TrackListGroupProps = { selectedTracks: Set; rowHeight: number; showArtistInTitle?: boolean; + showArtistLabel?: boolean; } & TrackRowEvents; function TrackListGroup(props: TrackListGroupProps) { @@ -86,6 +89,7 @@ function TrackListGroup(props: TrackListGroupProps) { selectedTracks, rowHeight, showArtistInTitle, + showArtistLabel, onTrackSelect, onContextMenu, onPlaybackStart, @@ -97,6 +101,8 @@ function TrackListGroup(props: TrackListGroupProps) { return null; } + const artistName = showArtistLabel ? (tracks[0]?.album_artist || tracks[0]?.artists[0] || null) : null; + return (

{label}

+ {artistName &&

{artistName}

}
{year} @@ -169,6 +176,11 @@ const styles = stylex.create({ fontWeight: 'bold', margin: 0, }, + artist: { + color: 'var(--text-muted)', + margin: 0, + fontSize: '0.95rem', + }, metadata: { color: 'var(--text-muted)', display: 'flex', diff --git a/src/generated/route-tree.ts b/src/generated/route-tree.ts index 4c9ad1e05..10f36b50a 100644 --- a/src/generated/route-tree.ts +++ b/src/generated/route-tree.ts @@ -13,6 +13,7 @@ import { Route as SettingsRouteImport } from './../routes/settings' import { Route as PlaylistsRouteImport } from './../routes/playlists' import { Route as LibraryRouteImport } from './../routes/library' import { Route as ArtistsRouteImport } from './../routes/artists' +import { Route as AlbumsRouteImport } from './../routes/albums' import { Route as TracksTrackIDRouteImport } from './../routes/tracks.$trackID' import { Route as SettingsUiRouteImport } from './../routes/settings.ui' import { Route as SettingsLibraryRouteImport } from './../routes/settings.library' @@ -20,6 +21,7 @@ import { Route as SettingsAudioRouteImport } from './../routes/settings.audio' import { Route as SettingsAboutRouteImport } from './../routes/settings.about' import { Route as PlaylistsPlaylistIDRouteImport } from './../routes/playlists.$playlistID' import { Route as ArtistsArtistIDRouteImport } from './../routes/artists.$artistID' +import { Route as AlbumsAlbumIDRouteImport } from './../routes/albums.$albumID' import { Route as ArtistsPresetsCompilationsRouteImport } from './../routes/artists.presets.compilations' const SettingsRoute = SettingsRouteImport.update({ @@ -42,6 +44,11 @@ const ArtistsRoute = ArtistsRouteImport.update({ path: '/artists', getParentRoute: () => rootRouteImport, } as any) +const AlbumsRoute = AlbumsRouteImport.update({ + id: '/albums', + path: '/albums', + getParentRoute: () => rootRouteImport, +} as any) const TracksTrackIDRoute = TracksTrackIDRouteImport.update({ id: '/tracks/$trackID', path: '/tracks/$trackID', @@ -77,6 +84,11 @@ const ArtistsArtistIDRoute = ArtistsArtistIDRouteImport.update({ path: '/$artistID', getParentRoute: () => ArtistsRoute, } as any) +const AlbumsAlbumIDRoute = AlbumsAlbumIDRouteImport.update({ + id: '/$albumID', + path: '/$albumID', + getParentRoute: () => AlbumsRoute, +} as any) const ArtistsPresetsCompilationsRoute = ArtistsPresetsCompilationsRouteImport.update({ id: '/presets/compilations', @@ -85,10 +97,12 @@ const ArtistsPresetsCompilationsRoute = } as any) export interface FileRoutesByFullPath { + '/albums': typeof AlbumsRouteWithChildren '/artists': typeof ArtistsRouteWithChildren '/library': typeof LibraryRoute '/playlists': typeof PlaylistsRouteWithChildren '/settings': typeof SettingsRouteWithChildren + '/albums/$albumID': typeof AlbumsAlbumIDRoute '/artists/$artistID': typeof ArtistsArtistIDRoute '/playlists/$playlistID': typeof PlaylistsPlaylistIDRoute '/settings/about': typeof SettingsAboutRoute @@ -99,10 +113,12 @@ export interface FileRoutesByFullPath { '/artists/presets/compilations': typeof ArtistsPresetsCompilationsRoute } export interface FileRoutesByTo { + '/albums': typeof AlbumsRouteWithChildren '/artists': typeof ArtistsRouteWithChildren '/library': typeof LibraryRoute '/playlists': typeof PlaylistsRouteWithChildren '/settings': typeof SettingsRouteWithChildren + '/albums/$albumID': typeof AlbumsAlbumIDRoute '/artists/$artistID': typeof ArtistsArtistIDRoute '/playlists/$playlistID': typeof PlaylistsPlaylistIDRoute '/settings/about': typeof SettingsAboutRoute @@ -114,10 +130,12 @@ export interface FileRoutesByTo { } export interface FileRoutesById { __root__: typeof rootRouteImport + '/albums': typeof AlbumsRouteWithChildren '/artists': typeof ArtistsRouteWithChildren '/library': typeof LibraryRoute '/playlists': typeof PlaylistsRouteWithChildren '/settings': typeof SettingsRouteWithChildren + '/albums/$albumID': typeof AlbumsAlbumIDRoute '/artists/$artistID': typeof ArtistsArtistIDRoute '/playlists/$playlistID': typeof PlaylistsPlaylistIDRoute '/settings/about': typeof SettingsAboutRoute @@ -130,10 +148,12 @@ export interface FileRoutesById { export interface FileRouteTypes { fileRoutesByFullPath: FileRoutesByFullPath fullPaths: + | '/albums' | '/artists' | '/library' | '/playlists' | '/settings' + | '/albums/$albumID' | '/artists/$artistID' | '/playlists/$playlistID' | '/settings/about' @@ -144,10 +164,12 @@ export interface FileRouteTypes { | '/artists/presets/compilations' fileRoutesByTo: FileRoutesByTo to: + | '/albums' | '/artists' | '/library' | '/playlists' | '/settings' + | '/albums/$albumID' | '/artists/$artistID' | '/playlists/$playlistID' | '/settings/about' @@ -158,10 +180,12 @@ export interface FileRouteTypes { | '/artists/presets/compilations' id: | '__root__' + | '/albums' | '/artists' | '/library' | '/playlists' | '/settings' + | '/albums/$albumID' | '/artists/$artistID' | '/playlists/$playlistID' | '/settings/about' @@ -173,6 +197,7 @@ export interface FileRouteTypes { fileRoutesById: FileRoutesById } export interface RootRouteChildren { + AlbumsRoute: typeof AlbumsRouteWithChildren ArtistsRoute: typeof ArtistsRouteWithChildren LibraryRoute: typeof LibraryRoute PlaylistsRoute: typeof PlaylistsRouteWithChildren @@ -210,6 +235,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof ArtistsRouteImport parentRoute: typeof rootRouteImport } + '/albums': { + id: '/albums' + path: '/albums' + fullPath: '/albums' + preLoaderRoute: typeof AlbumsRouteImport + parentRoute: typeof rootRouteImport + } '/tracks/$trackID': { id: '/tracks/$trackID' path: '/tracks/$trackID' @@ -259,6 +291,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof ArtistsArtistIDRouteImport parentRoute: typeof ArtistsRoute } + '/albums/$albumID': { + id: '/albums/$albumID' + path: '/$albumID' + fullPath: '/albums/$albumID' + preLoaderRoute: typeof AlbumsAlbumIDRouteImport + parentRoute: typeof AlbumsRoute + } '/artists/presets/compilations': { id: '/artists/presets/compilations' path: '/presets/compilations' @@ -269,6 +308,17 @@ declare module '@tanstack/react-router' { } } +interface AlbumsRouteChildren { + AlbumsAlbumIDRoute: typeof AlbumsAlbumIDRoute +} + +const AlbumsRouteChildren: AlbumsRouteChildren = { + AlbumsAlbumIDRoute: AlbumsAlbumIDRoute, +} + +const AlbumsRouteWithChildren = + AlbumsRoute._addFileChildren(AlbumsRouteChildren) + interface ArtistsRouteChildren { ArtistsArtistIDRoute: typeof ArtistsArtistIDRoute ArtistsPresetsCompilationsRoute: typeof ArtistsPresetsCompilationsRoute @@ -313,6 +363,7 @@ const SettingsRouteWithChildren = SettingsRoute._addFileChildren( ) const rootRouteChildren: RootRouteChildren = { + AlbumsRoute: AlbumsRouteWithChildren, ArtistsRoute: ArtistsRouteWithChildren, LibraryRoute: LibraryRoute, PlaylistsRoute: PlaylistsRouteWithChildren, diff --git a/src/lib/__mocks__/bridge-database.ts b/src/lib/__mocks__/bridge-database.ts index 15e593a7e..160ba55c3 100644 --- a/src/lib/__mocks__/bridge-database.ts +++ b/src/lib/__mocks__/bridge-database.ts @@ -100,6 +100,14 @@ class DatabaseBridge implements DatabaseBridgeInterface { return []; } + async getAllAlbums(): Promise> { + return []; + } + + async getAlbumTracks(_album: string): Promise> { + return []; + } + async hasCompilations(): Promise { return false; } diff --git a/src/lib/bridge-database.ts b/src/lib/bridge-database.ts index 63f632253..886bb218a 100644 --- a/src/lib/bridge-database.ts +++ b/src/lib/bridge-database.ts @@ -19,6 +19,8 @@ export interface DatabaseBridgeInterface { ): Promise; getAllArtists(): Promise>; getArtistTracks(artist: string): Promise>; + getAllAlbums(): Promise>; + getAlbumTracks(album: string): Promise>; hasCompilations(): Promise; getCompilationAlbums(): Promise>; getAllPlaylists(): Promise>; @@ -87,6 +89,16 @@ class DatabaseBridge implements DatabaseBridgeInterface { return invoke('plugin:database|get_artist_tracks', { artist }); } + @LogExecutionTime + async getAllAlbums(): Promise> { + return invoke('plugin:database|get_all_albums'); + } + + @LogExecutionTime + async getAlbumTracks(album: string): Promise> { + return invoke('plugin:database|get_album_tracks', { album }); + } + @LogExecutionTime async hasCompilations(): Promise { return invoke('plugin:database|has_compilations'); diff --git a/src/routes/albums.$albumID.tsx b/src/routes/albums.$albumID.tsx new file mode 100644 index 000000000..d782c4dfc --- /dev/null +++ b/src/routes/albums.$albumID.tsx @@ -0,0 +1,54 @@ +import { useSuspenseQuery } from '@tanstack/react-query'; +import { createFileRoute } from '@tanstack/react-router'; +import { useMemo } from 'react'; + +import TrackList from '../components/TrackList'; +import TrackListStates from '../components/TrackListStates'; +import { useFilteredTrackGroup } from '../hooks/useFilteredTracks'; +import useFocusedAlbum, { + validateFocusedAlbumSearch, +} from '../hooks/useFocusedAlbum'; +import useGlobalTrackListStatus from '../hooks/useGlobalTrackListStatus'; +import DatabaseBridge from '../lib/bridge-database'; +import { configQuery } from '../lib/queries'; +import type { QueueOrigin } from '../types/museeks'; + +export const Route = createFileRoute('/albums/$albumID')({ + component: ViewAlbumDetails, + loader: async ({ params }) => { + const [albums, playlists] = await Promise.all([ + DatabaseBridge.getAlbumTracks(params.albumID), + DatabaseBridge.getAllPlaylists(), + ]); + + return { albums, playlists }; + }, + validateSearch: validateFocusedAlbumSearch, +}); + +export default function ViewAlbumDetails() { + const { albums, playlists } = Route.useLoaderData(); + const config = useSuspenseQuery(configQuery).data; + const { albumID } = Route.useParams(); + const content = useFilteredTrackGroup(albums); + useGlobalTrackListStatus(content.flatMap(group => group.tracks)); + + const queueOrigin = useMemo(() => { + return { type: 'album', albumID } satisfies QueueOrigin; + }, [albumID]); + + useFocusedAlbum(Route.useSearch().focused_album); + + return ( + group.tracks)}> + + + ); +} diff --git a/src/routes/albums.tsx b/src/routes/albums.tsx new file mode 100644 index 000000000..014f2feb2 --- /dev/null +++ b/src/routes/albums.tsx @@ -0,0 +1,78 @@ +import { useLingui } from '@lingui/react/macro'; +import { + createFileRoute, + Outlet, + redirect, + useLocation, +} from '@tanstack/react-router'; + +import SideNav from '../components/SideNav'; +import SideNavLink from '../components/SideNavLink'; +import TrackListStates from '../components/TrackListStates'; +import View from '../elements/View'; +import DatabaseBridge from '../lib/bridge-database'; +import player from '../lib/player'; + +export const Route = createFileRoute('/albums')({ + component: ViewAlbums, + beforeLoad: async ({ location }) => { + const albums = await DatabaseBridge.getAllAlbums(); + + // Only redirect when landing on /albums with no child route selected + if (location.pathname === '/albums') { + const queueOrigin = player.getQueueOrigin(); + + // If there is a playing album, redirect to it + if (queueOrigin?.type === 'album' && albums.length > 0) { + throw redirect({ + to: '/albums/$albumID', + params: { albumID: queueOrigin.albumID }, + }); + } + + if (albums.length > 0) { + throw redirect({ + to: '/albums/$albumID', + params: { albumID: albums[0] }, + }); + } + } + + return { albums }; + }, + loader: async ({ context }) => { + return context; + }, +}); + +function ViewAlbums() { + const { albums } = Route.useLoaderData(); + const { pathname } = useLocation(); + const { t } = useLingui(); + + return ( + + {albums.map((album) => ( + + ))} + + } + > + {pathname !== '/albums' ? ( + + ) : ( + + )} + + ); +} \ No newline at end of file diff --git a/src/translations/en.po b/src/translations/en.po index a9f9d3714..4041678dc 100644 --- a/src/translations/en.po +++ b/src/translations/en.po @@ -119,20 +119,25 @@ msgid "Artists" msgstr "Artists" #: src/components/Navigation.tsx:57 +#: src/routes/albums.tsx:56 +msgid "Albums" +msgstr "Albums" + +#: src/components/Navigation.tsx:60 #: src/routes/playlists.tsx:165 #: src/routes/settings.ui.tsx:151 msgid "Playlists" msgstr "Playlists" -#: src/components/Navigation.tsx:60 +#: src/components/Navigation.tsx:63 msgid "Settings" msgstr "Settings" -#: src/components/Navigation.tsx:66 +#: src/components/Navigation.tsx:69 msgid "Library status" msgstr "Library status" -#: src/components/Navigation.tsx:90 +#: src/components/Navigation.tsx:93 msgid "scanning tracks..." msgstr "scanning tracks..." @@ -180,90 +185,90 @@ msgstr "Clear search" msgid "Rename" msgstr "Rename" -#: src/components/TrackList.tsx:243 +#: src/components/TrackList.tsx:244 msgid "Create new playlist..." msgstr "Create new playlist..." -#: src/components/TrackList.tsx:246 +#: src/components/TrackList.tsx:247 #: src/routes/playlists.tsx:63 msgid "New playlist" msgstr "New playlist" -#: src/components/TrackList.tsx:259 +#: src/components/TrackList.tsx:260 msgid "No playlists" msgstr "No playlists" #. placeholder {0}: selectedTracks.size #. placeholder {1}: playlist.name -#: src/components/TrackList.tsx:273 +#: src/components/TrackList.tsx:274 msgid "{0} track(s) were added to \"{1}\"" msgstr "{0} track(s) were added to \"{1}\"" -#: src/components/TrackList.tsx:291 +#: src/components/TrackList.tsx:292 msgid "{selectedCount, plural, one {# track selected} other {# tracks selected}}" msgstr "{selectedCount, plural, one {# track selected} other {# tracks selected}}" -#: src/components/TrackList.tsx:303 +#: src/components/TrackList.tsx:304 msgid "Add to queue" msgstr "Add to queue" -#: src/components/TrackList.tsx:311 +#: src/components/TrackList.tsx:312 msgid "Play next" msgstr "Play next" -#: src/components/TrackList.tsx:323 +#: src/components/TrackList.tsx:324 msgid "Add to playlist" msgstr "Add to playlist" -#: src/components/TrackList.tsx:333 +#: src/components/TrackList.tsx:334 msgid "Search for \"{item}\"" msgstr "Search for \"{item}\"" -#: src/components/TrackList.tsx:346 +#: src/components/TrackList.tsx:347 msgid "Copy \"{item}\"" msgstr "Copy \"{item}\"" -#: src/components/TrackList.tsx:369 +#: src/components/TrackList.tsx:370 msgid "Edit track" msgstr "Edit track" -#: src/components/TrackList.tsx:379 +#: src/components/TrackList.tsx:380 msgid "Show in file manager" msgstr "Show in file manager" -#: src/components/TrackList.tsx:385 +#: src/components/TrackList.tsx:386 msgid "Remove from library" msgstr "Remove from library" #. placeholder {0}: selectedTracks.size -#: src/components/TrackList.tsx:388 +#: src/components/TrackList.tsx:389 msgid "Are you sure you want to remove {0} track(s) from your library?" msgstr "Are you sure you want to remove {0} track(s) from your library?" -#: src/components/TrackList.tsx:390 +#: src/components/TrackList.tsx:391 msgid "Remove tracks" msgstr "Remove tracks" -#: src/components/TrackList.tsx:392 +#: src/components/TrackList.tsx:393 #: src/routes/settings.library.tsx:100 #: src/routes/settings.library.tsx:145 #: src/routes/tracks.$trackID.tsx:257 msgid "Cancel" msgstr "Cancel" -#: src/components/TrackList.tsx:393 +#: src/components/TrackList.tsx:394 #: src/routes/settings.library.tsx:64 msgid "Remove" msgstr "Remove" #: src/components/TrackListDefault.tsx:124 -#: src/components/TrackListGrouped.tsx:58 +#: src/components/TrackListGrouped.tsx:59 msgid "Track list" msgstr "Track list" #. placeholder {0}: props.count #. placeholder {0}: tracks.length -#: src/components/TrackListGrouped.tsx:115 +#: src/components/TrackListGrouped.tsx:122 #: src/components/TrackListStatus.tsx:11 msgid "{0, plural, one {# track} other {# tracks}}" msgstr "{0, plural, one {# track} other {# tracks}}" diff --git a/src/translations/es.po b/src/translations/es.po index 9e4645345..a57aaf033 100644 --- a/src/translations/es.po +++ b/src/translations/es.po @@ -119,20 +119,25 @@ msgid "Artists" msgstr "Artistas" #: src/components/Navigation.tsx:57 +#: src/routes/albums.tsx:56 +msgid "Albums" +msgstr "" + +#: src/components/Navigation.tsx:60 #: src/routes/playlists.tsx:165 #: src/routes/settings.ui.tsx:151 msgid "Playlists" msgstr "Listas de reproducción" -#: src/components/Navigation.tsx:60 +#: src/components/Navigation.tsx:63 msgid "Settings" msgstr "Configuración" -#: src/components/Navigation.tsx:66 +#: src/components/Navigation.tsx:69 msgid "Library status" msgstr "" -#: src/components/Navigation.tsx:90 +#: src/components/Navigation.tsx:93 msgid "scanning tracks..." msgstr "escaneando pistas..." @@ -180,90 +185,90 @@ msgstr "" msgid "Rename" msgstr "Renombrar" -#: src/components/TrackList.tsx:243 +#: src/components/TrackList.tsx:244 msgid "Create new playlist..." msgstr "Crear nueva lista..." -#: src/components/TrackList.tsx:246 +#: src/components/TrackList.tsx:247 #: src/routes/playlists.tsx:63 msgid "New playlist" msgstr "Nueva lista" -#: src/components/TrackList.tsx:259 +#: src/components/TrackList.tsx:260 msgid "No playlists" msgstr "Sin listas de reproducción" #. placeholder {0}: selectedTracks.size #. placeholder {1}: playlist.name -#: src/components/TrackList.tsx:273 +#: src/components/TrackList.tsx:274 msgid "{0} track(s) were added to \"{1}\"" msgstr "{0} pista(s) añadida(s) a \"{1}\"" -#: src/components/TrackList.tsx:291 +#: src/components/TrackList.tsx:292 msgid "{selectedCount, plural, one {# track selected} other {# tracks selected}}" msgstr "{selectedCount, plural, one {# pista seleccionada} other {# pistas seleccionadas}}" -#: src/components/TrackList.tsx:303 +#: src/components/TrackList.tsx:304 msgid "Add to queue" msgstr "Añadir a la cola" -#: src/components/TrackList.tsx:311 +#: src/components/TrackList.tsx:312 msgid "Play next" msgstr "Reproducir siguiente" -#: src/components/TrackList.tsx:323 +#: src/components/TrackList.tsx:324 msgid "Add to playlist" msgstr "Añadir a lista de reproducción" -#: src/components/TrackList.tsx:333 +#: src/components/TrackList.tsx:334 msgid "Search for \"{item}\"" msgstr "Buscar \"{item}\"" -#: src/components/TrackList.tsx:346 +#: src/components/TrackList.tsx:347 msgid "Copy \"{item}\"" msgstr "Copiar \"{item}\"" -#: src/components/TrackList.tsx:369 +#: src/components/TrackList.tsx:370 msgid "Edit track" msgstr "Editar pista" -#: src/components/TrackList.tsx:379 +#: src/components/TrackList.tsx:380 msgid "Show in file manager" msgstr "Mostrar en el explorador de archivos" -#: src/components/TrackList.tsx:385 +#: src/components/TrackList.tsx:386 msgid "Remove from library" msgstr "Eliminar de la biblioteca" #. placeholder {0}: selectedTracks.size -#: src/components/TrackList.tsx:388 +#: src/components/TrackList.tsx:389 msgid "Are you sure you want to remove {0} track(s) from your library?" msgstr "¿Estás seguro de que quieres eliminar {0} pista(s) de tu biblioteca?" -#: src/components/TrackList.tsx:390 +#: src/components/TrackList.tsx:391 msgid "Remove tracks" msgstr "Eliminar pistas" -#: src/components/TrackList.tsx:392 +#: src/components/TrackList.tsx:393 #: src/routes/settings.library.tsx:100 #: src/routes/settings.library.tsx:145 #: src/routes/tracks.$trackID.tsx:257 msgid "Cancel" msgstr "Cancelar" -#: src/components/TrackList.tsx:393 +#: src/components/TrackList.tsx:394 #: src/routes/settings.library.tsx:64 msgid "Remove" msgstr "Eliminar" #: src/components/TrackListDefault.tsx:124 -#: src/components/TrackListGrouped.tsx:58 +#: src/components/TrackListGrouped.tsx:59 msgid "Track list" msgstr "" #. placeholder {0}: props.count #. placeholder {0}: tracks.length -#: src/components/TrackListGrouped.tsx:115 +#: src/components/TrackListGrouped.tsx:122 #: src/components/TrackListStatus.tsx:11 msgid "{0, plural, one {# track} other {# tracks}}" msgstr "{0, plural, one {# pista} other {# pistas}}" diff --git a/src/translations/fr.po b/src/translations/fr.po index 62858aee1..835517434 100644 --- a/src/translations/fr.po +++ b/src/translations/fr.po @@ -119,20 +119,25 @@ msgid "Artists" msgstr "Artistes" #: src/components/Navigation.tsx:57 +#: src/routes/albums.tsx:56 +msgid "Albums" +msgstr "" + +#: src/components/Navigation.tsx:60 #: src/routes/playlists.tsx:165 #: src/routes/settings.ui.tsx:151 msgid "Playlists" msgstr "Playlists" -#: src/components/Navigation.tsx:60 +#: src/components/Navigation.tsx:63 msgid "Settings" msgstr "Paramètres" -#: src/components/Navigation.tsx:66 +#: src/components/Navigation.tsx:69 msgid "Library status" msgstr "Statut de la bibliothèque" -#: src/components/Navigation.tsx:90 +#: src/components/Navigation.tsx:93 msgid "scanning tracks..." msgstr "scan des pistes..." @@ -180,90 +185,90 @@ msgstr "Effacer la recherche" msgid "Rename" msgstr "Renommer" -#: src/components/TrackList.tsx:243 +#: src/components/TrackList.tsx:244 msgid "Create new playlist..." msgstr "Créer une nouvelle playlist..." -#: src/components/TrackList.tsx:246 +#: src/components/TrackList.tsx:247 #: src/routes/playlists.tsx:63 msgid "New playlist" msgstr "Nouvelle playlist" -#: src/components/TrackList.tsx:259 +#: src/components/TrackList.tsx:260 msgid "No playlists" msgstr "Aucune playlist" #. placeholder {0}: selectedTracks.size #. placeholder {1}: playlist.name -#: src/components/TrackList.tsx:273 +#: src/components/TrackList.tsx:274 msgid "{0} track(s) were added to \"{1}\"" msgstr "{0} piste(s) ont été ajoutées à \"{1}\"" -#: src/components/TrackList.tsx:291 +#: src/components/TrackList.tsx:292 msgid "{selectedCount, plural, one {# track selected} other {# tracks selected}}" msgstr "{selectedCount, plural, one {# piste sélectionnée} other {# pistes sélectionnées}}" -#: src/components/TrackList.tsx:303 +#: src/components/TrackList.tsx:304 msgid "Add to queue" msgstr "Ajouter à la file d'attente" -#: src/components/TrackList.tsx:311 +#: src/components/TrackList.tsx:312 msgid "Play next" msgstr "Lire ensuite" -#: src/components/TrackList.tsx:323 +#: src/components/TrackList.tsx:324 msgid "Add to playlist" msgstr "Ajouter à une playlist" -#: src/components/TrackList.tsx:333 +#: src/components/TrackList.tsx:334 msgid "Search for \"{item}\"" msgstr "Rechercher \"{item}\"" -#: src/components/TrackList.tsx:346 +#: src/components/TrackList.tsx:347 msgid "Copy \"{item}\"" msgstr "Copier \"{item}\"" -#: src/components/TrackList.tsx:369 +#: src/components/TrackList.tsx:370 msgid "Edit track" msgstr "Modifier la piste" -#: src/components/TrackList.tsx:379 +#: src/components/TrackList.tsx:380 msgid "Show in file manager" msgstr "Montrer dans le gestionnaire de fichiers" -#: src/components/TrackList.tsx:385 +#: src/components/TrackList.tsx:386 msgid "Remove from library" msgstr "Retirer de la bibliothèque" #. placeholder {0}: selectedTracks.size -#: src/components/TrackList.tsx:388 +#: src/components/TrackList.tsx:389 msgid "Are you sure you want to remove {0} track(s) from your library?" msgstr "Êtes-vous sûr de vouloir retirer {0} piste(s) de votre bibliothèque ?" -#: src/components/TrackList.tsx:390 +#: src/components/TrackList.tsx:391 msgid "Remove tracks" msgstr "Retirer les pistes" -#: src/components/TrackList.tsx:392 +#: src/components/TrackList.tsx:393 #: src/routes/settings.library.tsx:100 #: src/routes/settings.library.tsx:145 #: src/routes/tracks.$trackID.tsx:257 msgid "Cancel" msgstr "Annuler" -#: src/components/TrackList.tsx:393 +#: src/components/TrackList.tsx:394 #: src/routes/settings.library.tsx:64 msgid "Remove" msgstr "Retirer" #: src/components/TrackListDefault.tsx:124 -#: src/components/TrackListGrouped.tsx:58 +#: src/components/TrackListGrouped.tsx:59 msgid "Track list" msgstr "Liste des pistes" #. placeholder {0}: props.count #. placeholder {0}: tracks.length -#: src/components/TrackListGrouped.tsx:115 +#: src/components/TrackListGrouped.tsx:122 #: src/components/TrackListStatus.tsx:11 msgid "{0, plural, one {# track} other {# tracks}}" msgstr "{0, plural, one {# piste} other {# pistes}}" diff --git a/src/translations/ja.po b/src/translations/ja.po index 0c0f9ae1a..2ed5c243a 100644 --- a/src/translations/ja.po +++ b/src/translations/ja.po @@ -119,20 +119,25 @@ msgid "Artists" msgstr "アーティスト" #: src/components/Navigation.tsx:57 +#: src/routes/albums.tsx:56 +msgid "Albums" +msgstr "" + +#: src/components/Navigation.tsx:60 #: src/routes/playlists.tsx:165 #: src/routes/settings.ui.tsx:151 msgid "Playlists" msgstr "プレイリスト" -#: src/components/Navigation.tsx:60 +#: src/components/Navigation.tsx:63 msgid "Settings" msgstr "設定" -#: src/components/Navigation.tsx:66 +#: src/components/Navigation.tsx:69 msgid "Library status" msgstr "" -#: src/components/Navigation.tsx:90 +#: src/components/Navigation.tsx:93 msgid "scanning tracks..." msgstr "トラックをスキャン中..." @@ -180,90 +185,90 @@ msgstr "" msgid "Rename" msgstr "名前を変更" -#: src/components/TrackList.tsx:243 +#: src/components/TrackList.tsx:244 msgid "Create new playlist..." msgstr "新しいプレイリストを作成..." -#: src/components/TrackList.tsx:246 +#: src/components/TrackList.tsx:247 #: src/routes/playlists.tsx:63 msgid "New playlist" msgstr "新しいプレイリスト" -#: src/components/TrackList.tsx:259 +#: src/components/TrackList.tsx:260 msgid "No playlists" msgstr "プレイリストがありません" #. placeholder {0}: selectedTracks.size #. placeholder {1}: playlist.name -#: src/components/TrackList.tsx:273 +#: src/components/TrackList.tsx:274 msgid "{0} track(s) were added to \"{1}\"" msgstr "{0} 曲が「{1}」に追加されました" -#: src/components/TrackList.tsx:291 +#: src/components/TrackList.tsx:292 msgid "{selectedCount, plural, one {# track selected} other {# tracks selected}}" msgstr "{selectedCount, plural, one {# 曲が選択されています} other {# 曲が選択されています}}" -#: src/components/TrackList.tsx:303 +#: src/components/TrackList.tsx:304 msgid "Add to queue" msgstr "キューに追加" -#: src/components/TrackList.tsx:311 +#: src/components/TrackList.tsx:312 msgid "Play next" msgstr "次に再生" -#: src/components/TrackList.tsx:323 +#: src/components/TrackList.tsx:324 msgid "Add to playlist" msgstr "プレイリストに追加" -#: src/components/TrackList.tsx:333 +#: src/components/TrackList.tsx:334 msgid "Search for \"{item}\"" msgstr "「{item}」を検索" -#: src/components/TrackList.tsx:346 +#: src/components/TrackList.tsx:347 msgid "Copy \"{item}\"" msgstr "「{item}」をコピー" -#: src/components/TrackList.tsx:369 +#: src/components/TrackList.tsx:370 msgid "Edit track" msgstr "トラックを編集" -#: src/components/TrackList.tsx:379 +#: src/components/TrackList.tsx:380 msgid "Show in file manager" msgstr "ファイルマネージャーで表示" -#: src/components/TrackList.tsx:385 +#: src/components/TrackList.tsx:386 msgid "Remove from library" msgstr "ライブラリから削除" #. placeholder {0}: selectedTracks.size -#: src/components/TrackList.tsx:388 +#: src/components/TrackList.tsx:389 msgid "Are you sure you want to remove {0} track(s) from your library?" msgstr "ライブラリから {0} 曲を削除してもよろしいですか?" -#: src/components/TrackList.tsx:390 +#: src/components/TrackList.tsx:391 msgid "Remove tracks" msgstr "トラックを削除" -#: src/components/TrackList.tsx:392 +#: src/components/TrackList.tsx:393 #: src/routes/settings.library.tsx:100 #: src/routes/settings.library.tsx:145 #: src/routes/tracks.$trackID.tsx:257 msgid "Cancel" msgstr "キャンセル" -#: src/components/TrackList.tsx:393 +#: src/components/TrackList.tsx:394 #: src/routes/settings.library.tsx:64 msgid "Remove" msgstr "削除" #: src/components/TrackListDefault.tsx:124 -#: src/components/TrackListGrouped.tsx:58 +#: src/components/TrackListGrouped.tsx:59 msgid "Track list" msgstr "" #. placeholder {0}: props.count #. placeholder {0}: tracks.length -#: src/components/TrackListGrouped.tsx:115 +#: src/components/TrackListGrouped.tsx:122 #: src/components/TrackListStatus.tsx:11 msgid "{0, plural, one {# track} other {# tracks}}" msgstr "{0, plural, one {# 曲} other {# 曲}}" diff --git a/src/translations/ru.po b/src/translations/ru.po index f59f01d31..4748e481a 100644 --- a/src/translations/ru.po +++ b/src/translations/ru.po @@ -119,20 +119,25 @@ msgid "Artists" msgstr "Исполнители" #: src/components/Navigation.tsx:57 +#: src/routes/albums.tsx:56 +msgid "Albums" +msgstr "" + +#: src/components/Navigation.tsx:60 #: src/routes/playlists.tsx:165 #: src/routes/settings.ui.tsx:151 msgid "Playlists" msgstr "Плейлисты" -#: src/components/Navigation.tsx:60 +#: src/components/Navigation.tsx:63 msgid "Settings" msgstr "Настройки" -#: src/components/Navigation.tsx:66 +#: src/components/Navigation.tsx:69 msgid "Library status" msgstr "" -#: src/components/Navigation.tsx:90 +#: src/components/Navigation.tsx:93 msgid "scanning tracks..." msgstr "сканирование треков..." @@ -180,90 +185,90 @@ msgstr "" msgid "Rename" msgstr "Переименовать" -#: src/components/TrackList.tsx:243 +#: src/components/TrackList.tsx:244 msgid "Create new playlist..." msgstr "Создать новый плейлист..." -#: src/components/TrackList.tsx:246 +#: src/components/TrackList.tsx:247 #: src/routes/playlists.tsx:63 msgid "New playlist" msgstr "Новый плейлист" -#: src/components/TrackList.tsx:259 +#: src/components/TrackList.tsx:260 msgid "No playlists" msgstr "Плейлистов нет" #. placeholder {0}: selectedTracks.size #. placeholder {1}: playlist.name -#: src/components/TrackList.tsx:273 +#: src/components/TrackList.tsx:274 msgid "{0} track(s) were added to \"{1}\"" msgstr "{0} трек(ов) добавлено в \"{1}\"" -#: src/components/TrackList.tsx:291 +#: src/components/TrackList.tsx:292 msgid "{selectedCount, plural, one {# track selected} other {# tracks selected}}" msgstr "Выбран{selectedCount, plural, one { # трек} few {ы # трека} many {о # треков}}" -#: src/components/TrackList.tsx:303 +#: src/components/TrackList.tsx:304 msgid "Add to queue" msgstr "Добавить в очередь" -#: src/components/TrackList.tsx:311 +#: src/components/TrackList.tsx:312 msgid "Play next" msgstr "Играть следующим" -#: src/components/TrackList.tsx:323 +#: src/components/TrackList.tsx:324 msgid "Add to playlist" msgstr "Добавить в плейлист" -#: src/components/TrackList.tsx:333 +#: src/components/TrackList.tsx:334 msgid "Search for \"{item}\"" msgstr "Искать \"{item}\"" -#: src/components/TrackList.tsx:346 +#: src/components/TrackList.tsx:347 msgid "Copy \"{item}\"" msgstr "Скопировать \"{item}\"" -#: src/components/TrackList.tsx:369 +#: src/components/TrackList.tsx:370 msgid "Edit track" msgstr "Редактировать трек" -#: src/components/TrackList.tsx:379 +#: src/components/TrackList.tsx:380 msgid "Show in file manager" msgstr "Открыть в файловом менеджере" -#: src/components/TrackList.tsx:385 +#: src/components/TrackList.tsx:386 msgid "Remove from library" msgstr "Удалить из библиотеки" #. placeholder {0}: selectedTracks.size -#: src/components/TrackList.tsx:388 +#: src/components/TrackList.tsx:389 msgid "Are you sure you want to remove {0} track(s) from your library?" msgstr "Вы уверены, что хотите удалить {0} трек(ов) из вашей библиотеки?" -#: src/components/TrackList.tsx:390 +#: src/components/TrackList.tsx:391 msgid "Remove tracks" msgstr "Удалить треки" -#: src/components/TrackList.tsx:392 +#: src/components/TrackList.tsx:393 #: src/routes/settings.library.tsx:100 #: src/routes/settings.library.tsx:145 #: src/routes/tracks.$trackID.tsx:257 msgid "Cancel" msgstr "Отмена" -#: src/components/TrackList.tsx:393 +#: src/components/TrackList.tsx:394 #: src/routes/settings.library.tsx:64 msgid "Remove" msgstr "Удалить" #: src/components/TrackListDefault.tsx:124 -#: src/components/TrackListGrouped.tsx:58 +#: src/components/TrackListGrouped.tsx:59 msgid "Track list" msgstr "" #. placeholder {0}: props.count #. placeholder {0}: tracks.length -#: src/components/TrackListGrouped.tsx:115 +#: src/components/TrackListGrouped.tsx:122 #: src/components/TrackListStatus.tsx:11 msgid "{0, plural, one {# track} other {# tracks}}" msgstr "{0, plural, one {# трек} few {# трека} many {# треков}}" diff --git a/src/translations/zh-CN.po b/src/translations/zh-CN.po index d815d368a..b472ca2c7 100644 --- a/src/translations/zh-CN.po +++ b/src/translations/zh-CN.po @@ -119,20 +119,25 @@ msgid "Artists" msgstr "艺术家" #: src/components/Navigation.tsx:57 +#: src/routes/albums.tsx:56 +msgid "Albums" +msgstr "" + +#: src/components/Navigation.tsx:60 #: src/routes/playlists.tsx:165 #: src/routes/settings.ui.tsx:151 msgid "Playlists" msgstr "播放列表" -#: src/components/Navigation.tsx:60 +#: src/components/Navigation.tsx:63 msgid "Settings" msgstr "设置" -#: src/components/Navigation.tsx:66 +#: src/components/Navigation.tsx:69 msgid "Library status" msgstr "" -#: src/components/Navigation.tsx:90 +#: src/components/Navigation.tsx:93 msgid "scanning tracks..." msgstr "正在扫描音轨..." @@ -180,90 +185,90 @@ msgstr "" msgid "Rename" msgstr "重命名" -#: src/components/TrackList.tsx:243 +#: src/components/TrackList.tsx:244 msgid "Create new playlist..." msgstr "创建新播放列表..." -#: src/components/TrackList.tsx:246 +#: src/components/TrackList.tsx:247 #: src/routes/playlists.tsx:63 msgid "New playlist" msgstr "新播放列表" -#: src/components/TrackList.tsx:259 +#: src/components/TrackList.tsx:260 msgid "No playlists" msgstr "没有播放列表" #. placeholder {0}: selectedTracks.size #. placeholder {1}: playlist.name -#: src/components/TrackList.tsx:273 +#: src/components/TrackList.tsx:274 msgid "{0} track(s) were added to \"{1}\"" msgstr "{0} 首音轨已添加到 \"{1}\"" -#: src/components/TrackList.tsx:291 +#: src/components/TrackList.tsx:292 msgid "{selectedCount, plural, one {# track selected} other {# tracks selected}}" msgstr "{selectedCount, plural, one {# 首音轨已选择} other {# 首音轨已选择}}" -#: src/components/TrackList.tsx:303 +#: src/components/TrackList.tsx:304 msgid "Add to queue" msgstr "添加到队列" -#: src/components/TrackList.tsx:311 +#: src/components/TrackList.tsx:312 msgid "Play next" msgstr "下一个播放" -#: src/components/TrackList.tsx:323 +#: src/components/TrackList.tsx:324 msgid "Add to playlist" msgstr "添加到播放列表" -#: src/components/TrackList.tsx:333 +#: src/components/TrackList.tsx:334 msgid "Search for \"{item}\"" msgstr "搜索 \"{item}\"" -#: src/components/TrackList.tsx:346 +#: src/components/TrackList.tsx:347 msgid "Copy \"{item}\"" msgstr "复制 \"{item}\"" -#: src/components/TrackList.tsx:369 +#: src/components/TrackList.tsx:370 msgid "Edit track" msgstr "编辑音轨" -#: src/components/TrackList.tsx:379 +#: src/components/TrackList.tsx:380 msgid "Show in file manager" msgstr "在文件管理器中显示" -#: src/components/TrackList.tsx:385 +#: src/components/TrackList.tsx:386 msgid "Remove from library" msgstr "从音乐库中移除" #. placeholder {0}: selectedTracks.size -#: src/components/TrackList.tsx:388 +#: src/components/TrackList.tsx:389 msgid "Are you sure you want to remove {0} track(s) from your library?" msgstr "您确定要从音乐库中移除 {0} 首音轨吗?" -#: src/components/TrackList.tsx:390 +#: src/components/TrackList.tsx:391 msgid "Remove tracks" msgstr "移除音轨" -#: src/components/TrackList.tsx:392 +#: src/components/TrackList.tsx:393 #: src/routes/settings.library.tsx:100 #: src/routes/settings.library.tsx:145 #: src/routes/tracks.$trackID.tsx:257 msgid "Cancel" msgstr "取消" -#: src/components/TrackList.tsx:393 +#: src/components/TrackList.tsx:394 #: src/routes/settings.library.tsx:64 msgid "Remove" msgstr "移除" #: src/components/TrackListDefault.tsx:124 -#: src/components/TrackListGrouped.tsx:58 +#: src/components/TrackListGrouped.tsx:59 msgid "Track list" msgstr "" #. placeholder {0}: props.count #. placeholder {0}: tracks.length -#: src/components/TrackListGrouped.tsx:115 +#: src/components/TrackListGrouped.tsx:122 #: src/components/TrackListStatus.tsx:11 msgid "{0, plural, one {# track} other {# tracks}}" msgstr "{0, plural, one {# 首音轨} other {# 首音轨}}" diff --git a/src/translations/zh-TW.po b/src/translations/zh-TW.po index d94fa86ea..da90c70d7 100644 --- a/src/translations/zh-TW.po +++ b/src/translations/zh-TW.po @@ -119,20 +119,25 @@ msgid "Artists" msgstr "藝術家" #: src/components/Navigation.tsx:57 +#: src/routes/albums.tsx:56 +msgid "Albums" +msgstr "" + +#: src/components/Navigation.tsx:60 #: src/routes/playlists.tsx:165 #: src/routes/settings.ui.tsx:151 msgid "Playlists" msgstr "播放清單" -#: src/components/Navigation.tsx:60 +#: src/components/Navigation.tsx:63 msgid "Settings" msgstr "設定" -#: src/components/Navigation.tsx:66 +#: src/components/Navigation.tsx:69 msgid "Library status" msgstr "" -#: src/components/Navigation.tsx:90 +#: src/components/Navigation.tsx:93 msgid "scanning tracks..." msgstr "正在掃描音軌..." @@ -180,90 +185,90 @@ msgstr "" msgid "Rename" msgstr "重新命名" -#: src/components/TrackList.tsx:243 +#: src/components/TrackList.tsx:244 msgid "Create new playlist..." msgstr "建立新播放清單..." -#: src/components/TrackList.tsx:246 +#: src/components/TrackList.tsx:247 #: src/routes/playlists.tsx:63 msgid "New playlist" msgstr "新播放清單" -#: src/components/TrackList.tsx:259 +#: src/components/TrackList.tsx:260 msgid "No playlists" msgstr "沒有播放清單" #. placeholder {0}: selectedTracks.size #. placeholder {1}: playlist.name -#: src/components/TrackList.tsx:273 +#: src/components/TrackList.tsx:274 msgid "{0} track(s) were added to \"{1}\"" msgstr "{0} 首音軌已新增到 \"{1}\"" -#: src/components/TrackList.tsx:291 +#: src/components/TrackList.tsx:292 msgid "{selectedCount, plural, one {# track selected} other {# tracks selected}}" msgstr "{selectedCount, plural, one {# 首音軌已選擇} other {# 首音軌已選擇}}" -#: src/components/TrackList.tsx:303 +#: src/components/TrackList.tsx:304 msgid "Add to queue" msgstr "新增到佇列" -#: src/components/TrackList.tsx:311 +#: src/components/TrackList.tsx:312 msgid "Play next" msgstr "接著播放" -#: src/components/TrackList.tsx:323 +#: src/components/TrackList.tsx:324 msgid "Add to playlist" msgstr "新增到播放清單" -#: src/components/TrackList.tsx:333 +#: src/components/TrackList.tsx:334 msgid "Search for \"{item}\"" msgstr "搜尋 \"{item}\"" -#: src/components/TrackList.tsx:346 +#: src/components/TrackList.tsx:347 msgid "Copy \"{item}\"" msgstr "複製 \"{item}\"" -#: src/components/TrackList.tsx:369 +#: src/components/TrackList.tsx:370 msgid "Edit track" msgstr "編輯音軌" -#: src/components/TrackList.tsx:379 +#: src/components/TrackList.tsx:380 msgid "Show in file manager" msgstr "在檔案管理員中顯示" -#: src/components/TrackList.tsx:385 +#: src/components/TrackList.tsx:386 msgid "Remove from library" msgstr "從音樂庫中移除" #. placeholder {0}: selectedTracks.size -#: src/components/TrackList.tsx:388 +#: src/components/TrackList.tsx:389 msgid "Are you sure you want to remove {0} track(s) from your library?" msgstr "您確定要從音樂庫中移除 {0} 首音軌嗎?" -#: src/components/TrackList.tsx:390 +#: src/components/TrackList.tsx:391 msgid "Remove tracks" msgstr "移除音軌" -#: src/components/TrackList.tsx:392 +#: src/components/TrackList.tsx:393 #: src/routes/settings.library.tsx:100 #: src/routes/settings.library.tsx:145 #: src/routes/tracks.$trackID.tsx:257 msgid "Cancel" msgstr "取消" -#: src/components/TrackList.tsx:393 +#: src/components/TrackList.tsx:394 #: src/routes/settings.library.tsx:64 msgid "Remove" msgstr "移除" #: src/components/TrackListDefault.tsx:124 -#: src/components/TrackListGrouped.tsx:58 +#: src/components/TrackListGrouped.tsx:59 msgid "Track list" msgstr "" #. placeholder {0}: props.count #. placeholder {0}: tracks.length -#: src/components/TrackListGrouped.tsx:115 +#: src/components/TrackListGrouped.tsx:122 #: src/components/TrackListStatus.tsx:11 msgid "{0, plural, one {# track} other {# tracks}}" msgstr "{0, plural, one {# 首音軌} other {# 首音軌}}" diff --git a/src/types/museeks.ts b/src/types/museeks.ts index 0651a2b0c..077321097 100644 --- a/src/types/museeks.ts +++ b/src/types/museeks.ts @@ -59,6 +59,7 @@ export type QueueOrigin = | { type: 'library' } | { type: 'playlist'; playlistID: string } | { type: 'artist'; artistID: string } + | { type: 'album'; albumID: string } | { type: 'compilations' } | { type: 'file_associations' }; From 40d4c0dbe8cae6e202dccc15fcb68025cf94e508 Mon Sep 17 00:00:00 2001 From: Adrian Date: Sun, 19 Apr 2026 09:56:31 +1000 Subject: [PATCH 2/3] Add default view and handle artists not all being the same --- src-tauri/src/plugins/config.rs | 1 + src-tauri/src/plugins/default_view.rs | 1 + src/generated/typings.ts | 2 +- src/routes/albums.$albumID.tsx | 77 +++++++++++++++------------ src/routes/settings.ui.tsx | 3 ++ src/translations/en.po | 19 +++---- src/translations/es.po | 19 +++---- src/translations/fr.po | 19 +++---- src/translations/ja.po | 19 +++---- src/translations/ru.po | 19 +++---- src/translations/zh-CN.po | 19 +++---- src/translations/zh-TW.po | 19 +++---- 12 files changed, 118 insertions(+), 99 deletions(-) diff --git a/src-tauri/src/plugins/config.rs b/src-tauri/src/plugins/config.rs index 1adfbb3b3..a55a07624 100644 --- a/src-tauri/src/plugins/config.rs +++ b/src-tauri/src/plugins/config.rs @@ -43,6 +43,7 @@ pub enum DefaultView { Library, Artists, Playlists, + Albums, } #[derive(Serialize, Deserialize, Debug, Clone, TS)] diff --git a/src-tauri/src/plugins/default_view.rs b/src-tauri/src/plugins/default_view.rs index d01746fdc..594b6687e 100644 --- a/src-tauri/src/plugins/default_view.rs +++ b/src-tauri/src/plugins/default_view.rs @@ -34,6 +34,7 @@ pub fn init() -> TauriPlugin { DefaultView::Library => "/library", DefaultView::Artists => "/artists", DefaultView::Playlists => "/playlists", + DefaultView::Albums => "/albums", }; info!("Navigating to '{}'", fragment); diff --git a/src/generated/typings.ts b/src/generated/typings.ts index 6404f4047..2c2baa11f 100644 --- a/src/generated/typings.ts +++ b/src/generated/typings.ts @@ -2,7 +2,7 @@ export type Config = { language: string, theme: string, ui_accent_color: string | null, audio_volume: number, audio_playback_rate: number | null, audio_follow_playing_track: boolean, audio_muted: boolean, audio_shuffle: boolean, audio_repeat: Repeat, audio_stream_server: boolean, default_view: DefaultView, library_sort_by: SortBy, library_sort_order: SortOrder, library_folders: Array, library_autorefresh: boolean, sleepblocker: boolean, auto_update_checker: boolean, notifications: boolean, track_view_density: TrackViewDensity, wayland_compat: boolean, menu_bar_visible: boolean, }; -export type DefaultView = "Library" | "Artists" | "Playlists"; +export type DefaultView = "Library" | "Artists" | "Playlists" | "Albums"; export type IPCEvent = { "Unknown": string } | "PlaybackPlay" | "PlaybackPause" | "PlaybackStop" | "PlaybackPlayPause" | "PlaybackPrevious" | "PlaybackNext" | "PlaybackStart" | "LibraryScanProgress" | "GoToLibrary" | "GoToPlaylists" | "GoToSettings" | "JumpToPlayingTrack"; diff --git a/src/routes/albums.$albumID.tsx b/src/routes/albums.$albumID.tsx index d782c4dfc..0162cffd6 100644 --- a/src/routes/albums.$albumID.tsx +++ b/src/routes/albums.$albumID.tsx @@ -6,7 +6,7 @@ import TrackList from '../components/TrackList'; import TrackListStates from '../components/TrackListStates'; import { useFilteredTrackGroup } from '../hooks/useFilteredTracks'; import useFocusedAlbum, { - validateFocusedAlbumSearch, + validateFocusedAlbumSearch, } from '../hooks/useFocusedAlbum'; import useGlobalTrackListStatus from '../hooks/useGlobalTrackListStatus'; import DatabaseBridge from '../lib/bridge-database'; @@ -14,41 +14,48 @@ import { configQuery } from '../lib/queries'; import type { QueueOrigin } from '../types/museeks'; export const Route = createFileRoute('/albums/$albumID')({ - component: ViewAlbumDetails, - loader: async ({ params }) => { - const [albums, playlists] = await Promise.all([ - DatabaseBridge.getAlbumTracks(params.albumID), - DatabaseBridge.getAllPlaylists(), - ]); - - return { albums, playlists }; - }, - validateSearch: validateFocusedAlbumSearch, + component: ViewAlbumDetails, + loader: async ({ params }) => { + const [albums, playlists] = await Promise.all([ + DatabaseBridge.getAlbumTracks(params.albumID), + DatabaseBridge.getAllPlaylists(), + ]); + + return { albums, playlists }; + }, + validateSearch: validateFocusedAlbumSearch, }); export default function ViewAlbumDetails() { - const { albums, playlists } = Route.useLoaderData(); - const config = useSuspenseQuery(configQuery).data; - const { albumID } = Route.useParams(); - const content = useFilteredTrackGroup(albums); - useGlobalTrackListStatus(content.flatMap(group => group.tracks)); - - const queueOrigin = useMemo(() => { - return { type: 'album', albumID } satisfies QueueOrigin; - }, [albumID]); - - useFocusedAlbum(Route.useSearch().focused_album); - - return ( - group.tracks)}> - - - ); + const { albums, playlists } = Route.useLoaderData(); + const config = useSuspenseQuery(configQuery).data; + const { albumID } = Route.useParams(); + const content = useFilteredTrackGroup(albums); + useGlobalTrackListStatus(content.flatMap(group => group.tracks)); + + const queueOrigin = useMemo(() => { + return { type: 'album', albumID } satisfies QueueOrigin; + }, [albumID]); + + useFocusedAlbum(Route.useSearch().focused_album); + + const allArtistsAreSame = content.every( + group => group.tracks.every( + track => track.album_artist === content[0].tracks[0].album_artist + ) + ); + + return ( + group.tracks)}> + + + ); } diff --git a/src/routes/settings.ui.tsx b/src/routes/settings.ui.tsx index 4fd5b318f..d4663a377 100644 --- a/src/routes/settings.ui.tsx +++ b/src/routes/settings.ui.tsx @@ -147,6 +147,9 @@ function ViewSettingsUI() { + diff --git a/src/translations/en.po b/src/translations/en.po index 4041678dc..5ebcab65a 100644 --- a/src/translations/en.po +++ b/src/translations/en.po @@ -120,12 +120,13 @@ msgstr "Artists" #: src/components/Navigation.tsx:57 #: src/routes/albums.tsx:56 +#: src/routes/settings.ui.tsx:151 msgid "Albums" msgstr "Albums" #: src/components/Navigation.tsx:60 #: src/routes/playlists.tsx:165 -#: src/routes/settings.ui.tsx:151 +#: src/routes/settings.ui.tsx:154 msgid "Playlists" msgstr "Playlists" @@ -571,35 +572,35 @@ msgstr "Change the default view when starting the application" msgid "Library (default)" msgstr "Library (default)" -#: src/routes/settings.ui.tsx:157 +#: src/routes/settings.ui.tsx:160 msgid "Display Notifications" msgstr "Display Notifications" -#: src/routes/settings.ui.tsx:158 +#: src/routes/settings.ui.tsx:161 msgid "Send notifications when the playing track changes" msgstr "Send notifications when the playing track changes" -#: src/routes/settings.ui.tsx:167 +#: src/routes/settings.ui.tsx:170 msgid "Sleep mode blocker" msgstr "Sleep mode blocker" -#: src/routes/settings.ui.tsx:168 +#: src/routes/settings.ui.tsx:171 msgid "Prevent the computer from going into sleep mode when playing" msgstr "Prevent the computer from going into sleep mode when playing" -#: src/routes/settings.ui.tsx:178 +#: src/routes/settings.ui.tsx:181 msgid "[Beta] Wayland compatibility enhancements" msgstr "[Beta] Wayland compatibility enhancements" -#: src/routes/settings.ui.tsx:179 +#: src/routes/settings.ui.tsx:182 msgid "If you face issues using Wayland, try out this option" msgstr "If you face issues using Wayland, try out this option" -#: src/routes/settings.ui.tsx:202 +#: src/routes/settings.ui.tsx:205 msgid "Light" msgstr "Light" -#: src/routes/settings.ui.tsx:204 +#: src/routes/settings.ui.tsx:207 msgid "Dark" msgstr "Dark" diff --git a/src/translations/es.po b/src/translations/es.po index a57aaf033..0b4aba041 100644 --- a/src/translations/es.po +++ b/src/translations/es.po @@ -120,12 +120,13 @@ msgstr "Artistas" #: src/components/Navigation.tsx:57 #: src/routes/albums.tsx:56 +#: src/routes/settings.ui.tsx:151 msgid "Albums" msgstr "" #: src/components/Navigation.tsx:60 #: src/routes/playlists.tsx:165 -#: src/routes/settings.ui.tsx:151 +#: src/routes/settings.ui.tsx:154 msgid "Playlists" msgstr "Listas de reproducción" @@ -571,35 +572,35 @@ msgstr "Cambiar la vista por defecto al iniciar la aplicación" msgid "Library (default)" msgstr "Biblioteca (por defecto)" -#: src/routes/settings.ui.tsx:157 +#: src/routes/settings.ui.tsx:160 msgid "Display Notifications" msgstr "Mostrar Notificaciones" -#: src/routes/settings.ui.tsx:158 +#: src/routes/settings.ui.tsx:161 msgid "Send notifications when the playing track changes" msgstr "Enviar notificaciones cuando cambie la pista" -#: src/routes/settings.ui.tsx:167 +#: src/routes/settings.ui.tsx:170 msgid "Sleep mode blocker" msgstr "Bloqueador de suspensión" -#: src/routes/settings.ui.tsx:168 +#: src/routes/settings.ui.tsx:171 msgid "Prevent the computer from going into sleep mode when playing" msgstr "Evitar que el equipo se suspenda mientras reproduce" -#: src/routes/settings.ui.tsx:178 +#: src/routes/settings.ui.tsx:181 msgid "[Beta] Wayland compatibility enhancements" msgstr "[Beta] Mejoras de compatibilidad con Wayland" -#: src/routes/settings.ui.tsx:179 +#: src/routes/settings.ui.tsx:182 msgid "If you face issues using Wayland, try out this option" msgstr "Si tienes problemas usando Wayland, prueba esta opción" -#: src/routes/settings.ui.tsx:202 +#: src/routes/settings.ui.tsx:205 msgid "Light" msgstr "Claro" -#: src/routes/settings.ui.tsx:204 +#: src/routes/settings.ui.tsx:207 msgid "Dark" msgstr "Oscuro" diff --git a/src/translations/fr.po b/src/translations/fr.po index 835517434..d0d03d393 100644 --- a/src/translations/fr.po +++ b/src/translations/fr.po @@ -120,12 +120,13 @@ msgstr "Artistes" #: src/components/Navigation.tsx:57 #: src/routes/albums.tsx:56 +#: src/routes/settings.ui.tsx:151 msgid "Albums" msgstr "" #: src/components/Navigation.tsx:60 #: src/routes/playlists.tsx:165 -#: src/routes/settings.ui.tsx:151 +#: src/routes/settings.ui.tsx:154 msgid "Playlists" msgstr "Playlists" @@ -571,35 +572,35 @@ msgstr "Changer la vue par défaut au démarrage de l'application" msgid "Library (default)" msgstr "Bibliothèque (par défaut)" -#: src/routes/settings.ui.tsx:157 +#: src/routes/settings.ui.tsx:160 msgid "Display Notifications" msgstr "Afficher les notifications" -#: src/routes/settings.ui.tsx:158 +#: src/routes/settings.ui.tsx:161 msgid "Send notifications when the playing track changes" msgstr "Envoyer des notifications lorsque la piste en cours change" -#: src/routes/settings.ui.tsx:167 +#: src/routes/settings.ui.tsx:170 msgid "Sleep mode blocker" msgstr "Bloqueur de mode veille" -#: src/routes/settings.ui.tsx:168 +#: src/routes/settings.ui.tsx:171 msgid "Prevent the computer from going into sleep mode when playing" msgstr "Empêcher l'ordinateur de passer en mode veille lors de la lecture" -#: src/routes/settings.ui.tsx:178 +#: src/routes/settings.ui.tsx:181 msgid "[Beta] Wayland compatibility enhancements" msgstr "[Beta] Améliorations de la compatibilité Wayland" -#: src/routes/settings.ui.tsx:179 +#: src/routes/settings.ui.tsx:182 msgid "If you face issues using Wayland, try out this option" msgstr "Si vous rencontrez des problèmes avec Wayland, essayez cette option" -#: src/routes/settings.ui.tsx:202 +#: src/routes/settings.ui.tsx:205 msgid "Light" msgstr "Clair" -#: src/routes/settings.ui.tsx:204 +#: src/routes/settings.ui.tsx:207 msgid "Dark" msgstr "Sombre" diff --git a/src/translations/ja.po b/src/translations/ja.po index 2ed5c243a..93c1e94ef 100644 --- a/src/translations/ja.po +++ b/src/translations/ja.po @@ -120,12 +120,13 @@ msgstr "アーティスト" #: src/components/Navigation.tsx:57 #: src/routes/albums.tsx:56 +#: src/routes/settings.ui.tsx:151 msgid "Albums" msgstr "" #: src/components/Navigation.tsx:60 #: src/routes/playlists.tsx:165 -#: src/routes/settings.ui.tsx:151 +#: src/routes/settings.ui.tsx:154 msgid "Playlists" msgstr "プレイリスト" @@ -571,35 +572,35 @@ msgstr "アプリケーション起動時のデフォルトビューを変更" msgid "Library (default)" msgstr "ライブラリ(デフォルト)" -#: src/routes/settings.ui.tsx:157 +#: src/routes/settings.ui.tsx:160 msgid "Display Notifications" msgstr "通知を表示" -#: src/routes/settings.ui.tsx:158 +#: src/routes/settings.ui.tsx:161 msgid "Send notifications when the playing track changes" msgstr "再生中のトラックが変更された時に通知を送信" -#: src/routes/settings.ui.tsx:167 +#: src/routes/settings.ui.tsx:170 msgid "Sleep mode blocker" msgstr "スリープモード防止" -#: src/routes/settings.ui.tsx:168 +#: src/routes/settings.ui.tsx:171 msgid "Prevent the computer from going into sleep mode when playing" msgstr "再生中にコンピューターがスリープモードに入るのを防ぐ" -#: src/routes/settings.ui.tsx:178 +#: src/routes/settings.ui.tsx:181 msgid "[Beta] Wayland compatibility enhancements" msgstr "[ベータ] Wayland互換性強化" -#: src/routes/settings.ui.tsx:179 +#: src/routes/settings.ui.tsx:182 msgid "If you face issues using Wayland, try out this option" msgstr "Waylandの使用で問題が発生した場合は、このオプションをお試しください" -#: src/routes/settings.ui.tsx:202 +#: src/routes/settings.ui.tsx:205 msgid "Light" msgstr "ライト" -#: src/routes/settings.ui.tsx:204 +#: src/routes/settings.ui.tsx:207 msgid "Dark" msgstr "ダーク" diff --git a/src/translations/ru.po b/src/translations/ru.po index 4748e481a..d24c1433c 100644 --- a/src/translations/ru.po +++ b/src/translations/ru.po @@ -120,12 +120,13 @@ msgstr "Исполнители" #: src/components/Navigation.tsx:57 #: src/routes/albums.tsx:56 +#: src/routes/settings.ui.tsx:151 msgid "Albums" msgstr "" #: src/components/Navigation.tsx:60 #: src/routes/playlists.tsx:165 -#: src/routes/settings.ui.tsx:151 +#: src/routes/settings.ui.tsx:154 msgid "Playlists" msgstr "Плейлисты" @@ -571,35 +572,35 @@ msgstr "Изменить представление по умолчанию пр msgid "Library (default)" msgstr "Библиотека (по умолчанию)" -#: src/routes/settings.ui.tsx:157 +#: src/routes/settings.ui.tsx:160 msgid "Display Notifications" msgstr "Отображать уведомления" -#: src/routes/settings.ui.tsx:158 +#: src/routes/settings.ui.tsx:161 msgid "Send notifications when the playing track changes" msgstr "Посылать уведомления при смене проигрываемого трека" -#: src/routes/settings.ui.tsx:167 +#: src/routes/settings.ui.tsx:170 msgid "Sleep mode blocker" msgstr "Блокировать режим сна" -#: src/routes/settings.ui.tsx:168 +#: src/routes/settings.ui.tsx:171 msgid "Prevent the computer from going into sleep mode when playing" msgstr "Предпятствовать переходу компьютера в режим сна во время проигрывания" -#: src/routes/settings.ui.tsx:178 +#: src/routes/settings.ui.tsx:181 msgid "[Beta] Wayland compatibility enhancements" msgstr "[Beta] Улучшения совместимости с Wayland" -#: src/routes/settings.ui.tsx:179 +#: src/routes/settings.ui.tsx:182 msgid "If you face issues using Wayland, try out this option" msgstr "Если у вас возникли проблемы с Wayland, попробуйте эту опцию" -#: src/routes/settings.ui.tsx:202 +#: src/routes/settings.ui.tsx:205 msgid "Light" msgstr "Светлая" -#: src/routes/settings.ui.tsx:204 +#: src/routes/settings.ui.tsx:207 msgid "Dark" msgstr "Тёмная" diff --git a/src/translations/zh-CN.po b/src/translations/zh-CN.po index b472ca2c7..33f47d420 100644 --- a/src/translations/zh-CN.po +++ b/src/translations/zh-CN.po @@ -120,12 +120,13 @@ msgstr "艺术家" #: src/components/Navigation.tsx:57 #: src/routes/albums.tsx:56 +#: src/routes/settings.ui.tsx:151 msgid "Albums" msgstr "" #: src/components/Navigation.tsx:60 #: src/routes/playlists.tsx:165 -#: src/routes/settings.ui.tsx:151 +#: src/routes/settings.ui.tsx:154 msgid "Playlists" msgstr "播放列表" @@ -571,35 +572,35 @@ msgstr "更改启动应用程序时的默认视图" msgid "Library (default)" msgstr "音乐库(默认)" -#: src/routes/settings.ui.tsx:157 +#: src/routes/settings.ui.tsx:160 msgid "Display Notifications" msgstr "显示通知" -#: src/routes/settings.ui.tsx:158 +#: src/routes/settings.ui.tsx:161 msgid "Send notifications when the playing track changes" msgstr "播放音轨更改时发送通知" -#: src/routes/settings.ui.tsx:167 +#: src/routes/settings.ui.tsx:170 msgid "Sleep mode blocker" msgstr "睡眠模式阻止器" -#: src/routes/settings.ui.tsx:168 +#: src/routes/settings.ui.tsx:171 msgid "Prevent the computer from going into sleep mode when playing" msgstr "播放时防止计算机进入睡眠模式" -#: src/routes/settings.ui.tsx:178 +#: src/routes/settings.ui.tsx:181 msgid "[Beta] Wayland compatibility enhancements" msgstr "[测试版] Wayland 兼容性增强" -#: src/routes/settings.ui.tsx:179 +#: src/routes/settings.ui.tsx:182 msgid "If you face issues using Wayland, try out this option" msgstr "如果您在使用 Wayland 时遇到问题,请尝试此选项" -#: src/routes/settings.ui.tsx:202 +#: src/routes/settings.ui.tsx:205 msgid "Light" msgstr "浅色" -#: src/routes/settings.ui.tsx:204 +#: src/routes/settings.ui.tsx:207 msgid "Dark" msgstr "深色" diff --git a/src/translations/zh-TW.po b/src/translations/zh-TW.po index da90c70d7..a6d6b0796 100644 --- a/src/translations/zh-TW.po +++ b/src/translations/zh-TW.po @@ -120,12 +120,13 @@ msgstr "藝術家" #: src/components/Navigation.tsx:57 #: src/routes/albums.tsx:56 +#: src/routes/settings.ui.tsx:151 msgid "Albums" msgstr "" #: src/components/Navigation.tsx:60 #: src/routes/playlists.tsx:165 -#: src/routes/settings.ui.tsx:151 +#: src/routes/settings.ui.tsx:154 msgid "Playlists" msgstr "播放清單" @@ -571,35 +572,35 @@ msgstr "變更啟動應用程式時的預設檢視" msgid "Library (default)" msgstr "音樂庫(預設)" -#: src/routes/settings.ui.tsx:157 +#: src/routes/settings.ui.tsx:160 msgid "Display Notifications" msgstr "顯示通知" -#: src/routes/settings.ui.tsx:158 +#: src/routes/settings.ui.tsx:161 msgid "Send notifications when the playing track changes" msgstr "播放音軌變更時發送通知" -#: src/routes/settings.ui.tsx:167 +#: src/routes/settings.ui.tsx:170 msgid "Sleep mode blocker" msgstr "睡眠模式阻止器" -#: src/routes/settings.ui.tsx:168 +#: src/routes/settings.ui.tsx:171 msgid "Prevent the computer from going into sleep mode when playing" msgstr "播放時防止電腦進入睡眠模式" -#: src/routes/settings.ui.tsx:178 +#: src/routes/settings.ui.tsx:181 msgid "[Beta] Wayland compatibility enhancements" msgstr "[測試版] Wayland 相容性強化" -#: src/routes/settings.ui.tsx:179 +#: src/routes/settings.ui.tsx:182 msgid "If you face issues using Wayland, try out this option" msgstr "如果您在使用 Wayland 時遇到問題,請嘗試此選項" -#: src/routes/settings.ui.tsx:202 +#: src/routes/settings.ui.tsx:205 msgid "Light" msgstr "淺色" -#: src/routes/settings.ui.tsx:204 +#: src/routes/settings.ui.tsx:207 msgid "Dark" msgstr "深色" From 126cb37389a8b360a5e0293acd8be38f2502d1f8 Mon Sep 17 00:00:00 2001 From: Adrian Date: Tue, 28 Apr 2026 09:49:03 +1000 Subject: [PATCH 3/3] Fix formatting from vp check --- src/components/TrackListGrouped.tsx | 13 ++++- src/routes/albums.$albumID.tsx | 87 +++++++++++++++-------------- src/routes/albums.tsx | 2 +- 3 files changed, 57 insertions(+), 45 deletions(-) diff --git a/src/components/TrackListGrouped.tsx b/src/components/TrackListGrouped.tsx index 3d0ee65f0..5f8acc39b 100644 --- a/src/components/TrackListGrouped.tsx +++ b/src/components/TrackListGrouped.tsx @@ -28,7 +28,14 @@ type Props = { } & TrackRowEvents; export default function TrackListGroupedLayout(props: Props) { - const { ref, trackGroups, rowHeight, showArtistInTitle, showArtistLabel, ...rest } = props; + const { + ref, + trackGroups, + rowHeight, + showArtistInTitle, + showArtistLabel, + ...rest + } = props; const { t } = useLingui(); const tracks = useAllTracks(trackGroups); @@ -101,7 +108,9 @@ function TrackListGroup(props: TrackListGroupProps) { return null; } - const artistName = showArtistLabel ? (tracks[0]?.album_artist || tracks[0]?.artists[0] || null) : null; + const artistName = showArtistLabel + ? tracks[0]?.album_artist || tracks[0]?.artists[0] || null + : null; return (
{ - const [albums, playlists] = await Promise.all([ - DatabaseBridge.getAlbumTracks(params.albumID), - DatabaseBridge.getAllPlaylists(), - ]); - - return { albums, playlists }; - }, - validateSearch: validateFocusedAlbumSearch, + component: ViewAlbumDetails, + loader: async ({ params }) => { + const [albums, playlists] = await Promise.all([ + DatabaseBridge.getAlbumTracks(params.albumID), + DatabaseBridge.getAllPlaylists(), + ]); + + return { albums, playlists }; + }, + validateSearch: validateFocusedAlbumSearch, }); export default function ViewAlbumDetails() { - const { albums, playlists } = Route.useLoaderData(); - const config = useSuspenseQuery(configQuery).data; - const { albumID } = Route.useParams(); - const content = useFilteredTrackGroup(albums); - useGlobalTrackListStatus(content.flatMap(group => group.tracks)); - - const queueOrigin = useMemo(() => { - return { type: 'album', albumID } satisfies QueueOrigin; - }, [albumID]); - - useFocusedAlbum(Route.useSearch().focused_album); - - const allArtistsAreSame = content.every( - group => group.tracks.every( - track => track.album_artist === content[0].tracks[0].album_artist - ) - ); - - return ( - group.tracks)}> - - - ); + const { albums, playlists } = Route.useLoaderData(); + const config = useSuspenseQuery(configQuery).data; + const { albumID } = Route.useParams(); + const content = useFilteredTrackGroup(albums); + useGlobalTrackListStatus(content.flatMap((group) => group.tracks)); + + const queueOrigin = useMemo(() => { + return { type: 'album', albumID } satisfies QueueOrigin; + }, [albumID]); + + useFocusedAlbum(Route.useSearch().focused_album); + + const allArtistsAreSame = content.every((group) => + group.tracks.every( + (track) => track.album_artist === content[0].tracks[0].album_artist, + ), + ); + + return ( + group.tracks)} + > + + + ); } diff --git a/src/routes/albums.tsx b/src/routes/albums.tsx index 014f2feb2..c8ed41d57 100644 --- a/src/routes/albums.tsx +++ b/src/routes/albums.tsx @@ -75,4 +75,4 @@ function ViewAlbums() { )} ); -} \ No newline at end of file +}