From 8fb097e69a271435376546723650c543c3666f4a Mon Sep 17 00:00:00 2001 From: yazninja <71800112+yazninja@users.noreply.github.com> Date: Sat, 3 Sep 2022 11:21:14 +0800 Subject: [PATCH 01/11] Add GET for syncing with bot --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1aa3c3e2..79c618e3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -143,9 +143,11 @@ jobs: if [[ "${APP_VERSION}" = *"beta"* ]]; then 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 gh release create "v${APP_VERSION}" --prerelease --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 + curl http://129.146.42.180/api/v1/github/sync/main else 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](https://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 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 + curl http://129.146.42.180/api/v1/github/sync/stable fi; # Orchestrate our job run sequence From 9d9158b409fbad8ce337f72f98e165371c512330 Mon Sep 17 00:00:00 2001 From: yazninja <71800112+yazninja@users.noreply.github.com> Date: Sat, 3 Sep 2022 11:29:20 +0800 Subject: [PATCH 02/11] Update build-macos.yml --- .github/workflows/build-macos.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 84d25b91..03cba7ad 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -125,3 +125,7 @@ jobs: repo_token: ${{ secrets.RELEASE_TOKEN }} file: dist/Cider-${{ env.APP_VERSION }}-universal.pkg tag: v${{ env.APP_VERSION }} + - name: Trigger Bot Sync + uses: indiesdev/curl@v1.1 + with: + url: http://129.146.42.180/api/v1/github/sync/${{ GITHUB_REF##*/ }} From 4228656f2420cc791183260c29da0b6b25a003a3 Mon Sep 17 00:00:00 2001 From: yazninja <71800112+yazninja@users.noreply.github.com> Date: Sat, 3 Sep 2022 11:30:48 +0800 Subject: [PATCH 03/11] Update build-macos.yml --- .github/workflows/build-macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 03cba7ad..41398db7 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -128,4 +128,4 @@ jobs: - name: Trigger Bot Sync uses: indiesdev/curl@v1.1 with: - url: http://129.146.42.180/api/v1/github/sync/${{ GITHUB_REF##*/ }} + url: http://129.146.42.180/api/v1/github/sync/${GITHUB_REF##*/} From 60ae73ce89055393e4b4fc7ae3fa32efb7dd97f5 Mon Sep 17 00:00:00 2001 From: yazninja <71800112+yazninja@users.noreply.github.com> Date: Sat, 3 Sep 2022 12:14:44 +0800 Subject: [PATCH 04/11] Update build-macos.yml --- .github/workflows/build-macos.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 41398db7..9117e9d0 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -129,3 +129,4 @@ jobs: uses: indiesdev/curl@v1.1 with: url: http://129.146.42.180/api/v1/github/sync/${GITHUB_REF##*/} + log-response: true From 70ec3a19a6a793521bdf7b5ebacdf5bd82315f53 Mon Sep 17 00:00:00 2001 From: yazninja <71800112+yazninja@users.noreply.github.com> Date: Sat, 3 Sep 2022 12:43:07 +0800 Subject: [PATCH 05/11] Update build-macos.yml --- .github/workflows/build-macos.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 9117e9d0..c5d1bfe3 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -130,3 +130,4 @@ jobs: with: url: http://129.146.42.180/api/v1/github/sync/${GITHUB_REF##*/} log-response: true + timeout: 60000 From 54400c1e8b755ed120c99a285165b3cd87c2163f Mon Sep 17 00:00:00 2001 From: yazninja <71800112+yazninja@users.noreply.github.com> Date: Sat, 3 Sep 2022 13:14:43 +0800 Subject: [PATCH 06/11] Update build-macos.yml --- .github/workflows/build-macos.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index c5d1bfe3..85f58991 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -125,9 +125,16 @@ jobs: repo_token: ${{ secrets.RELEASE_TOKEN }} file: dist/Cider-${{ env.APP_VERSION }}-universal.pkg tag: v${{ env.APP_VERSION }} - - name: Trigger Bot Sync + - name: Trigger Bot Sync (main) uses: indiesdev/curl@v1.1 with: - url: http://129.146.42.180/api/v1/github/sync/${GITHUB_REF##*/} + url: http://129.146.42.180/api/v1/github/sync/main log-response: true timeout: 60000 + - name: Trigger Bot Sync (stable) + uses: indiesdev/curl@v1.1 + with: + url: http://129.146.42.180/api/v1/github/sync/stable + log-response: true + timeout: 60000 + From 15ef1352e9d3fe55e000db10336b3fd944c57452 Mon Sep 17 00:00:00 2001 From: yazninja <71800112+yazninja@users.noreply.github.com> Date: Sat, 3 Sep 2022 17:40:22 +0800 Subject: [PATCH 07/11] Update github cli to use orb --- .circleci/config.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 79c618e3..27466672 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ executors: orbs: # Add orbs to your configuration jira: circleci/jira@1.0.5 # invokes the Jira orb, making its commands accessible - + gh: circleci/github-cli@2.1 # The jobs for this project jobs: prepare-build: @@ -111,14 +111,7 @@ jobs: steps: - attach_workspace: at: ~/Cider/ - - run: - name: Installing GitHub Command Line Interface - command: | - sudo apt-get update -y - curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null - sudo apt-get update -y - sudo apt install -y gh + - gh/install - run: name: Move Build Files command: | From e09da16d019dcacd9a080137f6b7990026816dae Mon Sep 17 00:00:00 2001 From: yazninja Date: Sun, 4 Sep 2022 01:03:11 +0800 Subject: [PATCH 08/11] fix song.link for library items --- src/renderer/views/components/mediaitem-list-item.ejs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/renderer/views/components/mediaitem-list-item.ejs b/src/renderer/views/components/mediaitem-list-item.ejs index 532e0154..e7c0ad5e 100644 --- a/src/renderer/views/components/mediaitem-list-item.ejs +++ b/src/renderer/views/components/mediaitem-list-item.ejs @@ -494,6 +494,10 @@ "name": `${app.getLz('action.share')} (song.link)`, "action": async function() { let item = self.item + if(item.type.startsWith('library-')) { + self.item.attributes.url = self.item.relationships.catalog.data[0].attributes.url + item.attributes.url = item.relationships.catalog.data[0].attributes.url + } if (!item.attributes.url) { if (item.type.includes("library")) { let result = (await app.mk.api.v3.music(`/v1/me/library/${item.type.replace("library-", '')}/${item.id}/catalog`)).data.data[0] From 6cbe9522fc9f1df6aec254554dcb2eb83b7fbe37 Mon Sep 17 00:00:00 2001 From: lennyerik <49204493+lennyerik@users.noreply.github.com> Date: Sat, 3 Sep 2022 23:25:19 +0200 Subject: [PATCH 09/11] Added support for opening native itms://, itmss:// music:// and musics:// links in Cider (#1409) --- src/main/base/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/base/app.ts b/src/main/base/app.ts index da4834d3..2b9a5d6a 100644 --- a/src/main/base/app.ts +++ b/src/main/base/app.ts @@ -232,7 +232,7 @@ export class AppEvents { startArgs.forEach((arg) => { console.log(arg); - if (arg.includes("cider://")) { + if (arg.includes("cider://") || arg.includes("itms://") || arg.includes("itmss://") || arg.includes("music://") || arg.includes("musics://")) { console.debug("[InstanceHandler] (second-instance) Link detected with " + arg); this.LinkHandler(arg); } else if (arg.includes("--force-quit")) { From 167893e890cd913eb9af7f120a7dc3a2201bd118 Mon Sep 17 00:00:00 2001 From: vapormusic Date: Sun, 4 Sep 2022 18:38:26 +0700 Subject: [PATCH 10/11] adding search suggestions --- src/renderer/less/elements.less | 26 +++++++++++++++ src/renderer/main/vueapp.js | 25 +++++++++++--- src/renderer/views/app/chrome-top.ejs | 40 ++++++++++++++++++++--- src/renderer/views/components/sidebar.ejs | 40 ++++++++++++++++++++--- src/renderer/views/pages/search.ejs | 39 +++++++++++++++++++--- 5 files changed, 152 insertions(+), 18 deletions(-) diff --git a/src/renderer/less/elements.less b/src/renderer/less/elements.less index 19f960e7..b2c7377a 100644 --- a/src/renderer/less/elements.less +++ b/src/renderer/less/elements.less @@ -334,6 +334,15 @@ width: 42px; height: 42px; flex: 0 0 auto; + &.circle{ + border-radius: 50%; + .mediaitem-artwork{ + border-radius: 50%; + } + img { + border-radius: 50%; + } + } } &:hover { @@ -349,6 +358,11 @@ color: #eee; } + &.hintactive { + background: var(--keyColor); + border-radius: 6px; + } + .queue-info { justify-content: center; display: flex; @@ -392,6 +406,18 @@ } } +.search-hints .cd-queue-item{ + &:hover { + background: var(--selected); + border-radius: 6px; + } + &:active { + background: var(--selected-click); + color: #eee; + border-radius: 6px; + } +} + /* horizontal media scroller */ .cd-hmedia-scroller { &::-webkit-scrollbar-thumb { diff --git a/src/renderer/main/vueapp.js b/src/renderer/main/vueapp.js index d9aaed7c..76dffdd3 100644 --- a/src/renderer/main/vueapp.js +++ b/src/renderer/main/vueapp.js @@ -1903,8 +1903,18 @@ const app = new Vue({ this.search.hints = []; return; } - let hints = await (await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/search/hints?term=${this.search.term}`)).data.results; - this.search.hints = hints ? hints.terms : []; + let hints = await (await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/search/suggestions?term=${this.search.term}`, + {"fields[albums]": "artwork,name,playParams,url,artistName,id", + "fields[artists]": "url,name,artwork,id", + "fields[songs]": "artwork,name,playParams,url,artistName,id", + "kinds": "terms,topResults", + "l": this.mklang, + "limit[results:terms]": 5, + "limit[results:topResults]": 5, + "omit[resource]": "autos", + "platform": "web", + "types": "activities,albums,artists,editorial-items,music-movies,playlists,record-labels,songs,stations"})).data.results; + this.search.hints = hints ? hints.suggestions : []; }, getSongProgress() { if (this.playerLCD.userInteraction) { @@ -3890,15 +3900,22 @@ const app = new Vue({ if (e.keyCode == "40") { if (this.search.hints.length - 1 < this.search.cursor + 1) return; this.search.cursor++; - this.search.term = this.search.hints[this.search.cursor]; + let item = this.search.hints[this.search.cursor] + this.search.term = item.content ? (item.content?.attributes?.name ?? "") :item.displayTerm; } else if (e.keyCode == "38") { if (this.search.cursor == 0) return; this.search.cursor--; - this.search.term = this.search.hints[this.search.cursor]; + let item = this.search.hints[this.search.cursor] + this.search.term = item.content ? (item.content?.attributes?.name ?? "") :item.displayTerm; } }, async searchQuery(term = this.search.term) { let self = this; + if (typeof term === "object"){ + this.routeView(term) + this.search.term = "" + return; + } if (term == "") { return; } diff --git a/src/renderer/views/app/chrome-top.ejs b/src/renderer/views/app/chrome-top.ejs index a65f0a7e..2530ba0c 100644 --- a/src/renderer/views/app/chrome-top.ejs +++ b/src/renderer/views/app/chrome-top.ejs @@ -277,10 +277,10 @@ diff --git a/src/renderer/views/components/sidebar.ejs b/src/renderer/views/components/sidebar.ejs index baf16fe4..1c89bc6a 100644 --- a/src/renderer/views/components/sidebar.ejs +++ b/src/renderer/views/components/sidebar.ejs @@ -7,10 +7,10 @@ + diff --git a/src/renderer/views/pages/search.ejs b/src/renderer/views/pages/search.ejs index 2f8d967a..abd3d053 100644 --- a/src/renderer/views/pages/search.ejs +++ b/src/renderer/views/pages/search.ejs @@ -4,17 +4,48 @@
- +
+
From db0316963cea5a9922ad17c6f535fc6f8c4a2d08 Mon Sep 17 00:00:00 2001 From: vapormusic Date: Sun, 4 Sep 2022 13:00:55 +0000 Subject: [PATCH 11/11] chore: Prettified Code [ci skip] --- src/renderer/less/elements.less | 6 ++--- src/renderer/main/vueapp.js | 39 ++++++++++++++++++--------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/renderer/less/elements.less b/src/renderer/less/elements.less index b2c7377a..4c9cb482 100644 --- a/src/renderer/less/elements.less +++ b/src/renderer/less/elements.less @@ -334,9 +334,9 @@ width: 42px; height: 42px; flex: 0 0 auto; - &.circle{ + &.circle { border-radius: 50%; - .mediaitem-artwork{ + .mediaitem-artwork { border-radius: 50%; } img { @@ -406,7 +406,7 @@ } } -.search-hints .cd-queue-item{ +.search-hints .cd-queue-item { &:hover { background: var(--selected); border-radius: 6px; diff --git a/src/renderer/main/vueapp.js b/src/renderer/main/vueapp.js index 76dffdd3..010c77ba 100644 --- a/src/renderer/main/vueapp.js +++ b/src/renderer/main/vueapp.js @@ -1903,17 +1903,20 @@ const app = new Vue({ this.search.hints = []; return; } - let hints = await (await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/search/suggestions?term=${this.search.term}`, - {"fields[albums]": "artwork,name,playParams,url,artistName,id", - "fields[artists]": "url,name,artwork,id", - "fields[songs]": "artwork,name,playParams,url,artistName,id", - "kinds": "terms,topResults", - "l": this.mklang, - "limit[results:terms]": 5, - "limit[results:topResults]": 5, - "omit[resource]": "autos", - "platform": "web", - "types": "activities,albums,artists,editorial-items,music-movies,playlists,record-labels,songs,stations"})).data.results; + let hints = await ( + await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/search/suggestions?term=${this.search.term}`, { + "fields[albums]": "artwork,name,playParams,url,artistName,id", + "fields[artists]": "url,name,artwork,id", + "fields[songs]": "artwork,name,playParams,url,artistName,id", + kinds: "terms,topResults", + l: this.mklang, + "limit[results:terms]": 5, + "limit[results:topResults]": 5, + "omit[resource]": "autos", + platform: "web", + types: "activities,albums,artists,editorial-items,music-movies,playlists,record-labels,songs,stations", + }) + ).data.results; this.search.hints = hints ? hints.suggestions : []; }, getSongProgress() { @@ -3900,20 +3903,20 @@ const app = new Vue({ if (e.keyCode == "40") { if (this.search.hints.length - 1 < this.search.cursor + 1) return; this.search.cursor++; - let item = this.search.hints[this.search.cursor] - this.search.term = item.content ? (item.content?.attributes?.name ?? "") :item.displayTerm; + let item = this.search.hints[this.search.cursor]; + this.search.term = item.content ? item.content?.attributes?.name ?? "" : item.displayTerm; } else if (e.keyCode == "38") { if (this.search.cursor == 0) return; this.search.cursor--; - let item = this.search.hints[this.search.cursor] - this.search.term = item.content ? (item.content?.attributes?.name ?? "") :item.displayTerm; + let item = this.search.hints[this.search.cursor]; + this.search.term = item.content ? item.content?.attributes?.name ?? "" : item.displayTerm; } }, async searchQuery(term = this.search.term) { let self = this; - if (typeof term === "object"){ - this.routeView(term) - this.search.term = "" + if (typeof term === "object") { + this.routeView(term); + this.search.term = ""; return; } if (term == "") {