[web-remote] rebrand and manifest changes
This commit is contained in:
parent
d7a8b31684
commit
0ba82d938e
3 changed files with 56 additions and 46 deletions
|
@ -186,14 +186,16 @@ export class Win {
|
|||
|
||||
/*
|
||||
* Remote Client (I had no idea how to add it to our existing express server, so I just made another one) -@quacksire
|
||||
* TODO: Broadcast the remote so that /web-remote/ can connect
|
||||
* https://github.com/ciderapp/Apple-Music-Electron/blob/818ed18940ff600d76eb59d22016723a75885cd5/resources/functions/handler.js#L1173
|
||||
*/
|
||||
const remote = express();
|
||||
remote.use(express.static(path.join(this.paths.srcPath, "./web-remote/")))
|
||||
remote.listen(this.remotePort, () => {
|
||||
console.log(`Cider remote port: ${this.clientPort}`);
|
||||
console.log(`Cider remote port: ${this.remotePort}`);
|
||||
if (firstRequest) {
|
||||
console.log("---- Ignore Me ;) ---");
|
||||
qrcode.generate(`http://${os.hostname}:${this.clientPort}/remote`);
|
||||
qrcode.generate(`http://${os.hostname}:${this.remotePort}/remote`);
|
||||
console.log("---- Ignore Me ;) ---");
|
||||
/*
|
||||
*
|
||||
|
|
|
@ -71,16 +71,16 @@ var app = new Vue({
|
|||
},
|
||||
musicAppVariant() {
|
||||
if (navigator.userAgent.match(/Android/i)) {
|
||||
return "Apple Music";
|
||||
return "Cider";
|
||||
} else if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) {
|
||||
return "Music";
|
||||
return "Cider";
|
||||
} else {
|
||||
if (navigator.userAgent.indexOf('Mac') > 0) {
|
||||
return 'Music';
|
||||
} else if (navigator.userAgent.indexOf('Win') > 0) {
|
||||
return 'Apple Music Electron';
|
||||
return 'Cider';
|
||||
} else {
|
||||
return 'Apple Music Electron';
|
||||
return 'Cider';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -340,10 +340,10 @@ var app = new Vue({
|
|||
}
|
||||
},
|
||||
showSearch(reset = false) {
|
||||
if(reset) {
|
||||
if (reset) {
|
||||
this.search.lastPage = "search"
|
||||
}
|
||||
switch(this.search.lastPage) {
|
||||
switch (this.search.lastPage) {
|
||||
case "search":
|
||||
this.screen = "search"
|
||||
break;
|
||||
|
@ -359,7 +359,7 @@ var app = new Vue({
|
|||
}
|
||||
},
|
||||
showArtistByName(name) {
|
||||
this.musicKitAPI("search", name, {types: "artists"})
|
||||
this.musicKitAPI("search", name, { types: "artists" })
|
||||
},
|
||||
showAlbum(id) {
|
||||
this.search.lastPage = "album"
|
||||
|
@ -369,7 +369,7 @@ var app = new Vue({
|
|||
showArtist(id) {
|
||||
this.search.lastPage = "artist"
|
||||
this.screen = "artist-page"
|
||||
this.musicKitAPI("artist", id, {include: "songs,playlists,albums"})
|
||||
this.musicKitAPI("artist", id, { include: "songs,playlists,albums" })
|
||||
},
|
||||
showQueue() {
|
||||
this.queue.temp = this.player["queue"]["_queueItems"]
|
||||
|
@ -418,9 +418,9 @@ var app = new Vue({
|
|||
return palette
|
||||
},
|
||||
playAlbum(id, shuffle = false) {
|
||||
if(shuffle) {
|
||||
if (shuffle) {
|
||||
this.setShuffle(true)
|
||||
}else{
|
||||
} else {
|
||||
this.setShuffle(false)
|
||||
}
|
||||
this.playMediaItemById(id, 'album');
|
||||
|
@ -464,9 +464,8 @@ var app = new Vue({
|
|||
document.body.classList.add("streamer-overlay")
|
||||
},
|
||||
setMode(mode) {
|
||||
switch(mode) {
|
||||
default:
|
||||
this.screen = "player"
|
||||
switch (mode) {
|
||||
default: this.screen = "player"
|
||||
break;
|
||||
case "miniplayer":
|
||||
this.screen = "miniplayer"
|
||||
|
@ -484,9 +483,9 @@ var app = new Vue({
|
|||
console.log(e);
|
||||
console.log('connected');
|
||||
app.connectedState = 1;
|
||||
if(getParameterByName("mode")) {
|
||||
if (getParameterByName("mode")) {
|
||||
self.setMode(getParameterByName("mode"))
|
||||
}else{
|
||||
} else {
|
||||
self.setMode("default")
|
||||
}
|
||||
self.clearSelectedTrack()
|
||||
|
@ -507,19 +506,18 @@ var app = new Vue({
|
|||
socket.onmessage = (e) => {
|
||||
const response = JSON.parse(e.data);
|
||||
switch (response.type) {
|
||||
default:
|
||||
console.log(response);
|
||||
default: console.log(response);
|
||||
break;
|
||||
case "musickitapi.search":
|
||||
self.showArtist(response.data["artists"][0]["id"]);
|
||||
break;
|
||||
case "musickitapi.album":
|
||||
if(self.screen == "album-page") {
|
||||
if (self.screen == "album-page") {
|
||||
self.albumPage.data = response.data
|
||||
}
|
||||
break;
|
||||
case "musickitapi.artist":
|
||||
if(self.screen == "artist-page") {
|
||||
if (self.screen == "artist-page") {
|
||||
self.artistPage.data = response.data
|
||||
}
|
||||
break;
|
||||
|
@ -597,10 +595,10 @@ function xmlToJson(xml) {
|
|||
for (var i = 0; i < xml.childNodes.length; i++) {
|
||||
var item = xml.childNodes.item(i);
|
||||
var nodeName = item.nodeName;
|
||||
if (typeof (obj[nodeName]) == "undefined") {
|
||||
if (typeof(obj[nodeName]) == "undefined") {
|
||||
obj[nodeName] = xmlToJson(item);
|
||||
} else {
|
||||
if (typeof (obj[nodeName].push) == "undefined") {
|
||||
if (typeof(obj[nodeName].push) == "undefined") {
|
||||
var old = obj[nodeName];
|
||||
obj[nodeName] = [];
|
||||
obj[nodeName].push(old);
|
||||
|
@ -612,7 +610,7 @@ function xmlToJson(xml) {
|
|||
return obj;
|
||||
};
|
||||
|
||||
window.onresize = function () {
|
||||
window.onresize = function() {
|
||||
app.resetPlayerUI()
|
||||
}
|
||||
|
||||
|
|
|
@ -4,11 +4,15 @@
|
|||
"display": "standalone",
|
||||
"scope": "/",
|
||||
"start_url": "/",
|
||||
"name": "AME Remote",
|
||||
"short_name": "AME Remote",
|
||||
"description": "Apple Music Electron Remote",
|
||||
"icons": [
|
||||
{
|
||||
"name": "Cider Remote",
|
||||
"short_name": "Cider Remote",
|
||||
"description": "Cider Remote",
|
||||
"developer": {
|
||||
"name": "Cider Collective",
|
||||
"url": "https://cider.sh?utm-source=manifest"
|
||||
},
|
||||
"homepage_url": "https://cider.sh?utm-source=manifest",
|
||||
"icons": [{
|
||||
"src": "/icon-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
|
@ -28,5 +32,11 @@
|
|||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
]
|
||||
],
|
||||
"protocol_handlers": [{
|
||||
"protocol": "ext+cider",
|
||||
"name": "Cider",
|
||||
"uriTemplate": "/?url=%s"
|
||||
}]
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue