From 3a7b5d865533ed67b54808c4d3e38290f60f8833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=A5=E5=8F=A1?= <46503943+jay900604@users.noreply.github.com> Date: Tue, 15 Feb 2022 13:13:13 +0800 Subject: [PATCH 1/7] Update zh_TW.jsonc (#454) Update the TW language of GitHub Themes. --- src/i18n/zh_TW.jsonc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/i18n/zh_TW.jsonc b/src/i18n/zh_TW.jsonc index d92e0b35..b373c6f7 100644 --- a/src/i18n/zh_TW.jsonc +++ b/src/i18n/zh_TW.jsonc @@ -276,6 +276,7 @@ "settings.header.visual.hardwareAcceleration.webGPU": "WebGPU", "settings.header.visual.theme": "主題", "settings.option.visual.theme.github.download" : "從 GitHub 網址安裝" , + "settings.option.visual.theme.github.explore": "瀏覽 GitHub 上的主題", "settings.prompt.visual.theme.github.URL" : "輸入你要安裝的主題網址" , "settings.notyf.visual.theme.install.success" : "主題成功安裝" , "settings.notyf.visual.theme.install.error" : "主題安裝失敗" , From 237d20ff6dd4b1e68097954afb80dadc233067d9 Mon Sep 17 00:00:00 2001 From: child_duckling <19170969+quacksire@users.noreply.github.com> Date: Mon, 14 Feb 2022 22:08:24 -0800 Subject: [PATCH 2/7] Added update check if using MSS or MAS builds. need help implementing --- src/main/base/browserwindow.ts | 9 +++++++++ src/renderer/views/pages/settings.ejs | 13 +++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/main/base/browserwindow.ts b/src/main/base/browserwindow.ts index 0cd560ee..cbe6547d 100644 --- a/src/main/base/browserwindow.ts +++ b/src/main/base/browserwindow.ts @@ -672,6 +672,15 @@ export class BrowserWindow { await win_autoUpdater.checkForUpdatesAndNotify() await linux_autoUpdater.checkForUpdatesAndNotify() }); + ipcMain.on('disable-update', (event) => { + // Check if using app store builds so people don't get pissy wen button go bonk + if (app.isPackaged && !process.mas || !process.windowsStore) { + event.returnValue = false + } else { + event.returnValue = true + } + }) + ipcMain.on('share-menu', async (_event, url) => { if (process.platform != 'darwin') return; diff --git a/src/renderer/views/pages/settings.ejs b/src/renderer/views/pages/settings.ejs index ae4101b5..23292ff0 100644 --- a/src/renderer/views/pages/settings.ejs +++ b/src/renderer/views/pages/settings.ejs @@ -656,7 +656,7 @@ -
+
{{$root.getLz('settings.option.general.updateCider')}}
@@ -666,7 +666,7 @@
-
+
{{$root.getLz('settings.option.general.updateCider.branch')}}
({{$root.getLz('settings.option.general.updateCider.branch.description')}}) @@ -852,6 +852,15 @@ ipcRenderer.invoke('setStoreValue', 'general.close_behavior', app.cfg.general.close_behavior); // setStoreValue does not change plugin store values somehow ipcRenderer.invoke('update-store-mtt', app.cfg.general.close_behavior); + }, + checkIfUpdateDisabled() { + if (ipcRenderer.sendSync('disable-update')) { + let updateFields = document.getElementsByClassName('update-check'); + for (var i=0; i < updateFields.length; i++) { + updateFields[i].style = "opacity: 0.5; pointer-events: none;"; + updateFields[i].title = "Not available on this type of build"; + } + } } } }) From 13a1f1951f4eaa4ab6d10db60eeb3ad35037ff6c Mon Sep 17 00:00:00 2001 From: vapormusic Date: Tue, 15 Feb 2022 13:30:31 +0700 Subject: [PATCH 3/7] fix locale / allow pl to show before list loading is fully done --- src/renderer/index.js | 17 +++++++++++------ .../views/components/sidebar-playlist.ejs | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/renderer/index.js b/src/renderer/index.js index 4c77fe4f..7a49406a 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -555,7 +555,7 @@ const app = new Vue({ } ).then(() => { if (this.page == 'playlist_' + this.showingPlaylist.id) { - this.getPlaylistFromID(this.showingPlaylist.id) + this.getPlaylistFromID(this.showingPlaylist.id, true) } }) }, @@ -997,7 +997,7 @@ const app = new Vue({ console.log(res) self.appRoute(`playlist_` + res.id); self.showingPlaylist = []; - self.getPlaylistFromID(app.page.substring(9)) + self.getPlaylistFromID(app.page.substring(9), true) self.playlists.listing.push({ id: res.id, attributes: { @@ -1092,7 +1092,7 @@ const app = new Vue({ response = response.data.data[0] let self = this let playlistId = response.id - if (!transient) this.playlists.loadingState = 0 + this.playlists.loadingState = (!transient) ? 0 : 1 this.showingPlaylist = response if (!response.relationships.tracks.next) { this.playlists.loadingState = 1 @@ -1572,14 +1572,14 @@ const app = new Vue({ if (kind == "appleCurator") { app.appleCurator = a.data.data[0] } else { - this.getPlaylistContinuous(a) + this.getPlaylistContinuous(a, true) } } } finally { if (kind == "appleCurator") { app.appleCurator = a.data.data[0] } else { - this.getPlaylistContinuous(a) + this.getPlaylistContinuous(a, true) } } ; @@ -3699,12 +3699,17 @@ const app = new Vue({ if (langcodes) langcodes = langcodes.map(function (u) { return u.toLowerCase() }) console.log(langcodes) let sellang = "" - if (u && langcodes.includes(u.toLowerCase().replace('_', "-"))) { + if (u && langcodes.startsWith(u.toLowerCase().replace('_', "-"))) { sellang = ((u.toLowerCase()).replace('_', "-")) } else if (u && u.includes('_') && langcodes.includes(((u.toLowerCase()).replace('_', "-")).split("-")[0])) { sellang = ((u.toLowerCase()).replace('_', "-")).split("-")[0] } if (sellang == "") sellang = (item.data.data[0].attributes.defaultLanguageTag).toLowerCase() + + // Fix weird locales: + if (sellang == "iw") sellang = "iw-il" + sellang = sellang.replace(/-Han[s|t]/i, "").toLowerCase() + console.log(sellang) return await sellang } diff --git a/src/renderer/views/components/sidebar-playlist.ejs b/src/renderer/views/components/sidebar-playlist.ejs index 83df7072..bfe0edf6 100644 --- a/src/renderer/views/components/sidebar-playlist.ejs +++ b/src/renderer/views/components/sidebar-playlist.ejs @@ -189,7 +189,7 @@ openPlaylist(item) { this.$root.appRoute(`playlist_` + item.id); this.$root.showingPlaylist = []; - this.$root.getPlaylistFromID(this.$root.page.substring(9)) + this.$root.getPlaylistFromID(this.$root.page.substring(9), true) }, getPlaylistChildren(item) { let self = this From 6d9768230fab0e8827f5488c174214b1fbd180ea Mon Sep 17 00:00:00 2001 From: vapormusic Date: Tue, 15 Feb 2022 13:33:25 +0700 Subject: [PATCH 4/7] oops --- src/renderer/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/index.js b/src/renderer/index.js index 7a49406a..1829d938 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -3699,7 +3699,7 @@ const app = new Vue({ if (langcodes) langcodes = langcodes.map(function (u) { return u.toLowerCase() }) console.log(langcodes) let sellang = "" - if (u && langcodes.startsWith(u.toLowerCase().replace('_', "-"))) { + if (u && langcodes.includes(u.toLowerCase().replace('_', "-"))) { sellang = ((u.toLowerCase()).replace('_', "-")) } else if (u && u.includes('_') && langcodes.includes(((u.toLowerCase()).replace('_', "-")).split("-")[0])) { sellang = ((u.toLowerCase()).replace('_', "-")).split("-")[0] From cb8c41d379aa14c51106cda89dc2a9e290236858 Mon Sep 17 00:00:00 2001 From: JYW0803 <74043061+JYW0803@users.noreply.github.com> Date: Tue, 15 Feb 2022 17:30:31 +0800 Subject: [PATCH 5/7] Also copy blockmap for partial download `[2022-02-15 17:28:30.126] [error] Cannot download differentially, fallback to full download: Error: Cannot download "https://478-429851205-gh.circle-artifacts.com/0/%7E/Cider/dist/artifacts/Cider-Setup-1.1.428.exe.blockmap", status 404: Not Found at ClientRequest. (C:\Program Files\Cider\resources\app.asar\node_modules\builder-util-runtime\src\httpExecutor.ts:288:11) at ClientRequest.emit (node:events:394:28) at ClientRequest.emit (node:domain:475:12) at SimpleURLLoaderWrapper. (node:electron/js2c/browser_init:105:6829) at SimpleURLLoaderWrapper.emit (node:events:394:28) at SimpleURLLoaderWrapper.emit (node:domain:475:12)` --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 35ac334d..40c944a1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,6 +65,7 @@ jobs: mv ~/Cider/dist/*.AppImage ~/Cider/dist/artifacts mv ~/Cider/dist/*.snap ~/Cider/dist/artifacts mv ~/Cider/dist/*.yml ~/Cider/dist/artifacts + mv ~/Cider/dist/*.blockmap ~/Cider/dist/artifacts - store_artifacts: path: ~/Cider/dist/artifacts - \ No newline at end of file + From dd49b0eb6b05eaf8c7ece81c580ab3fb86209b11 Mon Sep 17 00:00:00 2001 From: vapormusic Date: Tue, 15 Feb 2022 16:34:42 +0700 Subject: [PATCH 6/7] more lang fix --- src/renderer/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/index.js b/src/renderer/index.js index 1829d938..6ac0715b 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -3694,9 +3694,9 @@ const app = new Vue({ let u = this.cfg.general.language; // use MusicKit.getInstance or crash try { - item = await MusicKit.getInstance().api.v3.music(`v1/storefronts/${app.mk.storefrontId}`) + let item = await MusicKit.getInstance().api.v3.music(`v1/storefronts/${app.mk.storefrontId}`) let langcodes = item.data.data[0].attributes.supportedLanguageTags; - if (langcodes) langcodes = langcodes.map(function (u) { return u.toLowerCase() }) + if (langcodes) langcodes = langcodes.map(function (u) { return u.replace(/-Han[s|t]/i, "").toLowerCase() }) console.log(langcodes) let sellang = "" if (u && langcodes.includes(u.toLowerCase().replace('_', "-"))) { From f58ceeb14cb23c760d5b0c5f2bd84263e0cb2bc9 Mon Sep 17 00:00:00 2001 From: vapormusic Date: Tue, 15 Feb 2022 23:00:22 +0700 Subject: [PATCH 7/7] fix #459 --- .../views/components/listitem-horizontal.ejs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/renderer/views/components/listitem-horizontal.ejs b/src/renderer/views/components/listitem-horizontal.ejs index a159f362..a8df81f4 100644 --- a/src/renderer/views/components/listitem-horizontal.ejs +++ b/src/renderer/views/components/listitem-horizontal.ejs @@ -41,6 +41,21 @@ catch (e){} }, + watch: { + items: function (items) { + // give every item an id + this.items.forEach(function (item, index) { + item.id = index; + }); + // split items into pages + this.itemPages = app.arrayToChunk(this.items, 4); + try{ + this.simplifiedParent = JSON.stringify(this.items.map ( function(x){return x.attributes.playParams})); + console.log("simplifiedParent: " + this.simplifiedParent); + } + catch (e){} + } + }, methods: { sayHello: function () { alert('Hello world!');