Merge branch 'develop' of https://github.com/ciderapp/Cider into develop
This commit is contained in:
commit
0875c4eaa8
6 changed files with 320 additions and 253 deletions
|
@ -46,6 +46,10 @@ app.on('ready', () => {
|
||||||
const bw = new BrowserWindow()
|
const bw = new BrowserWindow()
|
||||||
const win = await bw.createWindow()
|
const win = await bw.createWindow()
|
||||||
|
|
||||||
|
app.getGPUInfo("complete").then(gpuInfo => {
|
||||||
|
console.log(gpuInfo)
|
||||||
|
})
|
||||||
|
|
||||||
console.log('[Cider][Widevine] Status:', components.status());
|
console.log('[Cider][Widevine] Status:', components.status());
|
||||||
|
|
||||||
win.on("ready-to-show", () => {
|
win.on("ready-to-show", () => {
|
||||||
|
|
|
@ -20,7 +20,8 @@ const CiderFrontAPI = {
|
||||||
MenuEntry: function () {
|
MenuEntry: function () {
|
||||||
this.id = ""
|
this.id = ""
|
||||||
this.name = ""
|
this.name = ""
|
||||||
this.onClick = () => { }
|
this.onClick = () => {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
AddMenuEntry(entry) {
|
AddMenuEntry(entry) {
|
||||||
|
@ -354,7 +355,9 @@ const app = new Vue({
|
||||||
// fallback English plural forms ( old i18n )
|
// fallback English plural forms ( old i18n )
|
||||||
if (options["count"] > 1) {
|
if (options["count"] > 1) {
|
||||||
return this.lz[message + "s"] ?? this.lz[message]
|
return this.lz[message + "s"] ?? this.lz[message]
|
||||||
} else { return this.lz[message] ?? this.lz[message + "s"] }
|
} else {
|
||||||
|
return this.lz[message] ?? this.lz[message + "s"]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (typeof this.lz[message] === "object") {
|
} else if (typeof this.lz[message] === "object") {
|
||||||
return (this.lz[message])[Object.keys(this.lz[message])[0]]
|
return (this.lz[message])[Object.keys(this.lz[message])[0]]
|
||||||
|
@ -776,7 +779,8 @@ const app = new Vue({
|
||||||
let replaygain = self.parseSCTagToRG(tag)
|
let replaygain = self.parseSCTagToRG(tag)
|
||||||
try {
|
try {
|
||||||
CiderAudio.audioNodes.gainNode.gain.value = (Math.min(Math.pow(10, (replaygain.gain / 20)), (1 / replaygain.peak)))
|
CiderAudio.audioNodes.gainNode.gain.value = (Math.min(Math.pow(10, (replaygain.gain / 20)), (1 / replaygain.peak)))
|
||||||
} catch (e) { }
|
} catch (e) {
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcRenderer.on('play', function (_event, mode, id) {
|
ipcRenderer.on('play', function (_event, mode, id) {
|
||||||
|
@ -1429,11 +1433,19 @@ const app = new Vue({
|
||||||
prevButton() {
|
prevButton() {
|
||||||
if (!app.prevButtonBackIndicator && app.mk.nowPlayingItem && app.mk.currentPlaybackTime > 2) {
|
if (!app.prevButtonBackIndicator && app.mk.nowPlayingItem && app.mk.currentPlaybackTime > 2) {
|
||||||
app.prevButtonBackIndicator = true;
|
app.prevButtonBackIndicator = true;
|
||||||
try { clearTimeout(app.pauseButtonTimer) } catch (e) { }
|
try {
|
||||||
|
clearTimeout(app.pauseButtonTimer)
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
app.mk.seekToTime(0);
|
app.mk.seekToTime(0);
|
||||||
app.pauseButtonTimer = setTimeout(() => { app.prevButtonBackIndicator = false }, 3000);
|
app.pauseButtonTimer = setTimeout(() => {
|
||||||
|
app.prevButtonBackIndicator = false
|
||||||
|
}, 3000);
|
||||||
} else {
|
} else {
|
||||||
try { clearTimeout(app.pauseButtonTimer) } catch (e) { }
|
try {
|
||||||
|
clearTimeout(app.pauseButtonTimer)
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
app.prevButtonBackIndicator = false;
|
app.prevButtonBackIndicator = false;
|
||||||
app.skipToPreviousItem()
|
app.skipToPreviousItem()
|
||||||
}
|
}
|
||||||
|
@ -1680,8 +1692,11 @@ const app = new Vue({
|
||||||
searchLibrarySongs() {
|
searchLibrarySongs() {
|
||||||
let self = this
|
let self = this
|
||||||
let prefs = this.cfg.libraryPrefs.songs
|
let prefs = this.cfg.libraryPrefs.songs
|
||||||
let albumAdded = self.library?.albums?.listing?.map(function (i) { return { [i.id]: i.attributes?.dateAdded } })
|
let albumAdded = self.library?.albums?.listing?.map(function (i) {
|
||||||
|
return {[i.id]: i.attributes?.dateAdded}
|
||||||
|
})
|
||||||
let startTime = new Date().getTime()
|
let startTime = new Date().getTime()
|
||||||
|
|
||||||
function sortSongs() {
|
function sortSongs() {
|
||||||
// sort this.library.songs.displayListing by song.attributes[self.library.songs.sorting] in descending or ascending order based on alphabetical order and numeric order
|
// sort this.library.songs.displayListing by song.attributes[self.library.songs.sorting] in descending or ascending order based on alphabetical order and numeric order
|
||||||
// check if song.attributes[self.library.songs.sorting] is a number and if so, sort by number if not, sort by alphabetical order ignoring case
|
// check if song.attributes[self.library.songs.sorting] is a number and if so, sort by number if not, sort by alphabetical order ignoring case
|
||||||
|
@ -2902,7 +2917,8 @@ const app = new Vue({
|
||||||
let u = data.map(x => x.id)
|
let u = data.map(x => x.id)
|
||||||
try {
|
try {
|
||||||
data.splice(u.indexOf(item.attributes.playParams.id ?? item.id), 1)
|
data.splice(u.indexOf(item.attributes.playParams.id ?? item.id), 1)
|
||||||
} catch (e) { }
|
} catch (e) {
|
||||||
|
}
|
||||||
if (app.mk.shuffleMode == 1) {
|
if (app.mk.shuffleMode == 1) {
|
||||||
shuffleArray(data)
|
shuffleArray(data)
|
||||||
}
|
}
|
||||||
|
@ -2960,8 +2976,7 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
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({
|
||||||
|
@ -3323,7 +3338,10 @@ 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"], parameters: { l: app.mklang } }).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()
|
||||||
|
@ -3550,22 +3568,32 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
items: [{
|
items: [
|
||||||
"icon": "./assets/feather/list.svg",
|
|
||||||
"name": app.getLz('action.addToPlaylist') + " ...",
|
|
||||||
"action": function () {
|
|
||||||
app.promptAddToPlaylist()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"icon": "./assets/feather/plus.svg",
|
"icon": "./assets/feather/plus.svg",
|
||||||
"id": "addToLibrary",
|
"id": "addToLibrary",
|
||||||
"name": app.getLz('action.addToLibrary') + " ...",
|
"name": app.getLz('action.addToLibrary') + " ...",
|
||||||
"disabled": false,
|
"disabled": true,
|
||||||
"action": function () {
|
"action": function () {
|
||||||
app.addToLibrary(app.mk.nowPlayingItem.id);
|
app.addToLibrary(app.mk.nowPlayingItem.id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "removeFromLibrary",
|
||||||
|
"icon": "./assets/feather/x-circle.svg",
|
||||||
|
"name": app.getLz('action.removeFromLibrary'),
|
||||||
|
"hidden": true,
|
||||||
|
"action": function () {
|
||||||
|
self.removeFromLibrary()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon": "./assets/feather/list.svg",
|
||||||
|
"name": app.getLz('action.addToPlaylist') + " ...",
|
||||||
|
"action": function () {
|
||||||
|
app.promptAddToPlaylist()
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon": "./assets/feather/radio.svg",
|
"icon": "./assets/feather/radio.svg",
|
||||||
"name": app.getLz('action.startRadio'),
|
"name": app.getLz('action.startRadio'),
|
||||||
|
@ -3576,6 +3604,20 @@ const app = new Vue({
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon": "./assets/feather/user.svg",
|
||||||
|
"name": app.getLz('action.goToArtist'),
|
||||||
|
"action": function () {
|
||||||
|
app.appRoute(`artist/${app.mk.nowPlayingItem.relationships.artists.data[0].id}`)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"icon": "./assets/feather/disc.svg",
|
||||||
|
"name": app.getLz('action.goToAlbum'),
|
||||||
|
"action": function () {
|
||||||
|
app.appRoute(`album/${app.mk.nowPlayingItem.relationships.albums.data[0].id}`)
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon": "./assets/feather/share.svg",
|
"icon": "./assets/feather/share.svg",
|
||||||
"name": app.getLz('action.share'),
|
"name": app.getLz('action.share'),
|
||||||
|
@ -3604,6 +3646,18 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
this.showMenuPanel(menus[useMenu], event)
|
this.showMenuPanel(menus[useMenu], event)
|
||||||
|
|
||||||
|
try {
|
||||||
|
let result = await this.inLibrary([this.mk.nowPlayingItem])
|
||||||
|
if (result[0].attributes.inLibrary) {
|
||||||
|
menus.normal.items.find(x => x.id == 'addToLibrary').hidden = true
|
||||||
|
menus.normal.items.find(x => x.id == 'removeFromLibrary').hidden = false
|
||||||
|
} else {
|
||||||
|
menus.normal.items.find(x => x.id == 'addToLibrary').disabled = false
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
e = null
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let rating = await app.getRating(app.mk.nowPlayingItem)
|
let rating = await app.getRating(app.mk.nowPlayingItem)
|
||||||
if (rating == 0) {
|
if (rating == 0) {
|
||||||
|
@ -3789,7 +3843,9 @@ const app = new Vue({
|
||||||
try {
|
try {
|
||||||
let item = await MusicKit.getInstance().api.v3.music(`v1/storefronts/${app.mk.storefrontId}`)
|
let item = await MusicKit.getInstance().api.v3.music(`v1/storefronts/${app.mk.storefrontId}`)
|
||||||
let langcodes = item.data.data[0].attributes.supportedLanguageTags;
|
let langcodes = item.data.data[0].attributes.supportedLanguageTags;
|
||||||
if (langcodes) langcodes = langcodes.map(function (u) { return u.replace(/-Han[s|t]/i, "").toLowerCase() })
|
if (langcodes) langcodes = langcodes.map(function (u) {
|
||||||
|
return u.replace(/-Han[s|t]/i, "").toLowerCase()
|
||||||
|
})
|
||||||
console.log(langcodes)
|
console.log(langcodes)
|
||||||
let sellang = ""
|
let sellang = ""
|
||||||
if (u && langcodes.includes(u.toLowerCase().replace('_', "-"))) {
|
if (u && langcodes.includes(u.toLowerCase().replace('_', "-"))) {
|
||||||
|
@ -3805,8 +3861,7 @@ const app = new Vue({
|
||||||
|
|
||||||
console.log(sellang)
|
console.log(sellang)
|
||||||
return await sellang
|
return await sellang
|
||||||
}
|
} catch (err) {
|
||||||
catch (err) {
|
|
||||||
console.log('locale err', err)
|
console.log('locale err', err)
|
||||||
let langcodes = ['af', 'sq', 'ar', 'eu', 'bg', 'be', 'ca', 'zh', 'zh-tw', 'zh-cn', 'zh-hk', 'zh-sg', 'hr', 'cs', 'da', 'nl', 'nl-be', 'en', 'en-us', 'en-eg', 'en-au', 'en-gb', 'en-ca', 'en-nz', 'en-ie', 'en-za', 'en-jm', 'en-bz', 'en-tt', 'en-001', 'et', 'fo', 'fa', 'fi', 'fr', 'fr-ca', 'gd', 'de', 'de-ch', 'el', 'he', 'hi', 'hu', 'is', 'id', 'it', 'ja', 'ko', 'lv', 'lt', 'mk', 'mt', 'no', 'nb', 'nn', 'pl', 'pt-br', 'pt', 'rm', 'ro', 'ru', 'sr', 'sk', 'sl', 'es', 'es-mx', 'es-419', 'sv', 'th', 'ts', 'tn', 'tr', 'uk', 'ur', 've', 'vi', 'xh', 'yi', 'zu', 'ms', 'iw', 'lo', 'tl', 'kk', 'ta', 'te', 'bn', 'ga', 'ht', 'la', 'pa', 'sa'];
|
let langcodes = ['af', 'sq', 'ar', 'eu', 'bg', 'be', 'ca', 'zh', 'zh-tw', 'zh-cn', 'zh-hk', 'zh-sg', 'hr', 'cs', 'da', 'nl', 'nl-be', 'en', 'en-us', 'en-eg', 'en-au', 'en-gb', 'en-ca', 'en-nz', 'en-ie', 'en-za', 'en-jm', 'en-bz', 'en-tt', 'en-001', 'et', 'fo', 'fa', 'fi', 'fr', 'fr-ca', 'gd', 'de', 'de-ch', 'el', 'he', 'hi', 'hu', 'is', 'id', 'it', 'ja', 'ko', 'lv', 'lt', 'mk', 'mt', 'no', 'nb', 'nn', 'pl', 'pt-br', 'pt', 'rm', 'ro', 'ru', 'sr', 'sk', 'sl', 'es', 'es-mx', 'es-419', 'sv', 'th', 'ts', 'tn', 'tr', 'uk', 'ur', 've', 'vi', 'xh', 'yi', 'zu', 'ms', 'iw', 'lo', 'tl', 'kk', 'ta', 'te', 'bn', 'ga', 'ht', 'la', 'pa', 'sa'];
|
||||||
let sellang = "en"
|
let sellang = "en"
|
||||||
|
@ -3831,8 +3886,12 @@ const app = new Vue({
|
||||||
this.mk.changeToMediaAtIndex(this.mk.queue.previousPlayableItemIndex);
|
this.mk.changeToMediaAtIndex(this.mk.queue.previousPlayableItemIndex);
|
||||||
},
|
},
|
||||||
mediaKeyFixes() {
|
mediaKeyFixes() {
|
||||||
navigator.mediaSession.setActionHandler('previoustrack', function () { app.prevButton() });
|
navigator.mediaSession.setActionHandler('previoustrack', function () {
|
||||||
navigator.mediaSession.setActionHandler('nexttrack', function () { app.skipToNextItem() });
|
app.prevButton()
|
||||||
|
});
|
||||||
|
navigator.mediaSession.setActionHandler('nexttrack', function () {
|
||||||
|
app.skipToNextItem()
|
||||||
|
});
|
||||||
},
|
},
|
||||||
checkForUpdate() {
|
checkForUpdate() {
|
||||||
ipcRenderer.send('check-for-update')
|
ipcRenderer.send('check-for-update')
|
||||||
|
|
|
@ -307,7 +307,7 @@
|
||||||
text-align: left;
|
text-align: left;
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 12px 16px;
|
padding: 10px 16px;
|
||||||
appearance: none;
|
appearance: none;
|
||||||
border: 0px;
|
border: 0px;
|
||||||
font: inherit;
|
font: inherit;
|
||||||
|
|
|
@ -2741,12 +2741,12 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
|
|
||||||
.wpfade_transform-enter {
|
.wpfade_transform-enter {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateX(50%);
|
transform: translateX(50%) translate3d(0,0,0);
|
||||||
will-change: opacity, transform;
|
will-change: opacity, transform;
|
||||||
}
|
}
|
||||||
.wpfade_transform-leave-to {
|
.wpfade_transform-leave-to {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%) translate3d(0,0,0);
|
||||||
will-change: opacity, transform;
|
will-change: opacity, transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2759,12 +2759,12 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
|
|
||||||
.wpfade_transform_backwards-enter {
|
.wpfade_transform_backwards-enter {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%) translate3d(0,0,0);
|
||||||
will-change: opacity, transform;
|
will-change: opacity, transform;
|
||||||
}
|
}
|
||||||
.wpfade_transform_backwards-leave-to {
|
.wpfade_transform_backwards-leave-to {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateX(50%);
|
transform: translateX(50%) translate3d(0,0,0);
|
||||||
will-change: opacity, transform;
|
will-change: opacity, transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
@keyframes menuIn {
|
@keyframes menuIn {
|
||||||
0% {
|
0% {
|
||||||
opacity : 0;
|
opacity : 0;
|
||||||
transform : translateY(-10px);
|
transform : translateY(-10px) translate3d(0,0,0);
|
||||||
background: @panelColorsFallback;
|
background: @panelColorsFallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
.artwork-container {
|
.artwork-container {
|
||||||
transform : scale(1.1) ;
|
transform : scale(1.1) translate3d(0,0,0);
|
||||||
transition : transform .1s var(--appleEase);
|
transition : transform .1s var(--appleEase);
|
||||||
transition-delay: 0s;
|
transition-delay: 0s;
|
||||||
transform-origin: center;
|
transform-origin: center;
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
z-index : 1;
|
z-index : 1;
|
||||||
transition : transform .1s var(--appleEase);
|
transition : transform .1s var(--appleEase);
|
||||||
transition-delay: 0s;
|
transition-delay: 0s;
|
||||||
transform : translateY(8px);
|
transform : translateY(8px) translate3d(0,0,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,8 @@
|
||||||
years: [],
|
years: [],
|
||||||
loaded: {
|
loaded: {
|
||||||
id: -1
|
id: -1
|
||||||
}
|
},
|
||||||
|
musicTypeGenre: ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
|
@ -101,9 +102,12 @@
|
||||||
this.years.reverse()
|
this.years.reverse()
|
||||||
localStorage.setItem("seenReplay", true)
|
localStorage.setItem("seenReplay", true)
|
||||||
this.getReplayYear();
|
this.getReplayYear();
|
||||||
|
const musicGenre = await app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/genres/34`)
|
||||||
|
this.musicTypeGenre = musicGenre.data.data[0].attributes.name
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
songsToArray(songsData) {
|
songsToArray(songsData) {
|
||||||
|
let self = this
|
||||||
let songs = []
|
let songs = []
|
||||||
let topGenres = {}
|
let topGenres = {}
|
||||||
let genrePlayCount = 0;
|
let genrePlayCount = 0;
|
||||||
|
@ -113,7 +117,7 @@
|
||||||
songs.push(song)
|
songs.push(song)
|
||||||
genrePlayCount += song.attributes.playCount
|
genrePlayCount += song.attributes.playCount
|
||||||
song.attributes.genreNames.forEach(function (genre) {
|
song.attributes.genreNames.forEach(function (genre) {
|
||||||
if (genre != "Music") {
|
if (genre != self.musicTypeGenre) {
|
||||||
if (topGenres[genre] == undefined) {
|
if (topGenres[genre] == undefined) {
|
||||||
topGenres[genre] = song.attributes.playCount
|
topGenres[genre] = song.attributes.playCount
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue