From ee1da31a944de4c67da99eff791b6a15c4cf08ce Mon Sep 17 00:00:00 2001 From: Jason Chen Date: Sat, 22 Jan 2022 20:46:22 -0800 Subject: [PATCH 1/4] no search results for podcast searching --- src/renderer/style.less | 5 +++++ src/renderer/views/pages/podcasts.ejs | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/renderer/style.less b/src/renderer/style.less index 0d54cfb2..8706e12f 100644 --- a/src/renderer/style.less +++ b/src/renderer/style.less @@ -2685,6 +2685,11 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb { height: 120px; } } + + .podcast-no-search-results { + text-align: center; + margin-top: 40px; + } } .podcasts-details { diff --git a/src/renderer/views/pages/podcasts.ejs b/src/renderer/views/pages/podcasts.ejs index ddcc5443..9a767c2b 100644 --- a/src/renderer/views/pages/podcasts.ejs +++ b/src/renderer/views/pages/podcasts.ejs @@ -58,6 +58,10 @@

Episodes

+
+

No Results

+

Try a new search.

+
From aa83f2d747e14738042a1c0296b201b481aa931c Mon Sep 17 00:00:00 2001 From: child_duckling <19170969+child-duckling@users.noreply.github.com> Date: Sat, 22 Jan 2022 21:53:37 -0800 Subject: [PATCH 2/4] this SHOULD work, hopefully --- src/main/base/app.ts | 26 ++++---------------------- src/main/base/win.ts | 9 ++++++++- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/src/main/base/app.ts b/src/main/base/app.ts index ce01748d..235948e3 100644 --- a/src/main/base/app.ts +++ b/src/main/base/app.ts @@ -1,6 +1,5 @@ import * as electron from 'electron'; import * as path from 'path'; - export class AppEvents { private static protocols: any = [ "ame", @@ -125,45 +124,28 @@ export class AppEvents { } // Play else if (arg.includes('/play/')) { //Steer away from protocol:// specific conditionals - const playParam = arg.split('/play/')[1] if (playParam.includes('s/')) { // song console.log(playParam) let song = playParam.split('s/')[1] console.warn(`[LinkHandler] Attempting to load song by id: ${song}`); - // AppEvents.window.webContents.executeJavaScript(` - // MusicKit.getInstance().setQueue({ song: '${song}'}).then(function(queue) { - // MusicKit.getInstance().play(); - // }); - // `) + electron.ipcRenderer.send('play', 'song', song) } else if (playParam.includes('a/')) { // album console.log(playParam) let album = playParam.split('a/')[1] console.warn(`[LinkHandler] Attempting to load album by id: ${album}`); - // AppEvents.window.webContents.executeJavaScript(` - // MusicKit.getInstance().setQueue({ album: '${album}'}).then(function(queue) { - // MusicKit.getInstance().play(); - // }); - // `) + electron.ipcRenderer.send('play', 'album', album) } else if (playParam.includes('p/')) { // playlist console.log(playParam) let playlist = playParam.split('p/')[1] console.warn(`[LinkHandler] Attempting to load playlist by id: ${playlist}`); - // AppEvents.window.webContents.executeJavaScript(` - // MusicKit.getInstance().setQueue({ playlist: '${playlist}'}).then(function(queue) { - // MusicKit.getInstance().play(); - // }); - // `) + electron.ipcRenderer.send('play', 'playlist', playlist) } } else if (arg.includes('music.apple.com')) { // URL (used with itms/itmss/music/musics uris) console.log(arg) let url = arg.split('//')[1] console.warn(`[LinkHandler] Attempting to load url: ${url}`); - // AppEvents.window.webContents.executeJavaScript(` - // MusicKit.getInstance().setQueue({ url: 'https://${url}'}).then(function(queue) { - // MusicKit.getInstance().play(); - // }); - // `) + electron.ipcRenderer.send('play', 'url', url) } } } \ No newline at end of file diff --git a/src/main/base/win.ts b/src/main/base/win.ts index 3c0e4aad..9f7586c1 100644 --- a/src/main/base/win.ts +++ b/src/main/base/win.ts @@ -411,6 +411,14 @@ export class Win { this.win.setFullScreen(flag) }) + electron.ipcMain.on('play', (event, type, id) => { + this.win.webContents.executeJavaScript(` + MusicKit.getInstance().setQueue({ ${type}: '${id}'}).then(function(queue) { + MusicKit.getInstance().play(); + }); + `) + }) + function getIp() { let ip = false; let alias = 0; @@ -488,7 +496,6 @@ export class Win { return { action: "deny" }; }); } - private async broadcastRemote() { function getIp() { let ip :any = false; From 2b8b0ce6d873fd7f1a8fcbaa018c323bb7bcf69a Mon Sep 17 00:00:00 2001 From: Jason Chen Date: Sat, 22 Jan 2022 23:12:29 -0800 Subject: [PATCH 4/4] add loadbar sound when playing a song --- src/renderer/style.less | 46 +++++++++++++++++++ .../views/components/mediaitem-list-item.ejs | 15 +++--- 2 files changed, 55 insertions(+), 6 deletions(-) diff --git a/src/renderer/style.less b/src/renderer/style.less index 8706e12f..a66b900c 100644 --- a/src/renderer/style.less +++ b/src/renderer/style.less @@ -3633,6 +3633,52 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb { background-repeat: no-repeat; } + /* CSS.gg + */ + @keyframes load-bar { + 10% {box-shadow: inset 0 -4px 0} + 20% {box-shadow: inset 0 -10px 0} + 30% {box-shadow: inset 0 -12px 0} + 40% {box-shadow: inset 0 -8px 0} + 50% {box-shadow: inset 0 -4px 0} + 60% {box-shadow: inset 0 -6px 0} + 80% {box-shadow: inset 0 -12px 0} + 90% {box-shadow: inset 0 -6px 0} + to {box-shadow: inset 0 -2px 0} + } + + .loadbar-sound, + .loadbar-sound::after, + .loadbar-sound::before { + animation: load-bar 1.3s ease infinite alternate; + box-sizing: border-box; + width: 3px; + height: 28px; + box-shadow: inset 0 -12px 0; + } + .loadbar-sound { + margin-left: 22px; + margin-top: -16px; + position: relative; + transform: scale(var(--load-bar,1)); + color: var(--keyColor); + display: block; + } + .loadbar-sound::after, + .loadbar-sound::before { + content: ""; + position: absolute; + bottom: 0 + } + .loadbar-sound::before { + left: -4.5px; + animation-delay: -2.4s + } + .loadbar-sound::after { + right: -4.2px; + animation-delay: -3.7s + } + .isLibrary { flex: 0 0 auto; width: 40px; diff --git a/src/renderer/views/components/mediaitem-list-item.ejs b/src/renderer/views/components/mediaitem-list-item.ejs index b75ac540..b691ee69 100644 --- a/src/renderer/views/components/mediaitem-list-item.ejs +++ b/src/renderer/views/components/mediaitem-list-item.ejs @@ -14,12 +14,15 @@ @mouseleave="showInLibrary = false" :class="[{'mediaitem-selected': app.select_hasMediaItem(guid)}, addClasses]">