fix locale in now playing
This commit is contained in:
parent
58652594bc
commit
bed6548fc1
7 changed files with 19 additions and 14 deletions
|
@ -527,7 +527,7 @@ export class BrowserWindow {
|
||||||
|
|
||||||
ipcMain.on('play', (_event, type, id) => {
|
ipcMain.on('play', (_event, type, id) => {
|
||||||
BrowserWindow.win.webContents.executeJavaScript(`
|
BrowserWindow.win.webContents.executeJavaScript(`
|
||||||
MusicKit.getInstance().setQueue({ ${type}: '${id}'}).then(function(queue) {
|
MusicKit.getInstance().setQueue({ ${type}: '${id}', parameters : {l : app.mklang}}).then(function(queue) {
|
||||||
MusicKit.getInstance().play();
|
MusicKit.getInstance().play();
|
||||||
});
|
});
|
||||||
`)
|
`)
|
||||||
|
|
|
@ -643,7 +643,8 @@ const app = new Vue({
|
||||||
let kind = lastItem.attributes.playParams.kind;
|
let kind = lastItem.attributes.playParams.kind;
|
||||||
let truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
|
let truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
|
||||||
app.mk.setQueue({
|
app.mk.setQueue({
|
||||||
[truekind]: [lastItem.attributes.playParams.id]
|
[truekind]: [lastItem.attributes.playParams.id],
|
||||||
|
parameters : {l : app.mklang}
|
||||||
})
|
})
|
||||||
app.mk.mute()
|
app.mk.mute()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -696,7 +697,7 @@ const app = new Vue({
|
||||||
|
|
||||||
ipcRenderer.on('play', function(_event, mode, id) {
|
ipcRenderer.on('play', function(_event, mode, id) {
|
||||||
if (mode !== 'url'){
|
if (mode !== 'url'){
|
||||||
self.mk.setQueue({[mode]: id}).then(() => {
|
self.mk.setQueue({[mode]: id , parameters : {l : self.mklang}}).then(() => {
|
||||||
app.mk.play()
|
app.mk.play()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -2722,7 +2723,8 @@ const app = new Vue({
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.mk.setQueue({
|
this.mk.setQueue({
|
||||||
[truekind]: [id]
|
[truekind]: [id],
|
||||||
|
parameters : {l : this.mklang}
|
||||||
}).then(function (queue) {
|
}).then(function (queue) {
|
||||||
MusicKit.getInstance().play()
|
MusicKit.getInstance().play()
|
||||||
})
|
})
|
||||||
|
@ -2762,7 +2764,8 @@ const app = new Vue({
|
||||||
app.mk.stop().then(() => {
|
app.mk.stop().then(() => {
|
||||||
if (item) {
|
if (item) {
|
||||||
app.mk.setQueue({
|
app.mk.setQueue({
|
||||||
[item.attributes.playParams.kind ?? item.type]: item.attributes.playParams.id ?? item.id
|
[item.attributes.playParams.kind ?? item.type]: item.attributes.playParams.id ?? item.id,
|
||||||
|
parameters : {l : app.mklang}
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
app.mk.play().then(() => {
|
app.mk.play().then(() => {
|
||||||
if (app.mk.shuffleMode == 1) {
|
if (app.mk.shuffleMode == 1) {
|
||||||
|
@ -2796,7 +2799,8 @@ const app = new Vue({
|
||||||
app.mk.stop().then(() => {
|
app.mk.stop().then(() => {
|
||||||
if (truekind == "playlists" && (id.startsWith("p.") || id.startsWith("pl.u"))) {
|
if (truekind == "playlists" && (id.startsWith("p.") || id.startsWith("pl.u"))) {
|
||||||
app.mk.setQueue({
|
app.mk.setQueue({
|
||||||
[item.attributes.playParams.kind ?? item.type]: item.attributes.playParams.id ?? item.id
|
[item.attributes.playParams.kind ?? item.type]: item.attributes.playParams.id ?? item.id,
|
||||||
|
parameters : {l : app.mklang}
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.id) ?? 1).then(function () {
|
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.id) ?? 1).then(function () {
|
||||||
if ((app.showingPlaylist && app.showingPlaylist.id == id)) {
|
if ((app.showingPlaylist && app.showingPlaylist.id == id)) {
|
||||||
|
@ -2835,7 +2839,8 @@ const app = new Vue({
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.mk.setQueue({
|
this.mk.setQueue({
|
||||||
[truekind]: [id]
|
[truekind]: [id],
|
||||||
|
parameters : {l : this.mklang}
|
||||||
}).then(function (queue) {
|
}).then(function (queue) {
|
||||||
if (item && ((queue._itemIDs[childIndex] != item.id))) {
|
if (item && ((queue._itemIDs[childIndex] != item.id))) {
|
||||||
childIndex = queue._itemIDs.indexOf(item.id)
|
childIndex = queue._itemIDs.indexOf(item.id)
|
||||||
|
@ -3151,7 +3156,7 @@ const app = new Vue({
|
||||||
quickPlay(query) {
|
quickPlay(query) {
|
||||||
let self = this
|
let self = this
|
||||||
MusicKit.getInstance().api.search(query, {limit: 2, types: 'songs'}).then(function (data) {
|
MusicKit.getInstance().api.search(query, {limit: 2, types: 'songs'}).then(function (data) {
|
||||||
MusicKit.getInstance().setQueue({song: data["songs"]['data'][0]["id"]}).then(function (queue) {
|
MusicKit.getInstance().setQueue({song: data["songs"]['data'][0]["id"], parameters : {l : app.mklang}}).then(function (queue) {
|
||||||
MusicKit.getInstance().play()
|
MusicKit.getInstance().play()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
self.$forceUpdate()
|
self.$forceUpdate()
|
||||||
|
|
|
@ -81,14 +81,14 @@ const wsapi = {
|
||||||
|
|
||||||
},
|
},
|
||||||
playTrackById(id, kind = "song") {
|
playTrackById(id, kind = "song") {
|
||||||
MusicKit.getInstance().setQueue({ [kind]: id }).then(function (queue) {
|
MusicKit.getInstance().setQueue({ [kind]: id , parameters : {l : app.mklang}}).then(function (queue) {
|
||||||
MusicKit.getInstance().play()
|
MusicKit.getInstance().play()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
quickPlay(term) {
|
quickPlay(term) {
|
||||||
// Quick play by song name
|
// Quick play by song name
|
||||||
MusicKit.getInstance().api.search(term, { limit: 2, types: 'songs' }).then(function (data) {
|
MusicKit.getInstance().api.search(term, { limit: 2, types: 'songs' }).then(function (data) {
|
||||||
MusicKit.getInstance().setQueue({ song: data["songs"][0]["id"] }).then(function (queue) {
|
MusicKit.getInstance().setQueue({ song: data["songs"][0]["id"],parameters : {l : app.mklang} }).then(function (queue) {
|
||||||
MusicKit.getInstance().play()
|
MusicKit.getInstance().play()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -531,7 +531,7 @@
|
||||||
array[j] = temp;
|
array[j] = temp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
app.mk.setQueue({ [truekind]: [item.attributes.playParams.id ?? item.id] }).then(function () {
|
app.mk.setQueue({ [truekind]: [item.attributes.playParams.id ?? item.id] , parameters : {l : this.app.mklang} }).then(function () {
|
||||||
app.mk.play().then(function () {
|
app.mk.play().then(function () {
|
||||||
var playlistId = id
|
var playlistId = id
|
||||||
function getPlaylist(id, isLibrary) {
|
function getPlaylist(id, isLibrary) {
|
||||||
|
|
|
@ -480,7 +480,7 @@
|
||||||
|
|
||||||
let query = (this.data ?? app.showingPlaylist).relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
|
let query = (this.data ?? app.showingPlaylist).relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
|
||||||
app.mk.stop().then(function () {
|
app.mk.stop().then(function () {
|
||||||
app.mk.setQueue({[truekind]: [id]}).then(function () {
|
app.mk.setQueue({[truekind]: [id] , parameters : {l : app.mklang}}).then(function () {
|
||||||
app.mk.play().then(function () {
|
app.mk.play().then(function () {
|
||||||
if (query.length > 100) {
|
if (query.length > 100) {
|
||||||
let u = query.slice(100);
|
let u = query.slice(100);
|
||||||
|
|
|
@ -534,7 +534,7 @@
|
||||||
|
|
||||||
let query = (this.data ?? app.showingPlaylist).relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
|
let query = (this.data ?? app.showingPlaylist).relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
|
||||||
app.mk.stop().then(function () {
|
app.mk.stop().then(function () {
|
||||||
app.mk.setQueue({[truekind]: [id]}).then(function () {
|
app.mk.setQueue({[truekind]: [id] , parameters : {l : app.mklang}}).then(function () {
|
||||||
app.mk.play().then(function () {
|
app.mk.play().then(function () {
|
||||||
if (query.length > 100) {
|
if (query.length > 100) {
|
||||||
let u = query.slice(100);
|
let u = query.slice(100);
|
||||||
|
|
|
@ -204,7 +204,7 @@
|
||||||
return minutes + ":" + (seconds < 10 ? '0' : '') + seconds;
|
return minutes + ":" + (seconds < 10 ? '0' : '') + seconds;
|
||||||
},
|
},
|
||||||
playEpisode(episode) {
|
playEpisode(episode) {
|
||||||
app.mk.setQueue({'episode': episode.id}).then(() => {app.mk.play()})
|
app.mk.setQueue({'episode': episode.id, parameters : {l : app.mklang}}).then(() => {app.mk.play()})
|
||||||
},
|
},
|
||||||
selectPodcast(podcast) {
|
selectPodcast(podcast) {
|
||||||
this.podcastSelected = podcast
|
this.podcastSelected = podcast
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue