[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
|
* 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();
|
const remote = express();
|
||||||
remote.use(express.static(path.join(this.paths.srcPath, "./web-remote/")))
|
remote.use(express.static(path.join(this.paths.srcPath, "./web-remote/")))
|
||||||
remote.listen(this.remotePort, () => {
|
remote.listen(this.remotePort, () => {
|
||||||
console.log(`Cider remote port: ${this.clientPort}`);
|
console.log(`Cider remote port: ${this.remotePort}`);
|
||||||
if (firstRequest) {
|
if (firstRequest) {
|
||||||
console.log("---- Ignore Me ;) ---");
|
console.log("---- Ignore Me ;) ---");
|
||||||
qrcode.generate(`http://${os.hostname}:${this.clientPort}/remote`);
|
qrcode.generate(`http://${os.hostname}:${this.remotePort}/remote`);
|
||||||
console.log("---- Ignore Me ;) ---");
|
console.log("---- Ignore Me ;) ---");
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
|
|
@ -71,16 +71,16 @@ var app = new Vue({
|
||||||
},
|
},
|
||||||
musicAppVariant() {
|
musicAppVariant() {
|
||||||
if (navigator.userAgent.match(/Android/i)) {
|
if (navigator.userAgent.match(/Android/i)) {
|
||||||
return "Apple Music";
|
return "Cider";
|
||||||
} else if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) {
|
} else if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) {
|
||||||
return "Music";
|
return "Cider";
|
||||||
} else {
|
} else {
|
||||||
if (navigator.userAgent.indexOf('Mac') > 0) {
|
if (navigator.userAgent.indexOf('Mac') > 0) {
|
||||||
return 'Music';
|
return 'Music';
|
||||||
} else if (navigator.userAgent.indexOf('Win') > 0) {
|
} else if (navigator.userAgent.indexOf('Win') > 0) {
|
||||||
return 'Apple Music Electron';
|
return 'Cider';
|
||||||
} else {
|
} else {
|
||||||
return 'Apple Music Electron';
|
return 'Cider';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -340,10 +340,10 @@ var app = new Vue({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showSearch(reset = false) {
|
showSearch(reset = false) {
|
||||||
if(reset) {
|
if (reset) {
|
||||||
this.search.lastPage = "search"
|
this.search.lastPage = "search"
|
||||||
}
|
}
|
||||||
switch(this.search.lastPage) {
|
switch (this.search.lastPage) {
|
||||||
case "search":
|
case "search":
|
||||||
this.screen = "search"
|
this.screen = "search"
|
||||||
break;
|
break;
|
||||||
|
@ -359,7 +359,7 @@ var app = new Vue({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showArtistByName(name) {
|
showArtistByName(name) {
|
||||||
this.musicKitAPI("search", name, {types: "artists"})
|
this.musicKitAPI("search", name, { types: "artists" })
|
||||||
},
|
},
|
||||||
showAlbum(id) {
|
showAlbum(id) {
|
||||||
this.search.lastPage = "album"
|
this.search.lastPage = "album"
|
||||||
|
@ -369,7 +369,7 @@ var app = new Vue({
|
||||||
showArtist(id) {
|
showArtist(id) {
|
||||||
this.search.lastPage = "artist"
|
this.search.lastPage = "artist"
|
||||||
this.screen = "artist-page"
|
this.screen = "artist-page"
|
||||||
this.musicKitAPI("artist", id, {include: "songs,playlists,albums"})
|
this.musicKitAPI("artist", id, { include: "songs,playlists,albums" })
|
||||||
},
|
},
|
||||||
showQueue() {
|
showQueue() {
|
||||||
this.queue.temp = this.player["queue"]["_queueItems"]
|
this.queue.temp = this.player["queue"]["_queueItems"]
|
||||||
|
@ -418,9 +418,9 @@ var app = new Vue({
|
||||||
return palette
|
return palette
|
||||||
},
|
},
|
||||||
playAlbum(id, shuffle = false) {
|
playAlbum(id, shuffle = false) {
|
||||||
if(shuffle) {
|
if (shuffle) {
|
||||||
this.setShuffle(true)
|
this.setShuffle(true)
|
||||||
}else{
|
} else {
|
||||||
this.setShuffle(false)
|
this.setShuffle(false)
|
||||||
}
|
}
|
||||||
this.playMediaItemById(id, 'album');
|
this.playMediaItemById(id, 'album');
|
||||||
|
@ -464,9 +464,8 @@ var app = new Vue({
|
||||||
document.body.classList.add("streamer-overlay")
|
document.body.classList.add("streamer-overlay")
|
||||||
},
|
},
|
||||||
setMode(mode) {
|
setMode(mode) {
|
||||||
switch(mode) {
|
switch (mode) {
|
||||||
default:
|
default: this.screen = "player"
|
||||||
this.screen = "player"
|
|
||||||
break;
|
break;
|
||||||
case "miniplayer":
|
case "miniplayer":
|
||||||
this.screen = "miniplayer"
|
this.screen = "miniplayer"
|
||||||
|
@ -484,9 +483,9 @@ var app = new Vue({
|
||||||
console.log(e);
|
console.log(e);
|
||||||
console.log('connected');
|
console.log('connected');
|
||||||
app.connectedState = 1;
|
app.connectedState = 1;
|
||||||
if(getParameterByName("mode")) {
|
if (getParameterByName("mode")) {
|
||||||
self.setMode(getParameterByName("mode"))
|
self.setMode(getParameterByName("mode"))
|
||||||
}else{
|
} else {
|
||||||
self.setMode("default")
|
self.setMode("default")
|
||||||
}
|
}
|
||||||
self.clearSelectedTrack()
|
self.clearSelectedTrack()
|
||||||
|
@ -507,19 +506,18 @@ var app = new Vue({
|
||||||
socket.onmessage = (e) => {
|
socket.onmessage = (e) => {
|
||||||
const response = JSON.parse(e.data);
|
const response = JSON.parse(e.data);
|
||||||
switch (response.type) {
|
switch (response.type) {
|
||||||
default:
|
default: console.log(response);
|
||||||
console.log(response);
|
|
||||||
break;
|
break;
|
||||||
case "musickitapi.search":
|
case "musickitapi.search":
|
||||||
self.showArtist(response.data["artists"][0]["id"]);
|
self.showArtist(response.data["artists"][0]["id"]);
|
||||||
break;
|
break;
|
||||||
case "musickitapi.album":
|
case "musickitapi.album":
|
||||||
if(self.screen == "album-page") {
|
if (self.screen == "album-page") {
|
||||||
self.albumPage.data = response.data
|
self.albumPage.data = response.data
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "musickitapi.artist":
|
case "musickitapi.artist":
|
||||||
if(self.screen == "artist-page") {
|
if (self.screen == "artist-page") {
|
||||||
self.artistPage.data = response.data
|
self.artistPage.data = response.data
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -597,10 +595,10 @@ function xmlToJson(xml) {
|
||||||
for (var i = 0; i < xml.childNodes.length; i++) {
|
for (var i = 0; i < xml.childNodes.length; i++) {
|
||||||
var item = xml.childNodes.item(i);
|
var item = xml.childNodes.item(i);
|
||||||
var nodeName = item.nodeName;
|
var nodeName = item.nodeName;
|
||||||
if (typeof (obj[nodeName]) == "undefined") {
|
if (typeof(obj[nodeName]) == "undefined") {
|
||||||
obj[nodeName] = xmlToJson(item);
|
obj[nodeName] = xmlToJson(item);
|
||||||
} else {
|
} else {
|
||||||
if (typeof (obj[nodeName].push) == "undefined") {
|
if (typeof(obj[nodeName].push) == "undefined") {
|
||||||
var old = obj[nodeName];
|
var old = obj[nodeName];
|
||||||
obj[nodeName] = [];
|
obj[nodeName] = [];
|
||||||
obj[nodeName].push(old);
|
obj[nodeName].push(old);
|
||||||
|
@ -612,7 +610,7 @@ function xmlToJson(xml) {
|
||||||
return obj;
|
return obj;
|
||||||
};
|
};
|
||||||
|
|
||||||
window.onresize = function () {
|
window.onresize = function() {
|
||||||
app.resetPlayerUI()
|
app.resetPlayerUI()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,15 @@
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"scope": "/",
|
"scope": "/",
|
||||||
"start_url": "/",
|
"start_url": "/",
|
||||||
"name": "AME Remote",
|
"name": "Cider Remote",
|
||||||
"short_name": "AME Remote",
|
"short_name": "Cider Remote",
|
||||||
"description": "Apple Music Electron Remote",
|
"description": "Cider Remote",
|
||||||
"icons": [
|
"developer": {
|
||||||
{
|
"name": "Cider Collective",
|
||||||
|
"url": "https://cider.sh?utm-source=manifest"
|
||||||
|
},
|
||||||
|
"homepage_url": "https://cider.sh?utm-source=manifest",
|
||||||
|
"icons": [{
|
||||||
"src": "/icon-192x192.png",
|
"src": "/icon-192x192.png",
|
||||||
"sizes": "192x192",
|
"sizes": "192x192",
|
||||||
"type": "image/png"
|
"type": "image/png"
|
||||||
|
@ -28,5 +32,11 @@
|
||||||
"sizes": "512x512",
|
"sizes": "512x512",
|
||||||
"type": "image/png"
|
"type": "image/png"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"protocol_handlers": [{
|
||||||
|
"protocol": "ext+cider",
|
||||||
|
"name": "Cider",
|
||||||
|
"uriTemplate": "/?url=%s"
|
||||||
|
}]
|
||||||
|
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue