Merge remote-tracking branch 'origin/main'

This commit is contained in:
Core 2022-06-03 12:39:14 +01:00
commit de1ea918c8
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6
66 changed files with 4630 additions and 3210 deletions

View file

@ -55,6 +55,9 @@ export class AppEvents {
app.exit()
}
// Try limiting JS memory to 350MB.
app.commandLine.appendSwitch('js-flags', '--max-old-space-size=350');
// Expose GC
app.commandLine.appendSwitch('js-flags', '--expose_gc')

View file

@ -1,5 +1,5 @@
import {join} from "path";
import {app, BrowserWindow as bw, ipcMain, ShareMenu, shell} from "electron";
import {app, BrowserWindow as bw, ipcMain, ShareMenu, shell, screen} from "electron";
import * as windowStateKeeper from "electron-window-state";
import * as express from "express";
import * as getPort from "get-port";
@ -28,6 +28,7 @@ import * as os from "os";
import wallpaper from "wallpaper";
import * as AdmZip from "adm-zip";
/**
* @file Creates the BrowserWindow
* @author CiderCollective
@ -55,6 +56,7 @@ export class BrowserWindow {
"pages/library-songs",
"pages/library-albums",
"pages/library-artists",
"pages/library-recentlyadded",
"pages/browse",
"pages/groupings",
"pages/settings",
@ -81,11 +83,11 @@ export class BrowserWindow {
"pages/zoo",
"pages/plugin-renderer",
"pages/keybinds",
"pages/oobe",
"components/mediaitem-artwork",
"components/artwork-material",
"components/menu-panel",
"components/sidebar-playlist",
"components/spatial-properties",
"components/audio-settings",
"components/plugin-menu",
"components/audio-controls",
@ -118,6 +120,11 @@ export class BrowserWindow {
"components/inline-collection-list",
],
appRoutes: [
{
page: "library-recentlyadded",
component: `<cider-recentlyadded></cider-recentlyadded>`,
condition: "page == 'library-recentlyadded'"
},
{
page: "plugin-renderer",
component: `<plugin-renderer></plugin-renderer>`,
@ -479,7 +486,7 @@ export class BrowserWindow {
const impulseExternals = join(utils.getPath("externals"), "/impulses/")
const impulseFile = join(impulseExternals, req.params.file)
if(existsSync(impulseFile)) {
res.sendFile(impulseFile)
res.sendFile(impulseFile)
}else{
res.sendFile(join(utils.getPath('srcPath'), "./renderer/audio/impulses/" + req.params.file))
}
@ -738,15 +745,28 @@ export class BrowserWindow {
return json;
})
ipcMain.on("get-wallpaper", async (event) => {
ipcMain.on("get-wallpaper", async (event, args) => {
const wpPath: string = await wallpaper.get();
// get the wallpaper and encode it to base64 then return
const wpBase64: string = await readFileSync(wpPath, 'base64')
// add the data:image properties
const wpData: string = `data:image/png;base64,${wpBase64}`
const Jimp = require("jimp")
const img = await Jimp.read(wpPath)
const blurAmount = args.blurAmount ?? 256
if(blurAmount) {
img.blur(blurAmount)
}
const screens = await screen.getAllDisplays()
const width = screens.reduce((a, b) => a + b.size.width, 0)
const height = screens.reduce((a, b) => a + b.size.height, 0)
img.cover(width, height, Jimp.HORIZONTAL_ALIGN_LEFT | Jimp.VERTICAL_ALIGN_MIDDLE)
const result = await img.getBase64Async(Jimp.MIME_PNG)
event.returnValue = {
path: wpPath,
data: wpData
data: result,
res: {
width: width,
height: height
}
};
})
@ -1489,4 +1509,3 @@ export class BrowserWindow {
console.log('remote broadcasted')
}
}

View file

@ -13,7 +13,7 @@ export class Store {
"general": {
"close_button_hide": false,
"discordrpc": {
"enabled": false,
"enabled": true,
"client": "Cider",
"clear_on_pause": true,
"hide_buttons": false,
@ -87,14 +87,17 @@ export class Store {
"W"
],
"audioSettings": [
"CommandOrControl",
process.platform == "darwin" ? "Option" : "Shift",
"A"
],
"pluginMenu": [
"CommandOrControl",
process.platform == "darwin" ? "Option" : "Shift",
"P"
],
"castToDevices": [
"CommandOrControl",
process.platform == "darwin" ? "Option" : "Shift",
"C"
],

View file

@ -0,0 +1,67 @@
[
"pages/podcasts",
"pages/apple-account-settings",
"pages/library-songs",
"pages/library-albums",
"pages/library-artists",
"pages/browse",
"pages/groupings",
"pages/settings",
"pages/installed-themes",
"pages/listen_now",
"pages/radio",
"pages/home",
"pages/artist-feed",
"pages/cider-playlist",
"pages/playlist-inline",
"pages/recordLabel",
"pages/cider-multiroom",
"pages/collection-list",
"pages/apple-curator",
"pages/artist",
"pages/search",
"pages/about",
"pages/library-videos",
"pages/remote-pair",
"pages/themes-github",
"pages/plugins-github",
"pages/replay",
"pages/audiolabs",
"pages/zoo",
"pages/plugin-renderer",
"pages/keybinds",
"pages/oobe",
"components/mediaitem-artwork",
"components/artwork-material",
"components/menu-panel",
"components/sidebar-playlist",
"components/audio-settings",
"components/plugin-menu",
"components/audio-controls",
"components/audio-playbackrate",
"components/qrcode-modal",
"components/moreinfo-modal",
"components/equalizer",
"components/add-to-playlist",
"components/queue",
"components/mediaitem-scroller-horizontal",
"components/mediaitem-scroller-horizontal-large",
"components/mediaitem-scroller-horizontal-sp",
"components/mediaitem-scroller-horizontal-mvview",
"components/mediaitem-list-item",
"components/mediaitem-hrect",
"components/mediaitem-square",
"components/mediaitem-mvview",
"components/listennow-child",
"components/mediaitem-mvview-sp",
"components/animatedartwork-view",
"components/listitem-horizontal",
"components/lyrics-view",
"components/fullscreen",
"components/miniplayer",
"components/castmenu",
"components/airplay-modal",
"components/artist-chip",
"components/hello-world",
"components/inline-collection-list"
]

174
src/main/base/vrouting.json Normal file
View file

@ -0,0 +1,174 @@
[
{
"page": "plugin-renderer",
"component": "<plugin-renderer></plugin-renderer>",
"condition": "page == 'plugin-renderer'"
},
{
"page": "zoo",
"component": "<cider-zoo></cider-zoo>",
"condition": "page == 'zoo'"
},
{
"page": "podcasts",
"component": "<apple-podcasts></apple-podcasts>",
"condition": "page == 'podcasts'"
},
{
"page": "library-videos",
"component": "<cider-library-videos></cider-library-videos>",
"condition": "page == 'library-videos'"
},
{
"page": "apple-account-settings",
"component": "<apple-account-settings></apple-account-settings>",
"condition": "page == 'apple-account-settings'"
},
{
"page": "about",
"component": "<about-page></about-page>",
"condition": "page == 'about'"
},
{
"page": "cider-artist",
"component": "<cider-artist :data=\"artistPage.data\"></cider-artist>",
"condition": "page == 'artist-page' && artistPage.data.attributes"
},
{
"page": "collection-list",
"component": "<cider-collection-list :data=\"collectionList.response\" :type=\"collectionList.type\" :title=\"collectionList.title\"></cider-collection-list>",
"condition": "page == 'collection-list'"
},
{
"page": "home",
"component": "<cider-home></cider-home>",
"condition": "page == 'home'"
},
{
"page": "artist-feed",
"component": "<cider-artist-feed></cider-artist-feed>",
"condition": "page == 'artist-feed'"
},
{
"page": "playlist-inline",
"component": "<playlist-inline :data=\"showingPlaylist\"></playlist-inline>",
"condition": "modals.showPlaylist"
},
{
"page": "playlist_",
"component": "<cider-playlist :data=\"showingPlaylist\"></cider-playlist>",
"condition": "page.includes('playlist_')"
},
{
"page": "oobe",
"component": "<cider-oobe/>",
"condition": "page == 'oobe'"
},
{
"page": "album_",
"component": "<cider-playlist :data=\"showingPlaylist\"></cider-playlist>",
"condition": "page.includes('album_')"
},
{
"page": "recordLabel_",
"component": "<cider-recordlabel :data=\"showingPlaylist\"></cider-recordlabel>",
"condition": "page.includes('recordLabel_')"
},
{
"page": "multiroom",
"component": "<cider-multiroom :data=\"multiroom\"></cider-multiroom>",
"condition": "page.includes('multiroom')"
},
{
"page": "curator_",
"component": "<cider-recordlabel :data=\"showingPlaylist\"></cider-recordlabel>",
"condition": "page.includes('curator_')"
},
{
"page": "browsepage",
"component": "<cider-browse :data=\"browsepage\"></cider-browse>",
"condition": "page == 'browse'",
"onEnter": ""
},
{
"page": "groupings",
"component": "<cider-groupings :data=\"browsepage\"></cider-groupings>",
"condition": "page == 'groupings'",
"onEnter": ""
},
{
"page": "listen_now",
"component": "<cider-listen-now :data=\"listennow\"></cider-listen-now>",
"condition": "page == 'listen_now'",
"onEnter": ""
},
{
"page": "radio",
"component": "<cider-radio :data=\"radio\"></cider-radio>",
"condition": "page == 'radio'",
"onEnter": ""
},
{
"page": "settings",
"component": "<cider-settings></cider-settings>",
"condition": "page == 'settings'"
},
{
"page": "installed-themes",
"component": "<installed-themes></installed-themes>",
"condition": "page == 'installed-themes'"
},
{
"page": "search",
"component": "<cider-search :search=\"search\"></cider-search>",
"condition": "page == 'search'"
},
{
"page": "library-songs",
"component": "<cider-library-songs :data=\"library.songs\"></cider-library-songs>",
"condition": "page == 'library-songs'",
"onEnter": ""
},
{
"page": "library-albums",
"component": "<cider-library-albums :data=\"library.songs\"></cider-library-albums>",
"condition": "page == 'library-albums'",
"onEnter": ""
},
{
"page": "library-artists",
"component": "<cider-library-artists></cider-library-artists>",
"condition": "page == 'library-artists'",
"onEnter": ""
},
{
"page": "appleCurator",
"component": "<cider-applecurator :data=\"appleCurator\"></cider-applecurator>",
"condition": "page.includes('appleCurator')"
},
{
"page": "themes-github",
"component": "<themes-github></themes-github>",
"condition": "page == 'themes-github'"
},
{
"page": "plugins-github",
"component": "<plugins-github></plugins-github>",
"condition": "page == 'plugins-github'"
},
{
"page": "remote-pair",
"component": "<remote-pair></remote-pair>",
"condition": "page == 'remote-pair'"
},
{
"page": "audiolabs",
"component": "<audiolabs-page></audiolabs-page>",
"condition": "page == 'audiolabs'"
},
{
"page": "replay",
"component": "<replay-page></replay-page>",
"condition": "page == 'replay'"
}
]