Merge branch 'upcoming' of https://github.com/ciderapp/Cider into upcoming

This commit is contained in:
vapormusic 2022-01-20 13:10:35 +07:00
commit f95d9dcab2
4 changed files with 39 additions and 8 deletions

View file

@ -127,7 +127,7 @@ export class AppEvents {
else if (arg.includes('/play/')) { //Steer away from protocol:// specific conditionals
const playParam = arg.split('/play/')[1]
if (playParam.includes('s/')) { // setQueue can be done with album, song, url, playlist id
if (playParam.includes('s/')) { // song
console.log(playParam)
let song = playParam.split('s/')[1]
console.warn(`[LinkHandler] Attempting to load song by id: ${song}`);
@ -136,7 +136,34 @@ export class AppEvents {
// MusicKit.getInstance().play();
// });
// `)
} 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();
// });
// `)
} 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();
// });
// `)
}
} 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();
// });
// `)
}
}
}
}

View file

@ -3016,7 +3016,11 @@ const app = new Vue({
this.cfg.audio.muted = true;
}
},
checkMuteChange() {
if( this.cfg.audio.muted ) {
this.cfg.audio.muted = false;
}
},
async apiCall(url, callback) {
const xmlHttp = new XMLHttpRequest();

View file

@ -81,7 +81,7 @@
<div class="input-container">
<button class="volume-button--small volume" @click="app.muteButtonPressed()" :class="{'active': app.cfg.audio.volume == 0}"></button>
<input type="range" class="slider" @wheel="app.volumeWheel" step="0.01" min="0" max="1" v-model="app.mk.volume"
v-if="typeof app.mk.volume != 'undefined'">
v-if="typeof app.mk.volume != 'undefined'" @change="app.checkMuteChange()">
</div>
</div>
</div>

View file

@ -92,12 +92,10 @@
<div class="song-artist"
style="display: inline-block; -webkit-box-orient: horizontal; white-space: nowrap;">
<div class="item-navigate song-artist" style="display: inline-block"
:style="[chrome.progresshover ? {'opacity': '0'} : {'opacity' : '1'} ]"
@click="getNowPlayingItemDetailed(`artist`)">
{{ mk.nowPlayingItem["attributes"]["artistName"] }}
</div>
<div class="song-artist item-navigate" style="display: inline-block"
:style="[chrome.progresshover ? {'opacity': '0'} : {'opacity' : '1'}]"
@click="getNowPlayingItemDetailed('album')" v-if="mk.nowPlayingItem['attributes']['albumName'] != ''">
<div class="separator" style="display: inline-block;">{{"—"}}</div>
{{(mk.nowPlayingItem["attributes"]["albumName"]) ?
@ -136,7 +134,8 @@
<button class="volume-button--small volume" @click="muteButtonPressed()" :class="{'active': this.cfg.audio.volume == 0}"></button>
<input type="range" class="" @wheel="volumeWheel" step="0.01" min="0" max="1"
v-model="mk.volume"
v-if="typeof mk.volume != 'undefined'">
v-if="typeof mk.volume != 'undefined'"
@change="checkMuteChange()">
</div>
<div class="app-chrome-item generic" v-if="false">
<button class="playback-button--small">
@ -300,7 +299,8 @@
<button class="volume-button--small volume" @click="muteButtonPressed()" :class="{'active': this.cfg.audio.volume == 0}"></button>
<input type="range" class="" @wheel="volumeWheel" step="0.01" min="0" max="1"
v-model="mk.volume"
v-if="typeof mk.volume != 'undefined'">
v-if="typeof mk.volume != 'undefined'"
@change="checkMuteChange()">
</div>
</div>
</div>