From 0459851b19fe3f363a2a0537d0e00e003cc5f583 Mon Sep 17 00:00:00 2001 From: cryptofyre Date: Mon, 26 Sep 2022 10:42:12 -0500 Subject: [PATCH] Add Steam Deck support. (#1467) * Merge main changes. (#1446) * localisation for mediaitem context menu * fixes removing songs issue #1442 * aids formatting no more * ok * stop [ci skip] * ci test * stop it * Prettified Code! * prettier update * chore: Prettified Code [ci skip] * shit * chore: Prettified Code [ci skip] * Update stale-issues.yml [ci skip] * Fix LastFM Filter Types * localisation for misc notifications * auto language on oobe * auto language on oobe * attempt at fixing #982 * and this just annoys me [ci skip] * crowdin action * oops * Remove from playlist icon * duplicate item prompt on adding songs to playlist * moved function outside to stop redefine [ci skip] * add playing class to album artwork * Play button for mediaitem-smarthints (#1445) Co-authored-by: Core Co-authored-by: coredev-uk Co-authored-by: yazninja Co-authored-by: Monochromish <79590499+Monochromish@users.noreply.github.com> * Add steam deck specific compile configuration. * Add SteamOS specific switches. * forgor a space * Updated config.yml * Updated config.yml * Updated config.yml * merge new changes into steam-deck branch (#1458) * localisation for mediaitem context menu * fixes removing songs issue #1442 * aids formatting no more * ok * stop [ci skip] * ci test * stop it * Prettified Code! * prettier update * chore: Prettified Code [ci skip] * shit * chore: Prettified Code [ci skip] * Update stale-issues.yml [ci skip] * Fix LastFM Filter Types * localisation for misc notifications * auto language on oobe * auto language on oobe * attempt at fixing #982 * and this just annoys me [ci skip] * crowdin action * oops * Remove from playlist icon * duplicate item prompt on adding songs to playlist * moved function outside to stop redefine [ci skip] * add playing class to album artwork * Play button for mediaitem-smarthints (#1445) * eslint moment * Update cider-chores.yml * some fixes * crowdin config * no * aa * please * please x2 * just to upload * Update Crowdin configuration file * fuck eslint * Source Update Workflow * Update crowdin translation image. * Implemented mediaSession API functions * Cleaned up playback function, commented mediaKeyFixes * Simplified wsapi renderer calls * Fix duration * Added check * Moved function call * More checks * autoplay persists on app launches * Fix [ci skip] * This is weird [ci skip] * version fix * Fix Co-authored-by: Core Co-authored-by: coredev-uk Co-authored-by: yazninja Co-authored-by: Monochromish <79590499+Monochromish@users.noreply.github.com> Co-authored-by: vapormusic * merge new changes (#1466) * localisation for mediaitem context menu * fixes removing songs issue #1442 * aids formatting no more * ok * stop [ci skip] * ci test * stop it * Prettified Code! * prettier update * chore: Prettified Code [ci skip] * shit * chore: Prettified Code [ci skip] * Update stale-issues.yml [ci skip] * Fix LastFM Filter Types * localisation for misc notifications * auto language on oobe * auto language on oobe * attempt at fixing #982 * and this just annoys me [ci skip] * crowdin action * oops * Remove from playlist icon * duplicate item prompt on adding songs to playlist * moved function outside to stop redefine [ci skip] * add playing class to album artwork * Play button for mediaitem-smarthints (#1445) * eslint moment * Update cider-chores.yml * some fixes * crowdin config * no * aa * please * please x2 * just to upload * Update Crowdin configuration file * fuck eslint * Source Update Workflow * Update crowdin translation image. * Implemented mediaSession API functions * Cleaned up playback function, commented mediaKeyFixes * Simplified wsapi renderer calls * Fix duration * Added check * Moved function call * More checks * autoplay persists on app launches * Fix [ci skip] * This is weird [ci skip] * version fix * Fix * aftermath of coding at 2am 200 days ago * Update config.yml [ci skip] * Small fix * Musickit error handling * chore: Updated i18n Source [ci skip] * Updated en_US.json to match cider 2 * chore: Updated i18n Source [ci skip] * plugins adjustment * chore: Prettified Code [ci skip] * Update config.yml * Stop music before close Co-authored-by: Core Co-authored-by: coredev-uk Co-authored-by: yazninja Co-authored-by: Monochromish <79590499+Monochromish@users.noreply.github.com> Co-authored-by: vapormusic Co-authored-by: Maikiwi Co-authored-by: booploops <49113086+booploops@users.noreply.github.com> Co-authored-by: booploops * reset this Co-authored-by: Core Co-authored-by: coredev-uk Co-authored-by: yazninja Co-authored-by: Monochromish <79590499+Monochromish@users.noreply.github.com> Co-authored-by: vapormusic Co-authored-by: Maikiwi Co-authored-by: booploops <49113086+booploops@users.noreply.github.com> Co-authored-by: booploops --- package.json | 1 + src/i18n/en_US.json | 1 + src/i18n/source/en_US.json | 1 + src/main/base/app.ts | 6 +++++ src/main/plugins/lastfm.ts | 3 +-- steam-deck.json | 45 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 steam-deck.json diff --git a/package.json b/package.json index 208b2d5c..8517a46d 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "winget": "npm run build && electron-builder --win -c winget.json", "msft": "npm run build && electron-builder -c msft-package.json", "mstest": "npm run build && electron-builder -c msft-test.json", + "steamdeck": "npm run build && electron-builder --linux -c steam-deck.json", "postinstall": "electron-builder install-app-deps", "format:check": "npx prettier --check \"src/**/*.{js,json,ts,less}\"", "format:write": "npx prettier --write \"src/**/*.{js,json,ts,less}\"" diff --git a/src/i18n/en_US.json b/src/i18n/en_US.json index a6be2f27..38267fe3 100644 --- a/src/i18n/en_US.json +++ b/src/i18n/en_US.json @@ -264,6 +264,7 @@ "action.removeFromQueue.success": "Removed from Queue", "action.removeFromQueue.error": "Error Removing from Queue", "action.createPlaylist": "Create a New Playlist", + "action.addToPlaylist.duplicate": "Item already exists in playlist. Do you want to continue?", "action.addToPlaylist": "Add to Playlist", "action.addToPlaylist.duplicate": "Item already exists in playlist. Do you want to continue?", "action.removeFromPlaylist": "Remove from Playlist", diff --git a/src/i18n/source/en_US.json b/src/i18n/source/en_US.json index a6be2f27..38267fe3 100644 --- a/src/i18n/source/en_US.json +++ b/src/i18n/source/en_US.json @@ -264,6 +264,7 @@ "action.removeFromQueue.success": "Removed from Queue", "action.removeFromQueue.error": "Error Removing from Queue", "action.createPlaylist": "Create a New Playlist", + "action.addToPlaylist.duplicate": "Item already exists in playlist. Do you want to continue?", "action.addToPlaylist": "Add to Playlist", "action.addToPlaylist.duplicate": "Item already exists in playlist. Do you want to continue?", "action.removeFromPlaylist": "Remove from Playlist", diff --git a/src/main/base/app.ts b/src/main/base/app.ts index f59c6788..7e2e0678 100644 --- a/src/main/base/app.ts +++ b/src/main/base/app.ts @@ -2,6 +2,7 @@ import { app, Menu, nativeImage, Tray, ipcMain, clipboard, shell } from "electro import { readFileSync } from "fs"; import * as path from "path"; import * as log from "electron-log"; +import * as os from "os"; import { utils } from "./utils"; /** @@ -92,6 +93,11 @@ export class AppEvents { if (process.platform === "linux") { app.commandLine.appendSwitch("disable-features", "MediaSessionService"); + + if (os.version().indexOf("SteamOS")) { + app.commandLine.appendSwitch("enable-features", "UseOzonePlatform"); + app.commandLine.appendSwitch("ozone-platform", "x11"); + } } /*********************************************************************************************************************** diff --git a/src/main/plugins/lastfm.ts b/src/main/plugins/lastfm.ts index 2c3f2613..b1e748fd 100644 --- a/src/main/plugins/lastfm.ts +++ b/src/main/plugins/lastfm.ts @@ -209,9 +209,8 @@ export default class lastfm { }); return; } - + if (!this._authenticated || !attributes || this._utils.getStoreValue("connectivity.lastfm.filter_types")[attributes.playParams.kind] || this._utils.getStoreValue("connectivity.lastfm.filter_types")[attributes.kind] || (this._utils.getStoreValue("connectivity.lastfm.filter_loop") && this._nowPlayingCache.track === attributes.lfmTrack.name)) return; - console.log(this._utils.getStoreValue("connectivity.lastfm.filter_types")); const nowPlaying = { diff --git a/steam-deck.json b/steam-deck.json new file mode 100644 index 00000000..8ded62b3 --- /dev/null +++ b/steam-deck.json @@ -0,0 +1,45 @@ +{ + "electronVersion": "18.3.12", + "electronDownload": { + "version": "18.3.12+wvcus", + "mirror": "https://github.com/castlabs/electron-releases/releases/download/v" + }, + "appId": "cider", + "protocols": [ + { + "name": "Cider", + "schemes": ["ame", "cider", "itms", "itmss", "musics", "music"] + } + ], + "extends": null, + "files": ["**/*", "./src/**/*", "./resources/icons/icon.*"], + "linux": { + "target": ["AppImage", "flatpak", "pacman"], + "synopsis": "A new look into listening and enjoying music in style and performance. ", + "category": "AudioVideo", + "icon": "cider", + "executableName": "cider" + }, + "appx": { + "applicationId": "CiderAlpha", + "publisher": "CN=CiderCollective, OID.2.25.311729368913984317654407730594956997722=1", + "displayName": "Cider", + "identityName": "CiderCollective.CiderAlpha", + "backgroundColor": "transparent", + "setBuildNumber": true + }, + "win": { + "target": ["appx"], + "icon": "resources/icons/icon.ico" + }, + "directories": { + "buildResources": ".", + "output": "dist" + }, + "mac": { + "icon": "./resources/icons/icon.icns", + "category": "public.app-category.music", + "entitlements": "resources/entitlements.mac.plist", + "darkModeSupport": true + } +}