Merge branch 'main' into enhancement/radio

This commit is contained in:
Core 2022-05-16 15:57:16 +01:00 committed by GitHub
commit eaae9ba457
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
103 changed files with 18529 additions and 23706 deletions

View file

@ -78,6 +78,7 @@ export class BrowserWindow {
"pages/audiolabs",
"pages/zoo",
"pages/plugin-renderer",
"pages/keybinds",
"components/mediaitem-artwork",
"components/artwork-material",
"components/menu-panel",
@ -342,6 +343,8 @@ export class BrowserWindow {
});
this.options.width = windowState.width;
this.options.height = windowState.height;
this.options.x = windowState.x;
this.options.y = windowState.y;
switch (process.platform) {
default:
@ -462,6 +465,16 @@ export class BrowserWindow {
}
})
app.get("/cideraudio/impulses/:file", (req, res) => {
const impulseExternals = join(utils.getPath("externals"), "/impulses/")
const impulseFile = join(impulseExternals, req.params.file)
if(existsSync(impulseFile)) {
res.sendFile(impulseFile)
}else{
res.sendFile(join(utils.getPath('srcPath'), "./renderer/audio/impulses/" + req.params.file))
}
})
app.get("/api/playback/:action", (req, res) => {
const action = req.params.action;
switch (action) {
@ -942,13 +955,23 @@ export class BrowserWindow {
switch (path) {
default:
case "plugins":
shell.openPath(utils.getPath("plugins"));
if (existsSync(utils.getPath("plugins"))) {
shell.openPath(utils.getPath("plugins"));
} else {
mkdirSync(utils.getPath("plugins"));
shell.openPath(utils.getPath("plugins"));
}
break;
case "userdata":
shell.openPath(app.getPath("userData"));
break;
case "themes":
shell.openPath(utils.getPath("themes"));
if (existsSync(utils.getPath("themes"))) {
shell.openPath(utils.getPath("themes"));
} else {
mkdirSync(utils.getPath("themes"));
shell.openPath(utils.getPath("themes"));
}
break;
}
});
@ -1060,6 +1083,11 @@ export class BrowserWindow {
BrowserWindow.win.setFullScreen(flag)
})
//Fullscreen
ipcMain.on('getFullScreen', (event, flag) => {
event.returnValue = BrowserWindow.win.isFullScreen()
})
//Fullscreen
ipcMain.on('detachDT', (_event, _) => {
BrowserWindow.win.webContents.openDevTools({mode: 'detach'});

View file

@ -17,6 +17,7 @@ export class Store {
"client": "Cider",
"clear_on_pause": true,
"hide_buttons": false,
"hide_timestamp": false,
"state_format": "by {artist}",
"details_format": "{title}",
},
@ -51,27 +52,39 @@ export class Store {
},
"keybindings": {
"search": [
process.platform == "darwin" ? "Command" : "Control",
"CommandOrControl",
"F"
],
"albums": [
process.platform == "darwin" ? "Command" : "Control",
"S"
],
"artists": [
process.platform == "darwin" ? "Command" : "Control",
"D"
"listnow": [
"CommandOrControl",
"L"
],
"browse": [
process.platform == "darwin" ? "Command" : "Control",
"CommandOrControl",
"B"
],
"recentAdd": [
"CommandOrControl",
"G"
],
"songs" : [
"CommandOrControl",
"J"
],
"albums": [
"CommandOrControl",
"A"
],
"artists": [
"CommandOrControl",
"D"
],
"togglePrivateSession": [
process.platform == "darwin" ? "Command" : "Control",
"CommandOrControl",
"P"
],
"webRemote": [
process.platform == "darwin" ? "Command" : "Control",
"CommandOrControl",
"W"
],
"audioSettings": [
@ -87,15 +100,16 @@ export class Store {
"C"
],
"settings": [
process.platform == "darwin" ? "Option" : "Shift",
"CommandOrControl", // Who the hell uses a different key for this? Fucking Option?
"S"
],
"openDeveloperTools": [
process.platform == "darwin" ? "Command" : "Control",
process.platform == "darwin" ? "Option" : "Shift",
"CommandOrControl",
"Shift",
"I"
]
}
},
"showLovedTracksInline": true
},
"home": {
"followedArtists": [],
@ -128,10 +142,10 @@ export class Store {
"maikiwiAudio": {
"ciderPPE": false,
"ciderPPE_value": "MAIKIWI",
"analogWarmth": false,
"analogWarmth_value": "SMOOTH",
"atmosphereRealizer": false,
"atmosphereRealizer_value": "NATURAL_STANDARD",
"atmosphereRealizer1": false,
"atmosphereRealizer1_value": "NATURAL_STANDARD",
"atmosphereRealizer2": false,
"atmosphereRealizer2_value": "NATURAL_STANDARD",
"spatial": false,
"spatialProfile": "71_420maikiwi",
"vibrantBass": { // Hard coded into the app. Don't include any of this config into exporting presets in store.ts

View file

@ -183,8 +183,8 @@ export default class DiscordRPC {
] //To change attributes.url => preload/cider-preload.js
}
// Add the timestamp if its playing
if (attributes.status) {
// Add the timestamp if its playing and people want them
if (!this._utils.getStoreValue("general.discordrpc.hide_timestamp") && attributes.status) {
activity.startTimestamp = Date.now() - (attributes?.durationInMillis - attributes?.remainingTime)
activity.endTimestamp = attributes.endTime
}

View file

@ -23,8 +23,9 @@ export default class Thumbar {
label: app.getName(),
submenu: [
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.about'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('about')`)
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.toggleprivate'),
accelerator: utils.getStoreValue("general.keybindings.togglePrivateSession").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.cfg.general.privateEnabled = !app.cfg.general.privateEnabled`)
},
{type: 'separator'},
{
@ -40,30 +41,63 @@ export default class Thumbar {
{role: 'hideOthers'},
{role: 'unhide'},
]: [
{type: 'separator'},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.about'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('about')`)
},
{type: 'separator'},
{role: 'quit', label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.quit')},
]),
],
},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.view'),
submenu: [
{role: 'reload', label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.reload')},
{role: 'forceReload', label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.forcereload')},
...(this.isMac ? [
{role: 'toggleDevTools'},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.search'),
accelerator: utils.getStoreValue("general.keybindings.search").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('search')`)
},
{type:'separator'},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.listennow'),
accelerator: utils.getStoreValue('general.keybindings.listnow').join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('listen_now')`)
},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.browse'),
accelerator: utils.getStoreValue("general.keybindings.browse").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('browse')`)
},
{type: 'separator'},
{role: 'resetZoom'},
{role: 'zoomIn'},
{role: 'zoomOut'},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.recentlyAdded')
,accelerator: utils.getStoreValue("general.keybindings.recentAdd").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('library-recentlyadded')`)
},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.songs'),
accelerator: utils.getStoreValue("general.keybindings.songs").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('library-songs')`)
},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.albums'),
accelerator: utils.getStoreValue("general.keybindings.albums").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('library-albums')`)
},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.artists'),
accelerator: utils.getStoreValue("general.keybindings.artists").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('library-artists')`)
},
{type: 'separator'},
{role: 'togglefullscreen'},
...(this.isMac ? [
]: []),
],
},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.window'),
submenu: [
@ -73,15 +107,24 @@ export default class Thumbar {
label: 'Show',
click: () => utils.getWindow().show()
},
{role: 'zoom'},
{role: 'toggleDevTools'},
{type: 'separator'},
{
label:'Zoom',
submenu: [
{role: 'zoom'},
{role: 'resetZoom'},
{role: 'zoomIn'},
{role: 'zoomOut'},
]
},
{type: 'separator'},
{role: 'togglefullscreen'},
{type: 'separator'},
{role: 'front'},
{role: 'close'},
{role: 'close'},
{role: 'close'},
{
label: 'Edit',
submenu: [
@ -93,33 +136,14 @@ export default class Thumbar {
{role: 'paste'},
]
},
] : []
),
{type: 'separator'},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.toggleprivate'),
accelerator: utils.getStoreValue("general.keybindings.togglePrivateSession").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.cfg.general.privateEnabled = !app.cfg.general.privateEnabled`)
},
{type: 'separator'},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.webremote'),
accelerator: utils.getStoreValue("general.keybindings.webRemote").join('+'),
sublabel: 'Opens in external window',
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('remote-pair')`)
},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.audio'),
accelerator: utils.getStoreValue("general.keybindings.audioSettings").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.modals.audioSettings = true`)
},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.plugins'),
accelerator: utils.getStoreValue("general.keybindings.pluginMenu").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.modals.pluginMenu = true`)
}
] : [
{type:'separator'},
{role: 'reload', label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.reload')},
{role: 'forceReload', label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.forcereload')},
]),
]
},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.controls'),
submenu: [
@ -148,35 +172,32 @@ export default class Thumbar {
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.volumedown'),
accelerator: 'CommandOrControl+Down',
click: () => utils.getWindow().webContents.executeJavaScript(`app.volumeDown()`)
},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.browse'),
accelerator: utils.getStoreValue("general.keybindings.browse").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('browse')`)
},
{type: 'separator'},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.artists'),
accelerator: utils.getStoreValue("general.keybindings.artists").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('library-artists')`)
},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.search'),
accelerator: utils.getStoreValue("general.keybindings.search").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('search')`)
},
{type: 'separator'},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.albums'),
accelerator: utils.getStoreValue("general.keybindings.albums").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('library-albums')`)
},
},
{type: 'separator'},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.cast'),
accelerator: utils.getStoreValue("general.keybindings.castToDevices").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.modals.castMenu = true`)
},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.webremote'),
accelerator: utils.getStoreValue("general.keybindings.webRemote").join('+'),
sublabel: 'Opens in external window',
click: () => utils.getWindow().webContents.executeJavaScript(`app.appRoute('remote-pair')`)
},
{type: 'separator'},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.audio'),
accelerator: utils.getStoreValue("general.keybindings.audioSettings").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.modals.audioSettings = true`)
},
{type: 'separator'},
{
label: utils.getLocale(utils.getStoreValue('general.language'), 'menubar.options.plugins'),
accelerator: utils.getStoreValue("general.keybindings.pluginMenu").join('+'),
click: () => utils.getWindow().webContents.executeJavaScript(`app.modals.pluginMenu = true`)
}
]
},
{