mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2024-11-22 13:32:42 +01:00
last files transformed from js -> ts
This commit is contained in:
parent
53e4711c39
commit
d823f07ed8
@ -1,6 +1,4 @@
|
||||
const flags = {
|
||||
export const flags: { [key: string]: { flag: string; value?: any }[] } = {
|
||||
gpuRasterization: [{ flag: "enable-gpu-rasterization", value: undefined }],
|
||||
disableHardwareMediaKeys: [{ flag: "disable-features", value: "HardwareMediaKeyHandling" }],
|
||||
};
|
||||
|
||||
module.exports = flags;
|
@ -1,4 +1,4 @@
|
||||
const globalEvents = {
|
||||
export const globalEvents = {
|
||||
play: "play",
|
||||
pause: "pause",
|
||||
playPause: "playPause",
|
||||
@ -11,5 +11,3 @@ const globalEvents = {
|
||||
storeChanged: "storeChanged",
|
||||
error: "error",
|
||||
};
|
||||
|
||||
module.exports = globalEvents;
|
@ -1,9 +1,7 @@
|
||||
const globalEvents = require("./globalEvents");
|
||||
import { globalEvents } from "./globalEvents";
|
||||
|
||||
const mediaKeys = {
|
||||
export const mediaKeys = {
|
||||
MediaPlayPause: globalEvents.playPause,
|
||||
MediaNextTrack: globalEvents.next,
|
||||
MediaPreviousTrack: globalEvents.previous,
|
||||
};
|
||||
|
||||
module.exports = mediaKeys;
|
@ -1,4 +1,4 @@
|
||||
module.exports = {
|
||||
export const statuses = {
|
||||
playing: "playing",
|
||||
paused: "paused",
|
||||
};
|
@ -1,3 +1,3 @@
|
||||
module.exports = {
|
||||
export default {
|
||||
name: "tidal-hifi",
|
||||
};
|
12
src/main.ts
12
src/main.ts
@ -9,9 +9,9 @@ import {
|
||||
session,
|
||||
} from "electron";
|
||||
import path from "path";
|
||||
import flagValues from "./constants/flags";
|
||||
import globalEvents from "./constants/globalEvents";
|
||||
import mediaKeys from "./constants/mediaKeys";
|
||||
import { flags } from "./constants/flags";
|
||||
import { globalEvents } from "./constants/globalEvents";
|
||||
import { mediaKeys } from "./constants/mediaKeys";
|
||||
import { initRPC, rpc, unRPC } from "./scripts/discord";
|
||||
import { startExpress } from "./scripts/express";
|
||||
import { updateMediaInfo } from "./scripts/mediaInfo";
|
||||
@ -37,11 +37,11 @@ const PROTOCOL_PREFIX = "tidal";
|
||||
setFlags();
|
||||
|
||||
function setFlags() {
|
||||
const flags = settingsStore.get(settings.flags.root);
|
||||
if (flags) {
|
||||
const flagsFromSettings = settingsStore.get(settings.flags.root);
|
||||
if (flagsFromSettings) {
|
||||
for (const [key, value] of Object.entries(flags)) {
|
||||
if (value) {
|
||||
(flagValues as any)[key].forEach((flag: any) => {
|
||||
flags[key].forEach((flag) => {
|
||||
console.log(`enabling command line switch ${flag.flag} with value ${flag.value}`);
|
||||
app.commandLine.appendSwitch(flag.flag, flag.value);
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
import remote from "@electron/remote";
|
||||
import { ipcRenderer, shell } from "electron";
|
||||
import globalEvents from "../../constants/globalEvents";
|
||||
import { globalEvents } from "../../constants/globalEvents";
|
||||
import { settings } from "../../constants/settings";
|
||||
import { settingsStore } from "./../../scripts/settings";
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
import { Notification, app, dialog } from "@electron/remote";
|
||||
import { ipcRenderer } from "electron";
|
||||
import Player from "mpris-service";
|
||||
import globalEvents from "./constants/globalEvents";
|
||||
import { globalEvents } from "./constants/globalEvents";
|
||||
import { settings } from "./constants/settings";
|
||||
import statuses from "./constants/statuses";
|
||||
import { statuses } from "./constants/statuses";
|
||||
import { Options } from "./models/options";
|
||||
import { downloadFile } from "./scripts/download";
|
||||
import { addHotkey } from "./scripts/hotkeys";
|
||||
|
||||
import { setTitle } from "./scripts/window-functions";
|
||||
import { settingsStore } from "./scripts/settings";
|
||||
import { setTitle } from "./scripts/window-functions";
|
||||
const notificationPath = `${app.getPath("userData")}/notification.jpg`;
|
||||
const appName = "Tidal Hifi";
|
||||
let currentSong = "";
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Client } from "discord-rpc";
|
||||
import { app, ipcMain } from "electron";
|
||||
import globalEvents from "../constants/globalEvents";
|
||||
import { globalEvents } from "../constants/globalEvents";
|
||||
import { MediaStatus } from "../models/mediaStatus";
|
||||
import { mediaInfo } from "./mediaInfo";
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { BrowserWindow, dialog } from "electron";
|
||||
import express, { Response } from "express";
|
||||
import fs from "fs";
|
||||
import globalEvents from "./../constants/globalEvents";
|
||||
import statuses from "./../constants/statuses";
|
||||
import { globalEvents } from "./../constants/globalEvents";
|
||||
import { statuses } from "./../constants/statuses";
|
||||
import { mediaInfo } from "./mediaInfo";
|
||||
import { settingsStore } from "./settings";
|
||||
import { settings } from "../constants/settings";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MediaInfo } from "../models/mediaInfo";
|
||||
import statuses from "./../constants/statuses";
|
||||
import { statuses } from "./../constants/statuses";
|
||||
|
||||
export const mediaInfo = {
|
||||
title: "",
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { BrowserWindow, Menu, app } from "electron";
|
||||
const { showSettingsWindow } = require("./settings");
|
||||
import { showSettingsWindow } from "./settings";
|
||||
const isMac = process.platform === "darwin";
|
||||
const { name } = require("./../constants/values");
|
||||
import name from "./../constants/values";
|
||||
|
||||
const settingsMenuEntry = {
|
||||
label: "Settings",
|
||||
|
Loading…
Reference in New Issue
Block a user