mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 10:23:33 +00:00
Merge branch 'development' into navidrome-version
This commit is contained in:
commit
cc6cad1d70
32 changed files with 531 additions and 345 deletions
|
|
@ -522,7 +522,7 @@ export const ContextMenuProvider = ({ children }: ContextMenuProviderProps) => {
|
|||
|
||||
const handleUpdateRating = useCallback(
|
||||
(rating: number) => {
|
||||
if (!ctx.dataNodes || !ctx.data) return;
|
||||
if (!ctx.dataNodes && !ctx.data) return;
|
||||
|
||||
let uniqueServerIds: string[] = [];
|
||||
let items: AnyLibraryItems = [];
|
||||
|
|
|
|||
|
|
@ -89,8 +89,7 @@ export const PlayQueue = forwardRef(({ type }: QueueProps, ref: Ref<any>) => {
|
|||
|
||||
if (playbackType === PlaybackType.LOCAL) {
|
||||
mpvPlayer!.volume(volume);
|
||||
mpvPlayer!.setQueue(playerData);
|
||||
mpvPlayer!.play();
|
||||
mpvPlayer!.setQueue(playerData, false);
|
||||
}
|
||||
|
||||
play();
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ export const FullScreenPlayerImage = () => {
|
|||
const albumArtRes = useSettingsStore((store) => store.general.albumArtRes);
|
||||
|
||||
const { queue } = usePlayerData();
|
||||
const { opacity, useImageAspectRatio } = useFullScreenPlayerStore();
|
||||
const { useImageAspectRatio } = useFullScreenPlayerStore();
|
||||
const currentSong = queue.current;
|
||||
const { color: background } = useFastAverageColor({
|
||||
algorithm: 'dominant',
|
||||
|
|
@ -250,7 +250,6 @@ export const FullScreenPlayerImage = () => {
|
|||
<MetadataContainer
|
||||
className="full-screen-player-image-metadata"
|
||||
maw="100%"
|
||||
opacity={opacity}
|
||||
spacing="xs"
|
||||
>
|
||||
<TextTitle
|
||||
|
|
@ -278,7 +277,6 @@ export const FullScreenPlayerImage = () => {
|
|||
to={generatePath(AppRoute.LIBRARY_ALBUMS_DETAIL, {
|
||||
albumId: currentSong?.albumId || '',
|
||||
})}
|
||||
transform="uppercase"
|
||||
w="100%"
|
||||
weight={600}
|
||||
>
|
||||
|
|
@ -292,7 +290,6 @@ export const FullScreenPlayerImage = () => {
|
|||
style={{
|
||||
textShadow: 'var(--fullscreen-player-text-shadow)',
|
||||
}}
|
||||
transform="uppercase"
|
||||
>
|
||||
{index > 0 && (
|
||||
<Text
|
||||
|
|
@ -313,7 +310,6 @@ export const FullScreenPlayerImage = () => {
|
|||
to={generatePath(AppRoute.LIBRARY_ALBUM_ARTISTS_DETAIL, {
|
||||
albumArtistId: artist.id,
|
||||
})}
|
||||
transform="uppercase"
|
||||
weight={600}
|
||||
>
|
||||
{artist.name}
|
||||
|
|
|
|||
|
|
@ -42,11 +42,11 @@ const HeaderItemWrapper = styled.div`
|
|||
z-index: 2;
|
||||
`;
|
||||
|
||||
interface TransparendGridContainerProps {
|
||||
interface TransparentGridContainerProps {
|
||||
opacity: number;
|
||||
}
|
||||
|
||||
const GridContainer = styled.div<TransparendGridContainerProps>`
|
||||
const GridContainer = styled.div<TransparentGridContainerProps>`
|
||||
display: grid;
|
||||
grid-template-rows: auto minmax(0, 1fr);
|
||||
grid-template-columns: 1fr;
|
||||
|
|
@ -82,8 +82,6 @@ export const FullScreenPlayerQueue = () => {
|
|||
},
|
||||
];
|
||||
|
||||
console.log('opacity', opacity);
|
||||
|
||||
return (
|
||||
<GridContainer
|
||||
className="full-screen-player-queue-container"
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ const Controls = () => {
|
|||
defaultValue={opacity}
|
||||
label={(e) => `${e} %`}
|
||||
max={100}
|
||||
min={1}
|
||||
min={0}
|
||||
w="100%"
|
||||
onChangeEnd={(e) => setStore({ opacity: Number(e) })}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -175,8 +175,7 @@ export const useHandlePlayQueueAdd = () => {
|
|||
|
||||
if (playType === Play.NOW || !hadSong) {
|
||||
mpvPlayer!.pause();
|
||||
mpvPlayer!.setQueue(playerData);
|
||||
mpvPlayer!.play();
|
||||
mpvPlayer!.setQueue(playerData, false);
|
||||
} else {
|
||||
mpvPlayer!.setQueueNext(playerData);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import isElectron from 'is-electron';
|
|||
import { nanoid } from 'nanoid/non-secure';
|
||||
import { AuthenticationResponse, ServerType } from '/@/renderer/api/types';
|
||||
import { useAuthStoreActions } from '/@/renderer/store';
|
||||
import { ServerType, toServerType } from '/@/renderer/types';
|
||||
import { api } from '/@/renderer/api';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
|
|
@ -32,15 +33,27 @@ export const AddServerForm = ({ onCancel }: AddServerFormProps) => {
|
|||
const form = useForm({
|
||||
initialValues: {
|
||||
legacyAuth: false,
|
||||
name: '',
|
||||
name: (localSettings ? localSettings.env.SERVER_NAME : window.SERVER_NAME) ?? '',
|
||||
password: '',
|
||||
savePassword: false,
|
||||
type: ServerType.JELLYFIN,
|
||||
url: 'http://',
|
||||
type:
|
||||
(localSettings
|
||||
? localSettings.env.SERVER_TYPE
|
||||
: toServerType(window.SERVER_TYPE)) ?? ServerType.JELLYFIN,
|
||||
url: (localSettings ? localSettings.env.SERVER_URL : window.SERVER_URL) ?? 'https://',
|
||||
username: '',
|
||||
},
|
||||
});
|
||||
|
||||
// server lock for web is only true if lock is true *and* all other properties are set
|
||||
const serverLock =
|
||||
(localSettings
|
||||
? !!localSettings.env.SERVER_LOCK
|
||||
: !!window.SERVER_LOCK &&
|
||||
window.SERVER_TYPE &&
|
||||
window.SERVER_NAME &&
|
||||
window.SERVER_URL) || false;
|
||||
|
||||
const isSubmitDisabled = !form.values.name || !form.values.url || !form.values.username;
|
||||
|
||||
const handleSubmit = form.onSubmit(async (values) => {
|
||||
|
|
@ -61,7 +74,7 @@ export const AddServerForm = ({ onCancel }: AddServerFormProps) => {
|
|||
password: values.password,
|
||||
username: values.username,
|
||||
},
|
||||
values.type,
|
||||
values.type as ServerType,
|
||||
);
|
||||
|
||||
if (!data) {
|
||||
|
|
@ -75,7 +88,7 @@ export const AddServerForm = ({ onCancel }: AddServerFormProps) => {
|
|||
id: nanoid(),
|
||||
name: values.name,
|
||||
ndCredential: data.ndCredential,
|
||||
type: values.type,
|
||||
type: values.type as ServerType,
|
||||
url: values.url.replace(/\/$/, ''),
|
||||
userId: data.userId,
|
||||
username: data.username,
|
||||
|
|
@ -116,11 +129,13 @@ export const AddServerForm = ({ onCancel }: AddServerFormProps) => {
|
|||
>
|
||||
<SegmentedControl
|
||||
data={SERVER_TYPES}
|
||||
disabled={serverLock}
|
||||
{...form.getInputProps('type')}
|
||||
/>
|
||||
<Group grow>
|
||||
<TextInput
|
||||
data-autofocus
|
||||
disabled={serverLock}
|
||||
label={t('form.addServer.input', {
|
||||
context: 'name',
|
||||
postProcess: 'titleCase',
|
||||
|
|
@ -128,6 +143,7 @@ export const AddServerForm = ({ onCancel }: AddServerFormProps) => {
|
|||
{...form.getInputProps('name')}
|
||||
/>
|
||||
<TextInput
|
||||
disabled={serverLock}
|
||||
label={t('form.addServer.input', {
|
||||
context: 'url',
|
||||
postProcess: 'titleCase',
|
||||
|
|
|
|||
|
|
@ -131,6 +131,31 @@ export const WindowSettings = () => {
|
|||
isHidden: !isElectron(),
|
||||
title: t('setting.exitToTray', { postProcess: 'sentenceCase' }),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
aria-label="Toggle start in tray"
|
||||
defaultChecked={settings.startMinimized}
|
||||
disabled={!isElectron()}
|
||||
onChange={(e) => {
|
||||
if (!e) return;
|
||||
localSettings?.set('window_start_minimized', e.currentTarget.checked);
|
||||
setSettings({
|
||||
window: {
|
||||
...settings,
|
||||
startMinimized: e.currentTarget.checked,
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
),
|
||||
description: t('setting.startMinimized', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.startMinimized', { postProcess: 'sentenceCase' }),
|
||||
},
|
||||
];
|
||||
|
||||
return <SettingsSection options={windowOptions} />;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,9 @@ export const SidebarIcon = ({ active, route, size }: SidebarIconProps) => {
|
|||
case AppRoute.LIBRARY_ALBUMS:
|
||||
if (active) return <RiAlbumFill size={size} />;
|
||||
return <RiAlbumLine size={size} />;
|
||||
case AppRoute.LIBRARY_ALBUM_ARTISTS:
|
||||
if (active) return <RiUserVoiceFill size={size} />;
|
||||
return <RiUserVoiceLine size={size} />;
|
||||
case AppRoute.LIBRARY_ARTISTS:
|
||||
if (active) return <RiUserVoiceFill size={size} />;
|
||||
return <RiUserVoiceLine size={size} />;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue