mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 10:03:33 +00:00
Add ability to add/remove songs from playlist (#17)
* Add api for add/remove playlist items * Add playlistItemId property to normalized Song - This is used for Navidrome to delete songs from playlists * Add mutations for add/remove from playlist * Add context modal for playlist add * Add remove from playlist from context menu * Set jellyfin to use playlistItemId * Adjust font sizing * Add playlist add from detail pages * Bump mantine to v6-alpha.2
This commit is contained in:
parent
be39c2bc1f
commit
59f4f43e84
23 changed files with 1120 additions and 982 deletions
|
|
@ -2,6 +2,7 @@ import type { MouseEvent } from 'react';
|
|||
import React from 'react';
|
||||
import type { UnstyledButtonProps } from '@mantine/core';
|
||||
import { Group } from '@mantine/core';
|
||||
import { openContextModal } from '@mantine/modals';
|
||||
import { RiPlayFill, RiMore2Fill, RiHeartFill, RiHeartLine } from 'react-icons/ri';
|
||||
import styled from 'styled-components';
|
||||
import { _Button } from '/@/renderer/components/button';
|
||||
|
|
@ -137,6 +138,19 @@ export const CardControls = ({
|
|||
});
|
||||
};
|
||||
|
||||
const openAddToPlaylistModal = (e: MouseEvent<HTMLButtonElement>) => {
|
||||
e.stopPropagation();
|
||||
openContextModal({
|
||||
innerProps: {
|
||||
albumId: itemType === LibraryItem.ALBUM ? [itemData.id] : undefined,
|
||||
artistId: itemType === LibraryItem.ALBUM_ARTIST ? [itemData.id] : undefined,
|
||||
},
|
||||
modal: 'addToPlaylist',
|
||||
size: 'md',
|
||||
title: 'Add to playlist',
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<GridCardControlsContainer>
|
||||
<BottomControls>
|
||||
|
|
@ -190,8 +204,9 @@ export const CardControls = ({
|
|||
{type.label}
|
||||
</DropdownMenu.Item>
|
||||
))}
|
||||
<DropdownMenu.Item disabled>Add to playlist</DropdownMenu.Item>
|
||||
<DropdownMenu.Item disabled>Refresh metadata</DropdownMenu.Item>
|
||||
<DropdownMenu.Item onClick={openAddToPlaylistModal}>
|
||||
Add to playlist
|
||||
</DropdownMenu.Item>
|
||||
</DropdownMenu.Dropdown>
|
||||
</DropdownMenu>
|
||||
</Group>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue