mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-15 04:51:06 +02:00
Add remote control (#164)
* draft add remotes * add favorite, rating * add basic auth
This commit is contained in:
@@ -11,6 +11,9 @@ import {
|
||||
} from '/@/renderer/api/types';
|
||||
import { MutationHookArgs } from '/@/renderer/lib/react-query';
|
||||
import { getServerById, useSetAlbumListItemDataById, useSetQueueFavorite } from '/@/renderer/store';
|
||||
import isElectron from 'is-electron';
|
||||
|
||||
const remote = isElectron() ? window.electron.remote : null;
|
||||
|
||||
export const useCreateFavorite = (args: MutationHookArgs) => {
|
||||
const { options } = args || {};
|
||||
@@ -42,6 +45,7 @@ export const useCreateFavorite = (args: MutationHookArgs) => {
|
||||
}
|
||||
|
||||
if (variables.query.type === LibraryItem.SONG) {
|
||||
remote?.updateFavorite(true, serverId, variables.query.id);
|
||||
setQueueFavorite(variables.query.id, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user