added functionality to favorite a song. fixes #323

This commit is contained in:
2024-01-07 14:58:49 +01:00
parent 1d19857977
commit 5e82c18d8a
7 changed files with 25 additions and 0 deletions

View File

@@ -40,6 +40,9 @@ export const startExpress = (mainWindow: BrowserWindow) => {
if (settingsStore.get(settings.playBackControl)) {
expressApp.get("/play", (req, res) => handleGlobalEvent(res, globalEvents.play));
expressApp.post("/favorite/toggle", (req, res) =>
handleGlobalEvent(res, globalEvents.toggleFavorite)
);
expressApp.get("/pause", (req, res) => handleGlobalEvent(res, globalEvents.pause));
expressApp.get("/next", (req, res) => handleGlobalEvent(res, globalEvents.next));
expressApp.get("/previous", (req, res) => handleGlobalEvent(res, globalEvents.previous));

View File

@@ -11,6 +11,7 @@ export const mediaInfo = {
current: "",
duration: "",
image: "tidal-hifi-icon",
favorite: false,
};
export const updateMediaInfo = (arg: MediaInfo) => {
@@ -23,6 +24,7 @@ export const updateMediaInfo = (arg: MediaInfo) => {
mediaInfo.current = propOrDefault(arg.current);
mediaInfo.duration = propOrDefault(arg.duration);
mediaInfo.image = propOrDefault(arg.image);
mediaInfo.favorite = arg.favorite;
};
/**