Merge branch 'main' into stable

This commit is contained in:
Core 2022-08-27 17:37:59 +01:00
commit 7f0077b16e
No known key found for this signature in database
GPG key ID: 2AB8327FBA02D1C0
14 changed files with 10713 additions and 113 deletions

View file

@ -16,34 +16,28 @@ jobs:
steps: steps:
- checkout - checkout
- run: - run:
name: Install Build Dependencies
command: | command: |
sudo apt-get update -y sudo npm i -g pnpm
sudo apt-get install -y autoconf automake g++ libtool || true pnpm config set store-dir ~/.pnpm-store
- run: - run:
name: Update Version Number of App name: Fetch Application Version
command: sudo chmod +x resources/version.sh && ./resources/version.sh || true command: ./resources/version.sh || true
- restore_cache: - restore_cache:
name: Restore Yarn Package Cache key: dependency-cache-{{ checksum "pnpm-lock.yaml" }}
keys:
- yarn-packages-{{ checksum "cider.lock" }}
- run: - run:
name: Clear node_airtunes2 cache name: Clear node_airtunes2 cache
command: sudo rm -rf ~/.cache/yarn/v6/.tmp/cf5bc2de2629636ca224995234b8eaa1 || true command: rm -rf ~/.pnpm-store/tmp/cf5bc2de2629636ca224995234b8eaa1 || true
- run: - run:
name: Install Node Dependencies name: Install Node Dependencies
command: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn command: pnpm install --frozen-lockfile
- save_cache:
name: Save Yarn Package Cache
key: yarn-packages-{{ checksum "cider.lock" }}
paths:
- ~/.cache/yarn
- run:
name: Clear Yarn Cache
command: yarn cache clean
- run: - run:
name: TypeScript Compile name: TypeScript Compile
command: yarn build command: pnpm run build
- save_cache:
key: dependency-cache-{{ checksum "pnpm-lock.yaml" }}
paths:
- node_modules
- ~/.pnpm-store
- persist_to_workspace: - persist_to_workspace:
# Must be an absolute path, or relative path from working_directory. This is a directory on the container which is # Must be an absolute path, or relative path from working_directory. This is a directory on the container which is
# taken to be the root directory of the workspace. # taken to be the root directory of the workspace.
@ -54,16 +48,16 @@ jobs:
- node_modules - node_modules
- build - build
- resources - resources
- yarn.lock
- package.json - package.json
- winget.json # winget.json is a file that is generated by the winget package manager - winget.json # winget.json is a file that is generated by the winget package manager
- LICENSE - LICENSE
build-linux: build-linux:
executor: cider-ci docker:
- image: electronuserland/builder:wine
steps: steps:
- attach_workspace: - attach_workspace:
at: ~/Cider at: ~/project
- run: - run:
name: Generate Builds (Linux) name: Generate Builds (Linux)
command: yarn electron-builder -l -p never command: yarn electron-builder -l -p never
@ -145,11 +139,15 @@ jobs:
- run: - run:
name: Publish Release name: Publish Release
command: | command: |
echo "Attempting to create release for Cider v${APP_VERSION} on the ${CIRCLE_BRANCH} branch." echo "Attempting to create release for Cider v${APP_VERSION} on the ${CIRCLE_BRANCH} branch.";
gh release create "v${APP_VERSION}" --title "Cider Version ${APP_VERSION} (${CIRCLE_BRANCH})" --notes "**Beta Release** if [[ "${APP_VERSION}" = *"beta"* ]]; then
A full changelog is unavailable, but you can view the branch comparison [here](https://github.com/ciderapp/cider/compare/stable...main). echo $'**Beta Release**\nA full changelog is unavailable, but you can view the branch comparison [here](https://github.com/ciderapp/cider/compare/stable...main).\nThese builds are considered bleeding edge, expect bugs and please do not use this as a representation of the fu ll app.\nOur full support disclaimer can be found [here](https://docs.cider.sh/support/disclaimer#support-nightly-beta-releases).' > release-notes.md
These builds are considered bleeding edge, expect bugs and please do not use this as a representation of the full app. else
Our full support disclaimer can be found [here](https://docs.cider.sh/support/disclaimer#support-nightly-beta-releases)." -R ciderapp/cider-releases ~/Cider/dist/artifacts/*.deb ~/Cider/dist/artifacts/*.AppImage ~/Cider/dist/artifacts/*.snap ~/Cider/dist/artifacts/*.exe ~/Cider/dist/artifacts/*.yml ~/Cider/dist/artifacts/*.blockmap echo $'**Stable Release**\nA full changelog is unavailable, but you can view the branch comparison [here](https://github.com/ciderapp/cider/compare/stable...main).\nThese are the most stable builds we can provide. If you experience any issues, please report them [here](http s://github.com/ciderapp/cider/issues/new).\nOur full support disclaimer can be found [here](https://docs.cider.sh/support/disclaimer#support-releases).' > release-notes.md
fi;
gh release create "v${APP_VERSION}" --title "Cider Version ${APP_VERSION} (${CIRCLE_BRANCH})" --notes-file release-notes.md -R ciderapp/cider-releases ~/Cider/dist/artifacts/*.deb ~/Cider/dist/artifacts/*.AppImage ~/Cider/dist/artifacts/*.snap ~/Cider/dist/artifacts/*.exe ~/Cider/dist/artifacts/*.yml ~/Cider/dist/artifacts/*.blockmap
# Orchestrate our job run sequence # Orchestrate our job run sequence
workflows: workflows:

71
.github/workflows/cider-chore.yml vendored Normal file
View file

@ -0,0 +1,71 @@
name: Cider Chores
on:
push:
branches:
- main
jobs:
update-lockfile:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18 ]
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
- uses: pnpm/action-setup@v2.2.2
with:
version: 7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Update lockfile
run: pnpm i --lockfile-only
- name: Commit Updated Lockfile
uses: stefanzweifel/git-auto-commit-action@v4.14.1
with:
commit_message: "chore: Updated Lockfile"
commit_user_name: "cider-chore[bot]"
commit_user_email: "cider-chore[bot]@users.noreply.github.com"
prettier:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18 ]
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
- name: Prettify code
run: npm run prettier
- name: Commit Prettier Code
uses: stefanzweifel/git-auto-commit-action@v4.14.1
with:
commit_message: "chore: Prettified Code\n [ci skip]"
commit_user_name: "cider-chore[bot]"
commit_user_email: "cider-chore[bot]@users.noreply.github.com"

View file

@ -1,30 +0,0 @@
name: Continuous Integration (Prettier)
on:
push:
branches:
- main
jobs:
prettier:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
- name: Prettify code
run: npm run prettier
- name: Commit Prettier Code
uses: stefanzweifel/git-auto-commit-action@v4.14.1
with:
commit_message: "chore: Prettified Code\n [ci skip]"
commit_user_name: "cider-chore[bot]"
commit_user_email: "cider-chore[bot]@users.noreply.github.com"

3
.gitignore vendored
View file

@ -147,9 +147,6 @@ dist
!.yarn/sdks !.yarn/sdks
!.yarn/versions !.yarn/versions
# pnpm
pnpm-lock.yaml
## JetBrains GitIgnore ## ## JetBrains GitIgnore ##
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider

5
.npmrc
View file

@ -1,4 +1,5 @@
strict-peer-dependencies=false
node-linker=hoisted node-linker=hoisted
public-hoist-pattern=* public-hoist-pattern=*
hamefully-hoist = true shamefully-hoist=true
auto-install-peers=true
strict-peer-dependencies=false

View file

@ -1,3 +0,0 @@
files:
- source: /src/i18n/source/
translation: /src/i18n/%locale_with_underscore%.json

View file

@ -14,26 +14,25 @@
"homepage": "https://cider.sh/", "homepage": "https://cider.sh/",
"buildResources": "resources", "buildResources": "resources",
"scripts": { "scripts": {
"build": "tsc && yarn compile-less", "build": "tsc && npm run compile-less",
"compile-less": "lessc ./src/renderer/style.less ./src/renderer/style.css", "compile-less": "lessc ./src/renderer/style.less ./src/renderer/style.css",
"watch": "tsc --watch",
"start": "run-script-os", "start": "run-script-os",
"start:win32": "yarn build && set ELECTRON_ENABLE_LOGGING=true && electron ./build/index.js --enable-accelerated-mjpeg-decode --enable-accelerated-video --disable-gpu-driver-bug-workarounds --ignore-gpu-blacklist --enable-native-gpu-memory-buffers", "start:win32": "npm run build && set ELECTRON_ENABLE_LOGGING=true && electron ./build/index.js --enable-accelerated-mjpeg-decode --enable-accelerated-video --disable-gpu-driver-bug-workarounds --ignore-gpu-blacklist --enable-native-gpu-memory-buffers",
"start:linux": "yarn build && ELECTRON_ENABLE_LOGGING=true && electron ./build/index.js --enable-accelerated-mjpeg-decode --enable-accelerated-video --disable-gpu-driver-bug-workarounds --ignore-gpu-blacklist --enable-native-gpu-memory-buffers", "start:linux": "npm run build && ELECTRON_ENABLE_LOGGING=true && electron ./build/index.js --enable-accelerated-mjpeg-decode --enable-accelerated-video --disable-gpu-driver-bug-workarounds --ignore-gpu-blacklist --enable-native-gpu-memory-buffers",
"start:darwin": "yarn build && ELECTRON_ENABLE_LOGGING=true && electron ./build/index.js --enable-accelerated-mjpeg-decode --enable-accelerated-video --disable-gpu-driver-bug-workarounds --ignore-gpu-blacklist --enable-native-gpu-memory-buffers", "start:darwin": "npm run build && ELECTRON_ENABLE_LOGGING=true && electron ./build/index.js --enable-accelerated-mjpeg-decode --enable-accelerated-video --disable-gpu-driver-bug-workarounds --ignore-gpu-blacklist --enable-native-gpu-memory-buffers",
"start-renderer": "run-script-os", "start-renderer": "run-script-os",
"start-renderer:win32": "set ELECTRON_ENABLE_LOGGING=true && electron ./build/index.js --enable-accelerated-mjpeg-decode --enable-accelerated-video --disable-gpu-driver-bug-workarounds --ignore-gpu-blacklist --enable-native-gpu-memory-buffers", "start-renderer:win32": "set ELECTRON_ENABLE_LOGGING=true && electron ./build/index.js --enable-accelerated-mjpeg-decode --enable-accelerated-video --disable-gpu-driver-bug-workarounds --ignore-gpu-blacklist --enable-native-gpu-memory-buffers",
"start-renderer:linux": "ELECTRON_ENABLE_LOGGING=true && electron ./build/index.js --enable-accelerated-mjpeg-decode --enable-accelerated-video --disable-gpu-driver-bug-workarounds --ignore-gpu-blacklist --enable-native-gpu-memory-buffers", "start-renderer:linux": "ELECTRON_ENABLE_LOGGING=true && electron ./build/index.js --enable-accelerated-mjpeg-decode --enable-accelerated-video --disable-gpu-driver-bug-workarounds --ignore-gpu-blacklist --enable-native-gpu-memory-buffers",
"start-renderer:darwin": "ELECTRON_ENABLE_LOGGING=true && electron ./build/index.js --enable-accelerated-mjpeg-decode --enable-accelerated-video --disable-gpu-driver-bug-workarounds --ignore-gpu-blacklist --enable-native-gpu-memory-buffers", "start-renderer:darwin": "ELECTRON_ENABLE_LOGGING=true && electron ./build/index.js --enable-accelerated-mjpeg-decode --enable-accelerated-video --disable-gpu-driver-bug-workarounds --ignore-gpu-blacklist --enable-native-gpu-memory-buffers",
"pack": "electron-builder --dir", "pack": "electron-builder --dir",
"dist": "yarn build && electron-builder", "dist": "npm run build && electron-builder",
"dist:macarm": "yarn build && electron-builder --mac --arm64", "dist:macarm": "npm run build && electron-builder --mac --arm64",
"dist:universalNotWorking": "yarn build && electron-builder --mac --universal", "dist:universalNotWorking": "npm run build && electron-builder --mac --universal",
"dist:all": "yarn build && electron-builder -mwl", "dist:all": "npm run build && electron-builder -mwl",
"testdist": "yarn build && electron-builder --dir", "testdist": "npm run build && electron-builder --dir",
"winget": "yarn build && electron-builder --win -c winget.json", "winget": "npm run build && electron-builder --win -c winget.json",
"msft": "yarn build && electron-builder -c msft-package.json", "msft": "npm run build && electron-builder -c msft-package.json",
"mstest": "yarn build && electron-builder -c msft-test.json", "mstest": "npm run build && electron-builder -c msft-test.json",
"postinstall": "electron-builder install-app-deps", "postinstall": "electron-builder install-app-deps",
"prettier": "npx prettier --write '**/*.{js,json,ts,css,less}'" "prettier": "npx prettier --write '**/*.{js,json,ts,css,less}'"
}, },
@ -86,8 +85,9 @@
"@types/express": "^4.17.13", "@types/express": "^4.17.13",
"@types/qrcode-terminal": "^0.12.0", "@types/qrcode-terminal": "^0.12.0",
"@types/ws": "^8.5.3", "@types/ws": "^8.5.3",
"electron": "git+https://github.com/castlabs/electron-releases.git#20-x-y", "@types/node": "^18.7.13",
"electron-builder": "^23.3.3", "electron": "git+https://github.com/castlabs/electron-releases.git",
"electron-builder": "^23.0.2",
"electron-builder-notarize-pkg": "^1.2.0", "electron-builder-notarize-pkg": "^1.2.0",
"electron-webpack": "^2.8.2", "electron-webpack": "^2.8.2",
"less": "^4.1.3", "less": "^4.1.3",
@ -119,9 +119,9 @@
} }
], ],
"build": { "build": {
"electronVersion": "18.3.9", "electronVersion": "20.1.0",
"electronDownload": { "electronDownload": {
"version": "18.3.9+wvcus", "version": "20.1.0+wvcus",
"mirror": "https://github.com/castlabs/electron-releases/releases/download/v" "mirror": "https://github.com/castlabs/electron-releases/releases/download/v"
}, },
"appId": "cider", "appId": "cider",

10561
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -317,7 +317,7 @@
"menubar.options.toggledevtools": "Toggwe Devewopew Toows", "menubar.options.toggledevtools": "Toggwe Devewopew Toows",
"menubar.options.window": "Window", "menubar.options.window": "Window",
"menubar.options.minimize": "Minyimize", "menubar.options.minimize": "Minyimize",
"menubar.options.plugins": "Pwu-gins Menyu", "menubar.options.plugins": "Pwugins Menyu",
"menubar.options.controls": "Contwows", "menubar.options.controls": "Contwows",
"menubar.options.volumeup": "Vowume Up", "menubar.options.volumeup": "Vowume Up",
"menubar.options.volumedown": "Vowume Down", "menubar.options.volumedown": "Vowume Down",
@ -361,6 +361,8 @@
"settings.prompt.general.keybindings.update.success": "Keybind updated successfuwwy. Pwess OK to wewaunch Cidew", "settings.prompt.general.keybindings.update.success": "Keybind updated successfuwwy. Pwess OK to wewaunch Cidew",
"settings.option.general.themeUpdateNotification": "Automaticawwy check fow theme updates", "settings.option.general.themeUpdateNotification": "Automaticawwy check fow theme updates",
"settings.option.general.showLovedTracksInline": "Show wuvd twacks inwinye", "settings.option.general.showLovedTracksInline": "Show wuvd twacks inwinye",
"settings.option.general.pagination": "Items to show pew page",
"settings.options.general.pagination.description": "This detewminyes how many songs/awbums to show inyitiawwy fow infinyite scwowwing, ow how many songs/awbums to show fow a singwe page",
"settings.description.search": "Seawch", "settings.description.search": "Seawch",
"settings.description.albums": "Wibwawy Awbums", "settings.description.albums": "Wibwawy Awbums",
"settings.description.artists": "Wibwawy Awtists", "settings.description.artists": "Wibwawy Awtists",
@ -593,7 +595,7 @@
"settings.header.unfinished": "Unfinyished", "settings.header.unfinished": "Unfinyished",
"remote.web.title": "Cidew Wemote", "remote.web.title": "Cidew Wemote",
"remote.web.description": "Scan the QW code to paiw youw phonye up with this Cidew instance", "remote.web.description": "Scan the QW code to paiw youw phonye up with this Cidew instance",
"share.platform.twitter.tweet": "Wisten to {{song}} on Appwe Music.\n\n{{song}}\n\n#AppweMusic #Cidew", "share.platform.twitter.tweet": "Wisten to {{song}} on Appwe Music.\n\n{{url}}\n\n#AppweMusic #Cidew",
"share.platform.twitter": "Twittew", "share.platform.twitter": "Twittew",
"share.platform.facebook": "Facebook", "share.platform.facebook": "Facebook",
"share.platform.reddit": "Weddit", "share.platform.reddit": "Weddit",
@ -613,9 +615,9 @@
"oobe.amupsell.text": "Cidew wequiwes an active, paid Appwe Music subscwiption\nCidew wiww nyot wowk with Appwe Music Voice Pwan ow some pwomotionyaw twiaw subscwiptions. If you awweady have a quawified Appwe Music subscwiption cwick Nyext to continyue.", "oobe.amupsell.text": "Cidew wequiwes an active, paid Appwe Music subscwiption\nCidew wiww nyot wowk with Appwe Music Voice Pwan ow some pwomotionyaw twiaw subscwiptions. If you awweady have a quawified Appwe Music subscwiption cwick Nyext to continyue.",
"oobe.amupsell.subscribeBtn": "Subscwibe to Appwe Music", "oobe.amupsell.subscribeBtn": "Subscwibe to Appwe Music",
"oobe.amupsell.explainBtn": "Expwain", "oobe.amupsell.explainBtn": "Expwain",
"oobe.amupsell.subscribeUrl": "https://appwe.co/3MdqJVQ", "oobe.amupsell.subscribeUrl": "https://apple.co/3MdqJVQ",
"oobe.amupsell.amWebUrl": "https://beta.music.appwe.com/", "oobe.amupsell.amWebUrl": "https://beta.music.apple.com/",
"oobe.amupsell.promoExplained": "Some pwomotionyaw and nyon US Appwe Music twiaw subscwiptions do nyot have access to the wequiwed Appwe Music Web Pwayew API's nyeeded fow Cidew to function. To vewify if youw active twiaw wiww wowk with Cidew go to <a hwef='{{ amWebUrl }}'>{{ amWebUrl }}</a> log in and try to play some music. If it works, great! You're ready to use Cider, however if it does not consider subscribing to Apple Music here: <a href='{{ subscribeUrl }}'>{{ subscribeUrl }}</a>", "oobe.amupsell.promoExplained": "Some pwomotionyaw and nyon US Appwe Music twiaw subscwiptions do nyot have access to the wequiwed Appwe Music Web Pwayew API's nyeeded fow Cidew to function. To vewify if youw active twiaw wiww wowk with Cidew go to <a href='{{ amWebUrl }}'>{{ amWebUrl }}</a> wog in and twy to pway some music. If it wowks, gweat! You'we weady to use Cidew, howevew if it does nyot considew subscwibing to Appwe Music hewe: <a href='{{ subscribeUrl }}'>{{ subscribeUrl }}</a>",
"oobe.intro.title": "Wewcome to Cidew", "oobe.intro.title": "Wewcome to Cidew",
"oobe.intro.subtitle": "", "oobe.intro.subtitle": "",
"oobe.intro.text": "Wet's get a few things set up so you can use Cidew, how you'd wike. You can awways change these settings watew.", "oobe.intro.text": "Wet's get a few things set up so you can use Cidew, how you'd wike. You can awways change these settings watew.",
@ -630,17 +632,5 @@
"oobe.visual.subtitle": "", "oobe.visual.subtitle": "",
"oobe.visual.text": "", "oobe.visual.text": "",
"oobe.visual.layout.text": "Cidew featuwes two window diffewent wayouts.\nMavewick is an iTunyes wike wayout with the pwayew at the top of the window.\nMojave is a nyew spin cweated by the Cidew Cowwective.\n\nYou can change the wayout any time in the settings.", "oobe.visual.layout.text": "Cidew featuwes two window diffewent wayouts.\nMavewick is an iTunyes wike wayout with the pwayew at the top of the window.\nMojave is a nyew spin cweated by the Cidew Cowwective.\n\nYou can change the wayout any time in the settings.",
"oobe.visual.suggestingThemes": "Theming is a gweat way to pewsonyawize youw expewience. Hewe awe a few we suggest: ",
"oobe.visual.suggestingThemes.subtext": "(These themes wiww be downwoaded fwom GitHub)",
"oobe.visual.suggestingThemes.default": "Cidew",
"oobe.visual.suggestingThemes.default.text": "The cwassic Cidew theme.",
"oobe.visual.suggestingThemes.dark": "Dawk",
"oobe.visual.suggestingThemes.dark.text": "Dawknyess.",
"oobe.visual.suggestingThemes.community1": "Gwoovy",
"oobe.visual.suggestingThemes.community1.text": "A WinUI infwuenced theme",
"oobe.visual.suggestingThemes.community2": "iTheme",
"oobe.visual.suggestingThemes.community2.text": "The cwassic big fwuit wayout.",
"oobe.visual.suggestingThemes.community3": "Dwacuwa",
"oobe.visual.suggestingThemes.community3.text": "The iconyic Dwacuwa cowow scheme.",
"oobe.amsignin.title": "" "oobe.amsignin.title": ""
} }

View file

@ -81,7 +81,7 @@ export class Store {
scrobble_after: 50, scrobble_after: 50,
filter_loop: false, filter_loop: false,
filter_types: {}, filter_types: {},
remove_featured: false, remove_featured: true,
secrets: { secrets: {
username: "", username: "",
key: "", key: "",

View file

@ -15,7 +15,6 @@ export default class lastfm {
*/ */
private _lfm: any = null; private _lfm: any = null;
private _authenticated: boolean = false; private _authenticated: boolean = false;
private _scrobbleDelay: any = null;
private _utils: any = null; private _utils: any = null;
private _scrobbleCache: any = {}; private _scrobbleCache: any = {};
private _nowPlayingCache: any = {}; private _nowPlayingCache: any = {};
@ -130,12 +129,16 @@ export default class lastfm {
this._lfm.album.getInfo( this._lfm.album.getInfo(
{ {
artist: attributes.primaryArtist, artist: attributes.primaryArtist,
album: attributes.albumName, album: attributes.albumName.replace(/ - Single| - EP/g, ""),
}, },
(err: any, data: any) => { (err: any, data: any) => {
if (err) { if (err) {
console.error(`[${lastfm.name}] [album.getInfo] Error: ${typeof err === "string" ? err : err.message}`); console.error(`[${lastfm.name}] [album.getInfo] Error: ${typeof err === "string" ? err : err.message}`);
return {}; attributes.lfmAlbum = {
name: attributes.albumName.replace(/ - Single| - EP/g, ""),
artist: attributes.primaryArtist,
};
callback(attributes);
} }
if (data) { if (data) {
attributes.lfmAlbum = data; attributes.lfmAlbum = data;
@ -147,7 +150,13 @@ export default class lastfm {
this._lfm.track.getCorrection(attributes.primaryArtist, attributes.name, (err: any, data: any) => { this._lfm.track.getCorrection(attributes.primaryArtist, attributes.name, (err: any, data: any) => {
if (err) { if (err) {
console.error(`[${lastfm.name}] [track.getCorrection] Error: ${typeof err === "string" ? err : err.message}`); console.error(`[${lastfm.name}] [track.getCorrection] Error: ${typeof err === "string" ? err : err.message}`);
return {}; attributes.lfmTrack = {
name: attributes.name,
artist: {
name: attributes.primaryArtist,
},
};
callback(attributes);
} }
if (data) { if (data) {
attributes.lfmTrack = data.correction.track; attributes.lfmTrack = data.correction.track;

View file

@ -57,8 +57,6 @@ export default class playbackNotifications {
</toast>`, </toast>`,
}); });
console.log(this._notification.toastXml);
this._notification.on("click", (_: any) => { this._notification.on("click", (_: any) => {
this._utils.getWindow().show(); this._utils.getWindow().show();
this._utils.getWindow().focus(); this._utils.getWindow().focus();
@ -102,9 +100,11 @@ export default class playbackNotifications {
console.log(join(app.getPath("temp"), `${a.songId}-${a.artwork.url.split("/").pop()}`)); console.log(join(app.getPath("temp"), `${a.songId}-${a.artwork.url.split("/").pop()}`));
const dest = createWriteStream(join(app.getPath("temp"), `${a.songId}-${a.artwork.url.split("/").pop()}`)); const dest = createWriteStream(join(app.getPath("temp"), `${a.songId}-${a.artwork.url.split("/").pop()}`));
// @ts-ignore // @ts-ignore
res.body.pipe(dest); let stream = res.body.pipe(dest);
stream.on("finish", () => {
this.createNotification(a); this.createNotification(a);
}); });
});
} else { } else {
fetch(a.artwork.url).then(async (blob) => { fetch(a.artwork.url).then(async (blob) => {
this._artworkImage[a.artwork.url] = nativeImage.createFromBuffer(Buffer.from(await blob.arrayBuffer())); this._artworkImage[a.artwork.url] = nativeImage.createFromBuffer(Buffer.from(await blob.arrayBuffer()));

View file

@ -210,7 +210,7 @@ export default class RAOP {
this.portairplay = ipport; this.portairplay = ipport;
this.device = this.airtunes.add(ipv4, { this.device = this.airtunes.add(ipv4, {
port: ipport, port: ipport,
volume: 50, volume: airplay2dv ? 30 : 50,
password: sepassword, password: sepassword,
txt: txt, txt: txt,
airplay2: airplay2dv, airplay2: airplay2dv,
@ -262,6 +262,12 @@ export default class RAOP {
} }
}); });
electron.ipcMain.on("setAirPlayVolume", (event, volume) => {
if (this.device) {
this.device.setVolume(volume);
}
});
electron.ipcMain.on("writeWAV", (event, leftbuffer, rightbuffer) => { electron.ipcMain.on("writeWAV", (event, leftbuffer, rightbuffer) => {
if (this.airtunes != null) { if (this.airtunes != null) {
if (this.worker == null) { if (this.worker == null) {

View file

@ -1,7 +1,7 @@
{ {
"electronVersion": "18.3.9", "electronVersion": "20.1.0",
"electronDownload": { "electronDownload": {
"version": "18.3.9+wvcus", "version": "20.1.0+wvcus",
"mirror": "https://github.com/castlabs/electron-releases/releases/download/v" "mirror": "https://github.com/castlabs/electron-releases/releases/download/v"
}, },
"appId": "cider", "appId": "cider",