Merge branch 'develop' of https://github.com/ciderapp/Cider into develop
This commit is contained in:
commit
fa5633c501
5 changed files with 161 additions and 138 deletions
|
@ -311,7 +311,7 @@ const CiderAudio = {
|
||||||
for (let i = 0; i < WARMTH_FREQUENCIES.length; i++) {
|
for (let i = 0; i < WARMTH_FREQUENCIES.length; i++) {
|
||||||
CiderAudio.audioNodes.analogWarmth[i] = CiderAudio.context.createBiquadFilter();
|
CiderAudio.audioNodes.analogWarmth[i] = CiderAudio.context.createBiquadFilter();
|
||||||
CiderAudio.audioNodes.analogWarmth[i].type = 'peaking'; // 'peaking';
|
CiderAudio.audioNodes.analogWarmth[i].type = 'peaking'; // 'peaking';
|
||||||
CiderAudio.audioNodes.analogWarmth[i].frequency.value = WARMTH_FREQUENCIES[i];
|
CiderAudio.audioNodes.analogWarmth[i].frequency.value = WARMTH_FREQUENCIES[i] ;
|
||||||
CiderAudio.audioNodes.analogWarmth[i].Q.value = WARMTH_Q[i];
|
CiderAudio.audioNodes.analogWarmth[i].Q.value = WARMTH_Q[i];
|
||||||
CiderAudio.audioNodes.analogWarmth[i].gain.value = WARMTH_GAIN[i] * 1.25;
|
CiderAudio.audioNodes.analogWarmth[i].gain.value = WARMTH_GAIN[i] * 1.25;
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ const CiderAudio = {
|
||||||
for (let i = 0; i < WARMTH_FREQUENCIES.length; i++) {
|
for (let i = 0; i < WARMTH_FREQUENCIES.length; i++) {
|
||||||
CiderAudio.audioNodes.analogWarmth[i] = CiderAudio.context.createBiquadFilter();
|
CiderAudio.audioNodes.analogWarmth[i] = CiderAudio.context.createBiquadFilter();
|
||||||
CiderAudio.audioNodes.analogWarmth[i].type = 'peaking'; // 'peaking';
|
CiderAudio.audioNodes.analogWarmth[i].type = 'peaking'; // 'peaking';
|
||||||
CiderAudio.audioNodes.analogWarmth[i].frequency.value = WARMTH_FREQUENCIES[i];
|
CiderAudio.audioNodes.analogWarmth[i].frequency.value = WARMTH_FREQUENCIES[i] ;
|
||||||
CiderAudio.audioNodes.analogWarmth[i].Q.value = WARMTH_Q[i];
|
CiderAudio.audioNodes.analogWarmth[i].Q.value = WARMTH_Q[i];
|
||||||
CiderAudio.audioNodes.analogWarmth[i].gain.value = WARMTH_GAIN[i] * 1.75;
|
CiderAudio.audioNodes.analogWarmth[i].gain.value = WARMTH_GAIN[i] * 1.75;
|
||||||
}
|
}
|
||||||
|
@ -331,7 +331,7 @@ const CiderAudio = {
|
||||||
for (let i = 0; i < WARMTH_FREQUENCIES.length; i++) {
|
for (let i = 0; i < WARMTH_FREQUENCIES.length; i++) {
|
||||||
CiderAudio.audioNodes.analogWarmth[i] = CiderAudio.context.createBiquadFilter();
|
CiderAudio.audioNodes.analogWarmth[i] = CiderAudio.context.createBiquadFilter();
|
||||||
CiderAudio.audioNodes.analogWarmth[i].type = 'peaking'; // 'peaking';
|
CiderAudio.audioNodes.analogWarmth[i].type = 'peaking'; // 'peaking';
|
||||||
CiderAudio.audioNodes.analogWarmth[i].frequency.value = WARMTH_FREQUENCIES[i];
|
CiderAudio.audioNodes.analogWarmth[i].frequency.value = WARMTH_FREQUENCIES[i] ;
|
||||||
CiderAudio.audioNodes.analogWarmth[i].Q.value = WARMTH_Q[i];
|
CiderAudio.audioNodes.analogWarmth[i].Q.value = WARMTH_Q[i];
|
||||||
CiderAudio.audioNodes.analogWarmth[i].gain.value = WARMTH_GAIN[i] * 1.25;
|
CiderAudio.audioNodes.analogWarmth[i].gain.value = WARMTH_GAIN[i] * 1.25;
|
||||||
}
|
}
|
||||||
|
@ -407,7 +407,7 @@ const CiderAudio = {
|
||||||
for (let i = 0; i < LLPW_FREQUENCIES.length; i++) {
|
for (let i = 0; i < LLPW_FREQUENCIES.length; i++) {
|
||||||
CiderAudio.audioNodes.llpw[i] = CiderAudio.context.createBiquadFilter();
|
CiderAudio.audioNodes.llpw[i] = CiderAudio.context.createBiquadFilter();
|
||||||
CiderAudio.audioNodes.llpw[i].type = 'peaking'; // 'peaking';
|
CiderAudio.audioNodes.llpw[i].type = 'peaking'; // 'peaking';
|
||||||
CiderAudio.audioNodes.llpw[i].frequency.value = LLPW_FREQUENCIES[i];
|
CiderAudio.audioNodes.llpw[i].frequency.value = LLPW_FREQUENCIES[i] ;
|
||||||
CiderAudio.audioNodes.llpw[i].Q.value = LLPW_Q[i];
|
CiderAudio.audioNodes.llpw[i].Q.value = LLPW_Q[i];
|
||||||
CiderAudio.audioNodes.llpw[i].gain.value = LLPW_GAIN[i];
|
CiderAudio.audioNodes.llpw[i].gain.value = LLPW_GAIN[i];
|
||||||
}
|
}
|
||||||
|
@ -435,7 +435,7 @@ const CiderAudio = {
|
||||||
for (let i = 0; i < c_LLPW_FREQUENCIES.length; i++) {
|
for (let i = 0; i < c_LLPW_FREQUENCIES.length; i++) {
|
||||||
CiderAudio.audioNodes.llpw[i] = CiderAudio.context.createBiquadFilter();
|
CiderAudio.audioNodes.llpw[i] = CiderAudio.context.createBiquadFilter();
|
||||||
CiderAudio.audioNodes.llpw[i].type = 'peaking'; // 'peaking';
|
CiderAudio.audioNodes.llpw[i].type = 'peaking'; // 'peaking';
|
||||||
CiderAudio.audioNodes.llpw[i].frequency.value = c_LLPW_FREQUENCIES[i];
|
CiderAudio.audioNodes.llpw[i].frequency.value = c_LLPW_FREQUENCIES[i] ;
|
||||||
CiderAudio.audioNodes.llpw[i].Q.value = c_LLPW_Q[i];
|
CiderAudio.audioNodes.llpw[i].Q.value = c_LLPW_Q[i];
|
||||||
CiderAudio.audioNodes.llpw[i].gain.value = c_LLPW_GAIN[i];
|
CiderAudio.audioNodes.llpw[i].gain.value = c_LLPW_GAIN[i];
|
||||||
}
|
}
|
||||||
|
@ -496,7 +496,7 @@ const CiderAudio = {
|
||||||
for (let i = 0; i < VIBRANTBASSBANDS.length; i++) {
|
for (let i = 0; i < VIBRANTBASSBANDS.length; i++) {
|
||||||
CiderAudio.audioNodes.vibrantbassNode[i] = CiderAudio.context.createBiquadFilter();
|
CiderAudio.audioNodes.vibrantbassNode[i] = CiderAudio.context.createBiquadFilter();
|
||||||
CiderAudio.audioNodes.vibrantbassNode[i].type = 'peaking'; // 'peaking';
|
CiderAudio.audioNodes.vibrantbassNode[i].type = 'peaking'; // 'peaking';
|
||||||
CiderAudio.audioNodes.vibrantbassNode[i].frequency.value = VIBRANTBASSBANDS[i];
|
CiderAudio.audioNodes.vibrantbassNode[i].frequency.value = VIBRANTBASSBANDS[i] ;
|
||||||
CiderAudio.audioNodes.vibrantbassNode[i].Q.value = VIBRANTBASSQ[i];
|
CiderAudio.audioNodes.vibrantbassNode[i].Q.value = VIBRANTBASSQ[i];
|
||||||
CiderAudio.audioNodes.vibrantbassNode[i].gain.value = VIBRANTBASSGAIN[i] * (app.cfg.audio.equalizer.vibrantBass / 10);
|
CiderAudio.audioNodes.vibrantbassNode[i].gain.value = VIBRANTBASSGAIN[i] * (app.cfg.audio.equalizer.vibrantBass / 10);
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
|
@ -173,6 +173,7 @@
|
||||||
.app-chrome--right {
|
.app-chrome--right {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
|
padding-right: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.collection-page {
|
.collection-page {
|
||||||
|
|
|
@ -297,10 +297,10 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
this.lz = ipcRenderer.sendSync("get-i18n", lang)
|
this.lz = ipcRenderer.sendSync("get-i18n", lang)
|
||||||
this.mklang = await this.MKJSLang()
|
this.mklang = await this.MKJSLang()
|
||||||
try{
|
try {
|
||||||
this.listennow.timestamp = 0;
|
this.listennow.timestamp = 0;
|
||||||
this.browsepage.timestamp = 0;
|
this.browsepage.timestamp = 0;
|
||||||
}catch(e){}
|
} catch (e) { }
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Grabs translation for localization.
|
* Grabs translation for localization.
|
||||||
|
@ -604,6 +604,11 @@ const app = new Vue({
|
||||||
try {
|
try {
|
||||||
// Set profile name
|
// Set profile name
|
||||||
this.chrome.userinfo = (await app.mk.api.v3.music(`/v1/me/social-profile`)).data.data[0]
|
this.chrome.userinfo = (await app.mk.api.v3.music(`/v1/me/social-profile`)).data.data[0]
|
||||||
|
// check if this.chrome.userinfo.attributes.artwork exists
|
||||||
|
if (this.chrome.userinfo.attributes.artwork) {
|
||||||
|
document.documentElement.style
|
||||||
|
.setProperty('--cvar-userprofileimg', `url("${this.getMediaItemArtwork(this.chrome.userinfo.attributes.artwork.url)}")`);
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1421,15 +1426,15 @@ const app = new Vue({
|
||||||
const datetime = new Date(seconds * 1000)
|
const datetime = new Date(seconds * 1000)
|
||||||
|
|
||||||
if (format === "long") {
|
if (format === "long") {
|
||||||
const d = Math.floor(seconds / (3600*24));
|
const d = Math.floor(seconds / (3600 * 24));
|
||||||
const h = Math.floor(seconds % (3600*24) / 3600);
|
const h = Math.floor(seconds % (3600 * 24) / 3600);
|
||||||
const m = Math.floor(seconds % 3600 / 60);
|
const m = Math.floor(seconds % 3600 / 60);
|
||||||
const s = Math.floor(seconds % 60);
|
const s = Math.floor(seconds % 60);
|
||||||
|
|
||||||
const dDisplay = d > 0 ? `${d} ${app.getLz("term.time.day", {"count": d})}, ` : "";
|
const dDisplay = d > 0 ? `${d} ${app.getLz("term.time.day", { "count": d })}, ` : "";
|
||||||
const hDisplay = h > 0 ? `${h} ${app.getLz("term.time.hour", {"count": h})}, ` : "";
|
const hDisplay = h > 0 ? `${h} ${app.getLz("term.time.hour", { "count": h })}, ` : "";
|
||||||
const mDisplay = m > 0 ? `${m} ${app.getLz("term.time.minute", {"count": m})}, ` : "";
|
const mDisplay = m > 0 ? `${m} ${app.getLz("term.time.minute", { "count": m })}, ` : "";
|
||||||
const sDisplay = s > 0 ? `${s} ${app.getLz("term.time.second", {"count": s})}` : "";
|
const sDisplay = s > 0 ? `${s} ${app.getLz("term.time.second", { "count": s })}` : "";
|
||||||
|
|
||||||
return dDisplay + hDisplay + mDisplay + sDisplay;
|
return dDisplay + hDisplay + mDisplay + sDisplay;
|
||||||
}
|
}
|
||||||
|
@ -1486,7 +1491,7 @@ const app = new Vue({
|
||||||
let page = hash[0]
|
let page = hash[0]
|
||||||
let id = hash[1]
|
let id = hash[1]
|
||||||
let isLibrary = hash[2] ?? false
|
let isLibrary = hash[2] ?? false
|
||||||
if(page == "plugin") {
|
if (page == "plugin") {
|
||||||
this.pluginPages.page = "plugin." + id
|
this.pluginPages.page = "plugin." + id
|
||||||
this.page = "plugin-renderer"
|
this.page = "plugin-renderer"
|
||||||
return
|
return
|
||||||
|
@ -2324,8 +2329,8 @@ const app = new Vue({
|
||||||
getTotalTime() {
|
getTotalTime() {
|
||||||
try {
|
try {
|
||||||
if (app.showingPlaylist.relationships.tracks.data.length === 0) return ""
|
if (app.showingPlaylist.relationships.tracks.data.length === 0) return ""
|
||||||
const timeInSeconds = Math.round([].concat(...app.showingPlaylist.relationships.tracks.data).reduce((a, {attributes: {durationInMillis}}) => a + durationInMillis, 0) / 1000);
|
const timeInSeconds = Math.round([].concat(...app.showingPlaylist.relationships.tracks.data).reduce((a, { attributes: { durationInMillis } }) => a + durationInMillis, 0) / 1000);
|
||||||
return `${app.showingPlaylist.relationships.tracks.data.length} ${app.getLz("term.track", {"count": app.showingPlaylist.relationships.tracks.data.length})}, ${app.convertTime(timeInSeconds, 'long')}`
|
return `${app.showingPlaylist.relationships.tracks.data.length} ${app.getLz("term.track", { "count": app.showingPlaylist.relationships.tracks.data.length })}, ${app.convertTime(timeInSeconds, 'long')}`
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
@ -2599,33 +2604,33 @@ const app = new Vue({
|
||||||
req.open('GET', url, true);
|
req.open('GET', url, true);
|
||||||
req.setRequestHeader("authority", "apic-desktop.musixmatch.com");
|
req.setRequestHeader("authority", "apic-desktop.musixmatch.com");
|
||||||
req.onload = function () {
|
req.onload = function () {
|
||||||
try{
|
try {
|
||||||
let jsonResponse = JSON.parse(this.responseText);
|
let jsonResponse = JSON.parse(this.responseText);
|
||||||
let status2 = jsonResponse["message"]["header"]["status_code"];
|
let status2 = jsonResponse["message"]["header"]["status_code"];
|
||||||
if (status2 == 200) {
|
if (status2 == 200) {
|
||||||
let token = jsonResponse["message"]["body"]["user_token"] ?? '';
|
let token = jsonResponse["message"]["body"]["user_token"] ?? '';
|
||||||
if (token != "" && token != "UpgradeOnlyUpgradeOnlyUpgradeOnlyUpgradeOnly") {
|
if (token != "" && token != "UpgradeOnlyUpgradeOnlyUpgradeOnlyUpgradeOnly") {
|
||||||
console.log('200 token', mode);
|
console.log('200 token', mode);
|
||||||
// token good
|
// token good
|
||||||
app.mxmtoken = token;
|
app.mxmtoken = token;
|
||||||
|
|
||||||
if (mode == 1) {
|
if (mode == 1) {
|
||||||
getMXMSubs(track, artist, app.mxmtoken, lang, time, id);
|
getMXMSubs(track, artist, app.mxmtoken, lang, time, id);
|
||||||
|
} else {
|
||||||
|
getMXMTrans(songid, lang, app.mxmtoken);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
getMXMTrans(songid, lang, app.mxmtoken);
|
console.log('fake 200 token');
|
||||||
|
getToken(mode, track, artist, songid, lang, time)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('fake 200 token');
|
// console.log('token 4xx');
|
||||||
getToken(mode, track, artist, songid, lang, time)
|
getToken(mode, track, artist, songid, lang, time)
|
||||||
}
|
}
|
||||||
} else {
|
} catch (e) {
|
||||||
// console.log('token 4xx');
|
console.log('error');
|
||||||
getToken(mode, track, artist, songid, lang, time)
|
app.loadAMLyrics();
|
||||||
}
|
}
|
||||||
}catch(e){
|
|
||||||
console.log('error');
|
|
||||||
app.loadAMLyrics();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
req.onerror = function () {
|
req.onerror = function () {
|
||||||
console.log('error');
|
console.log('error');
|
||||||
|
@ -2646,85 +2651,86 @@ const app = new Vue({
|
||||||
req.open('GET', url, true);
|
req.open('GET', url, true);
|
||||||
req.setRequestHeader("authority", "apic-desktop.musixmatch.com");
|
req.setRequestHeader("authority", "apic-desktop.musixmatch.com");
|
||||||
req.onload = function () {
|
req.onload = function () {
|
||||||
try{
|
try {
|
||||||
let jsonResponse = JSON.parse(this.responseText);
|
let jsonResponse = JSON.parse(this.responseText);
|
||||||
console.log(jsonResponse);
|
console.log(jsonResponse);
|
||||||
let status1 = jsonResponse["message"]["header"]["status_code"];
|
let status1 = jsonResponse["message"]["header"]["status_code"];
|
||||||
|
|
||||||
if (status1 == 200) {
|
if (status1 == 200) {
|
||||||
let id = '';
|
let id = '';
|
||||||
try {
|
try {
|
||||||
if (jsonResponse["message"]["body"]["macro_calls"]["matcher.track.get"]["message"]["header"]["status_code"] == 200 && jsonResponse["message"]["body"]["macro_calls"]["track.subtitles.get"]["message"]["header"]["status_code"] == 200) {
|
if (jsonResponse["message"]["body"]["macro_calls"]["matcher.track.get"]["message"]["header"]["status_code"] == 200 && jsonResponse["message"]["body"]["macro_calls"]["track.subtitles.get"]["message"]["header"]["status_code"] == 200) {
|
||||||
id = jsonResponse["message"]["body"]["macro_calls"]["matcher.track.get"]["message"]["body"]["track"]["track_id"] ?? '';
|
id = jsonResponse["message"]["body"]["macro_calls"]["matcher.track.get"]["message"]["body"]["track"]["track_id"] ?? '';
|
||||||
lrcfile = jsonResponse["message"]["body"]["macro_calls"]["track.subtitles.get"]["message"]["body"]["subtitle_list"][0]["subtitle"]["subtitle_body"];
|
lrcfile = jsonResponse["message"]["body"]["macro_calls"]["track.subtitles.get"]["message"]["body"]["subtitle_list"][0]["subtitle"]["subtitle_body"];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let lrcrich = jsonResponse["message"]["body"]["macro_calls"]["track.richsync.get"]["message"]["body"]["richsync"]["richsync_body"];
|
let lrcrich = jsonResponse["message"]["body"]["macro_calls"]["track.richsync.get"]["message"]["body"]["richsync"]["richsync_body"];
|
||||||
richsync = JSON.parse(lrcrich);
|
richsync = JSON.parse(lrcrich);
|
||||||
app.richlyrics = richsync;
|
app.richlyrics = richsync;
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lrcfile == "") {
|
|
||||||
app.loadAMLyrics()
|
|
||||||
} else {
|
|
||||||
if (richsync == [] || richsync.length == 0) {
|
|
||||||
console.log("ok");
|
|
||||||
// process lrcfile to json here
|
|
||||||
app.lyricsMediaItem = lrcfile
|
|
||||||
let u = app.lyricsMediaItem.split(/[\r\n]/);
|
|
||||||
let preLrc = []
|
|
||||||
for (var i = u.length - 1; i >= 0; i--) {
|
|
||||||
let xline = (/(\[[0-9.:\[\]]*\])+(.*)/).exec(u[i])
|
|
||||||
let end = (preLrc.length > 0) ? ((preLrc[preLrc.length - 1].startTime) ?? 99999) : 99999
|
|
||||||
preLrc.push({
|
|
||||||
startTime: app.toMS(xline[1].substring(1, xline[1].length - 2)) ?? 0,
|
|
||||||
endTime: end,
|
|
||||||
line: xline[2],
|
|
||||||
translation: ''
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
if (preLrc.length > 0)
|
|
||||||
preLrc.push({
|
|
||||||
startTime: 0,
|
|
||||||
endTime: preLrc[preLrc.length - 1].startTime,
|
|
||||||
line: "lrcInstrumental",
|
|
||||||
translation: ''
|
|
||||||
});
|
|
||||||
app.lyrics = preLrc.reverse();
|
|
||||||
} else {
|
|
||||||
let preLrc = richsync.map(function (item) {
|
|
||||||
return {
|
|
||||||
startTime: item.ts,
|
|
||||||
endTime: item.te,
|
|
||||||
line: item.x,
|
|
||||||
translation: ''
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (preLrc.length > 0)
|
|
||||||
preLrc.unshift({
|
|
||||||
startTime: 0,
|
|
||||||
endTime: preLrc[0].startTime,
|
|
||||||
line: "lrcInstrumental",
|
|
||||||
translation: ''
|
|
||||||
});
|
|
||||||
app.lyrics = preLrc;
|
|
||||||
}
|
}
|
||||||
if (lrcfile != null && lrcfile != '' && lang != "disabled") {
|
|
||||||
// load translation
|
if (lrcfile == "") {
|
||||||
getMXMTrans(id, lang, token);
|
|
||||||
} else {
|
|
||||||
app.loadAMLyrics()
|
app.loadAMLyrics()
|
||||||
|
} else {
|
||||||
|
if (richsync == [] || richsync.length == 0) {
|
||||||
|
console.log("ok");
|
||||||
|
// process lrcfile to json here
|
||||||
|
app.lyricsMediaItem = lrcfile
|
||||||
|
let u = app.lyricsMediaItem.split(/[\r\n]/);
|
||||||
|
let preLrc = []
|
||||||
|
for (var i = u.length - 1; i >= 0; i--) {
|
||||||
|
let xline = (/(\[[0-9.:\[\]]*\])+(.*)/).exec(u[i])
|
||||||
|
let end = (preLrc.length > 0) ? ((preLrc[preLrc.length - 1].startTime) ?? 99999) : 99999
|
||||||
|
preLrc.push({
|
||||||
|
startTime: app.toMS(xline[1].substring(1, xline[1].length - 2)) ?? 0,
|
||||||
|
endTime: end,
|
||||||
|
line: xline[2],
|
||||||
|
translation: ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (preLrc.length > 0)
|
||||||
|
preLrc.push({
|
||||||
|
startTime: 0,
|
||||||
|
endTime: preLrc[preLrc.length - 1].startTime,
|
||||||
|
line: "lrcInstrumental",
|
||||||
|
translation: ''
|
||||||
|
});
|
||||||
|
app.lyrics = preLrc.reverse();
|
||||||
|
} else {
|
||||||
|
let preLrc = richsync.map(function (item) {
|
||||||
|
return {
|
||||||
|
startTime: item.ts,
|
||||||
|
endTime: item.te,
|
||||||
|
line: item.x,
|
||||||
|
translation: ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (preLrc.length > 0)
|
||||||
|
preLrc.unshift({
|
||||||
|
startTime: 0,
|
||||||
|
endTime: preLrc[0].startTime,
|
||||||
|
line: "lrcInstrumental",
|
||||||
|
translation: ''
|
||||||
|
});
|
||||||
|
app.lyrics = preLrc;
|
||||||
|
}
|
||||||
|
if (lrcfile != null && lrcfile != '' && lang != "disabled") {
|
||||||
|
// load translation
|
||||||
|
getMXMTrans(id, lang, token);
|
||||||
|
} else {
|
||||||
|
app.loadAMLyrics()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
app.loadAMLyrics()
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} else { //4xx rejected
|
||||||
console.log(e);
|
getToken(1, track, artist, '', lang, time);
|
||||||
app.loadAMLyrics()
|
|
||||||
}
|
}
|
||||||
} else { //4xx rejected
|
} catch (e) {
|
||||||
getToken(1, track, artist, '', lang, time);
|
|
||||||
}}catch(e){
|
|
||||||
console.log(e);
|
console.log(e);
|
||||||
app.loadAMLyrics()
|
app.loadAMLyrics()
|
||||||
}
|
}
|
||||||
|
@ -2745,33 +2751,34 @@ const app = new Vue({
|
||||||
req2.open('GET', url2, true);
|
req2.open('GET', url2, true);
|
||||||
req2.setRequestHeader("authority", "apic-desktop.musixmatch.com");
|
req2.setRequestHeader("authority", "apic-desktop.musixmatch.com");
|
||||||
req2.onload = function () {
|
req2.onload = function () {
|
||||||
try{
|
try {
|
||||||
let jsonResponse2 = JSON.parse(this.responseText);
|
let jsonResponse2 = JSON.parse(this.responseText);
|
||||||
console.log(jsonResponse2);
|
console.log(jsonResponse2);
|
||||||
let status2 = jsonResponse2["message"]["header"]["status_code"];
|
let status2 = jsonResponse2["message"]["header"]["status_code"];
|
||||||
if (status2 == 200) {
|
if (status2 == 200) {
|
||||||
try {
|
try {
|
||||||
let preTrans = []
|
let preTrans = []
|
||||||
let u = app.lyrics;
|
let u = app.lyrics;
|
||||||
let translation_list = jsonResponse2["message"]["body"]["translations_list"];
|
let translation_list = jsonResponse2["message"]["body"]["translations_list"];
|
||||||
if (translation_list.length > 0) {
|
if (translation_list.length > 0) {
|
||||||
for (var i = 0; i < u.length - 1; i++) {
|
for (var i = 0; i < u.length - 1; i++) {
|
||||||
preTrans[i] = ""
|
preTrans[i] = ""
|
||||||
for (var trans_line of translation_list) {
|
for (var trans_line of translation_list) {
|
||||||
if (u[i].line == " " + trans_line["translation"]["matched_line"] || u[i].line == trans_line["translation"]["matched_line"]) {
|
if (u[i].line == " " + trans_line["translation"]["matched_line"] || u[i].line == trans_line["translation"]["matched_line"]) {
|
||||||
u[i].translation = trans_line["translation"]["description"];
|
u[i].translation = trans_line["translation"]["description"];
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
app.lyrics = u;
|
||||||
}
|
}
|
||||||
app.lyrics = u;
|
} catch (e) {
|
||||||
|
/// not found trans -> ignore
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} else { //4xx rejected
|
||||||
/// not found trans -> ignore
|
getToken(2, '', '', id, lang, '');
|
||||||
}
|
}
|
||||||
} else { //4xx rejected
|
} catch (e) { }
|
||||||
getToken(2, '', '', id, lang, '');
|
|
||||||
}}catch(e){}
|
|
||||||
}
|
}
|
||||||
req2.send();
|
req2.send();
|
||||||
}
|
}
|
||||||
|
@ -3732,7 +3739,7 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(app.mk.nowPlayingItem._container["attributes"] && app.mk.nowPlayingItem._container.name != "station") {
|
if (app.mk.nowPlayingItem._container["attributes"] && app.mk.nowPlayingItem._container.name != "station") {
|
||||||
menus.normal.items.find(x => x.id == "showInMusic").hidden = false
|
menus.normal.items.find(x => x.id == "showInMusic").hidden = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -929,14 +929,29 @@
|
||||||
},
|
},
|
||||||
toggleAudioContext: function () {
|
toggleAudioContext: function () {
|
||||||
if (app.cfg.advanced.AudioContext === true) {
|
if (app.cfg.advanced.AudioContext === true) {
|
||||||
CiderAudio.init();
|
if (navigator.hardwareConcurrency < 6) {
|
||||||
if (app.cfg.audio.normalization === true) {
|
bootbox.confirm("Cider detects less than 6 logical processors, turning this on will most certainly lag. Are you sure you want to continue?", function (result) {
|
||||||
CiderAudio.normalizerOn()
|
if (result) {
|
||||||
}
|
CiderAudio.init();
|
||||||
if (app.cfg.audio.spatial === true) {
|
if (app.cfg.audio.normalization === true) {
|
||||||
CiderAudio.spatialOn()
|
CiderAudio.normalizerOn()
|
||||||
CiderAudio.hierarchical_loading();
|
}
|
||||||
|
if (app.cfg.audio.spatial === true) {
|
||||||
|
CiderAudio.spatialOn()
|
||||||
|
CiderAudio.hierarchical_loading();
|
||||||
|
}
|
||||||
|
}})
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
CiderAudio.init();
|
||||||
|
if (app.cfg.audio.normalization === true) {
|
||||||
|
CiderAudio.normalizerOn()
|
||||||
|
}
|
||||||
|
if (app.cfg.audio.spatial === true) {
|
||||||
|
CiderAudio.spatialOn()
|
||||||
|
CiderAudio.hierarchical_loading();
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
CiderAudio.off();
|
CiderAudio.off();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue