Merge branch 'main' into main-ts

This commit is contained in:
Core 2022-01-10 23:23:49 +00:00
commit f87f4ec5e5
No known key found for this signature in database
GPG key ID: 1B77805746C47C28
20 changed files with 317 additions and 252 deletions

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<false/>
</dict>
</plist>

View file

@ -37,21 +37,27 @@ const MusicKitInterop = {
const remainingTimeExport = MusicKit.getInstance().currentPlaybackTimeRemaining;
const attributes = (nowPlayingItem != null ? nowPlayingItem.attributes : {});
attributes.status = isPlayingExport ? isPlayingExport : false;
attributes.name = attributes.name ? attributes.name : 'No Title Found';
attributes.artwork = attributes.artwork ? attributes.artwork : {url: ''};
attributes.artwork.url = attributes.artwork.url ? attributes.artwork.url : '';
attributes.playParams = attributes.playParams ? attributes.playParams : {id: 'no-id-found'};
attributes.playParams.id = attributes.playParams.id ? attributes.playParams.id : 'no-id-found';
attributes.albumName = attributes.albumName ? attributes.albumName : '';
attributes.artistName = attributes.artistName ? attributes.artistName : '';
attributes.genreNames = attributes.genreNames ? attributes.genreNames : [];
attributes.remainingTime = remainingTimeExport ? (remainingTimeExport * 1000) : 0;
attributes.durationInMillis = attributes.durationInMillis ? attributes.durationInMillis : 0;
attributes.status = isPlayingExport ?? false;
attributes.name = attributes?.name ?? 'No Title Found';
attributes.artwork = attributes?.artwork ?? { url: '' };
attributes.artwork.url = attributes?.artwork?.url ?? '';
attributes.playParams = attributes?.playParams ?? { id: 'no-id-found' };
attributes.playParams.id = attributes?.playParams?.id ?? 'no-id-found';
attributes.albumName = attributes?.albumName ?? '';
attributes.artistName = attributes?.artistName ?? '';
attributes.genreNames = attributes?.genreNames ?? [];
attributes.remainingTime = remainingTimeExport
? remainingTimeExport * 1000
: 0;
attributes.durationInMillis = attributes?.durationInMillis ?? 0;
attributes.startTime = Date.now();
attributes.endTime = Math.round((attributes.playParams.id === cache.playParams.id ? (Date.now() + attributes.remainingTime) : (attributes.startTime + attributes.durationInMillis)));
attributes.endTime = attributes.endTime ? attributes.endTime : Date.now();
return attributes
attributes.endTime = Math.round(
attributes?.playParams?.id === cache.playParams.id
? Date.now() + attributes?.remainingTime
: attributes?.startTime + attributes?.durationInMillis
);
return attributes;
},
filterTrack: function (a, playbackCheck, mediaCheck) {

View file

@ -23260,7 +23260,7 @@
}
if (null != (l = "string" != typeof (h = g.pathwayID) ? im("invalid steering manifest PATHWAY-PRIORITY list item data type") : /^[\w\-\.]+$/.test(h) ? void 0 : im("steering manifest contains invalid pathway ID: " + h)))
break;
if (g.hdcpLevel === "NONE" && (g.url.includes("gr230"))){
if (g.hdcpLevel === "NONE"){
n.push(g)}
}
return {

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Svg Vector Icons : http://www.onlinewebfonts.com/icon -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
<metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
<g><path d="M663.4,336.7V226.9H336.7v546.2h326.7V663.3H446.5V553.5h216.9V446.3H446.5V336.6h216.9V336.7z M880.3,10c28.9,0,54.4,11.1,76.6,33.2c22.1,22.1,33.2,47.6,33.2,76.6v760.6c0,28.9-11.1,54.4-33.2,76.6c-22.1,22.1-47.6,33.2-76.6,33.2H119.7c-28.9,0-54.4-11.1-76.6-33.2C21.1,934.7,10,909.2,10,880.3V119.7c0-28.9,11.1-54.4,33.2-76.6C65.3,21.1,90.8,10,119.7,10H880.3z"/></g>
</svg>

After

Width:  |  Height:  |  Size: 853 B

View file

@ -1,18 +1,20 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 60 60" style="enable-background:new 0 0 60 60;" xml:space="preserve">
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
fill="white" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
<g>
<path fill="white" d="M42,12H20.414l7.293-7.293c0.391-0.391,0.391-1.023,0-1.414s-1.023-0.391-1.414,0l-8.999,8.999
c-0.093,0.092-0.166,0.203-0.217,0.326c-0.101,0.244-0.101,0.52,0,0.764c0.051,0.123,0.124,0.234,0.217,0.326l8.999,8.999
C26.488,22.902,26.744,23,27,23s0.512-0.098,0.707-0.293c0.391-0.391,0.391-1.023,0-1.414L20.414,14H42c8.822,0,16,7.178,16,16
c0,4.252-1.668,8.264-4.696,11.295c-0.391,0.391-0.391,1.024,0,1.414c0.195,0.195,0.451,0.293,0.707,0.293s0.512-0.098,0.707-0.293
C58.124,39.3,60,34.786,60,30C60,20.075,51.925,12,42,12z"/>
<path fill="white" d="M35.707,37.293c-0.391-0.391-1.023-0.391-1.414,0s-0.391,1.023,0,1.414L41.586,46H18C9.178,46,2,38.822,2,30
c0-3.783,1.359-7.46,3.828-10.354c0.358-0.421,0.309-1.052-0.111-1.41c-0.419-0.359-1.052-0.31-1.41,0.111
C1.529,21.604,0,25.741,0,30c0,9.925,8.075,18,18,18h23.586l-7.293,7.293c-0.391,0.391-0.391,1.023,0,1.414
C34.488,56.902,34.744,57,35,57s0.512-0.098,0.707-0.293l9-9c0.391-0.391,0.391-1.023,0-1.414L35.707,37.293z"/>
<g>
<g>
<path d="M482.197,374.266l-78.717-45.448c-15.89-9.174-35.829,2.308-35.829,20.686v27.587H151.058
C87.461,377.09,35.721,325.351,35.721,261.753c0-9.864-7.997-17.86-17.86-17.86c-9.864,0-17.86,7.997-17.86,17.86
c0,83.294,67.765,151.058,151.058,151.058h216.591v27.587c0,18.347,19.913,29.876,35.829,20.686l78.717-45.447
C498.086,406.465,498.113,383.456,482.197,374.266z"/>
<path d="M360.942,99.189H144.349V71.601c0-18.347-19.913-29.876-35.829-20.686L29.803,96.362
c-15.889,9.173-15.917,32.182,0,41.372l78.717,45.448c15.89,9.174,35.829-2.309,35.829-20.686v-27.587h216.593
c63.598,0,115.337,51.739,115.337,115.337c0,9.864,7.997,17.86,17.86,17.86c9.864,0,17.86-7.997,17.86-17.86
C512,166.953,444.235,99.189,360.942,99.189z"/>
</g>
</g>
</g>
<g>
</g>

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Before After
Before After

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; background: rgba(0, 0, 0, 0) none repeat scroll 0% 0%; display: block; --darkreader-inline-bgcolor: rgba(24, 26, 27, 0); --darkreader-inline-bgimage: none; shape-rendering: auto; animation-play-state: running; animation-delay: 0s;" width="200px" height="200px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" data-darkreader-inline-bgcolor="" data-darkreader-inline-bgimage="">
<circle cx="50" cy="50" r="32" stroke-width="10" stroke="#fe718d" stroke-dasharray="50.26548245743669 50.26548245743669" fill="none" stroke-linecap="round" style="--darkreader-inline-stroke: #fe6987; animation-play-state: running; animation-delay: 0s;" data-darkreader-inline-stroke="">
<animateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" keyTimes="0;1" values="0 50 50;360 50 50" style="animation-play-state: running; animation-delay: 0s;"></animateTransform>
</circle>
<!-- [ldio] generated by https://loading.io/ --></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -268,6 +268,7 @@ const app = new Vue({
drawerState: "queue",
topChromeVisible: true,
progresshover: false,
windowControlPosition: "right"
},
collectionList: {
response: {},
@ -1194,79 +1195,81 @@ const app = new Vue({
let id = (item.attributes.playParams ? (item.attributes.playParams.id ?? (item.id ?? '')) : (item.id ?? ''));
;
let isLibrary = item.attributes.playParams ? (item.attributes.playParams.isLibrary ?? false) : false;
let truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
console.log(kind, id, isLibrary)
app.mk.stop().then(() => {
if (kind.includes("artist")) {
app.mk.setStationQueue({artist: 'a-' + id}).then(() => {
app.mk.play()
})
} else if (kind.includes("playlist") && (id.startsWith("p.") || id.startsWith("pl."))){
/* Randomize array in-place using Durstenfeld shuffle algorithm */
function shuffleArray(array) {
for (var i = array.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = array[i];
array[i] = array[j];
array[j] = temp;
}
}
app.mk.clearQueue().then(function () { {
app.mk.setQueue({[item.attributes.playParams.kind ?? item.type]: item.attributes.playParams.id ?? item.id}).then(function () {
app.mk.play().then(function (){
app.mk.clearQueue().then(function (){
var playlistId = id
const params = {
include: "tracks",
platform: "web",
"include[library-playlists]": "catalog,tracks",
"fields[playlists]": "curatorName,playlistType,name,artwork,url",
"include[library-songs]": "catalog,artists,albums",
"fields[catalog]": "artistUrl,albumUrl",
"fields[songs]": "artistUrl,albumUrl"
}
var playlistId = ''
}
// else if (kind.includes("playlist") && (id.startsWith("p.") || id.startsWith("pl."))){
// /* Randomize array in-place using Durstenfeld shuffle algorithm */
// function shuffleArray(array) {
// for (var i = array.length - 1; i > 0; i--) {
// var j = Math.floor(Math.random() * (i + 1));
// var temp = array[i];
// array[i] = array[j];
// array[j] = temp;
// }
// }
// app.mk.clearQueue().then(function () { {
// app.mk.setQueue({[truekind]: [item.attributes.playParams.id ?? item.id]}).then(function () {
// app.mk.play().then(function (){
// app.mk.clearQueue().then(function (){
// var playlistId = id
// const params = {
// include: "tracks",
// platform: "web",
// "include[library-playlists]": "catalog,tracks",
// "fields[playlists]": "curatorName,playlistType,name,artwork,url",
// "include[library-songs]": "catalog,artists,albums",
// "fields[catalog]": "artistUrl,albumUrl",
// "fields[songs]": "artistUrl,albumUrl"
// }
// var playlistId = ''
try {
function getPlaylist(id, params, isLibrary){
if (isLibrary){
return app.mk.api.library.playlist(id, params)
} else { return app.mk.api.playlist(id, params)}
}
getPlaylist(id, params, isLibrary).then(res => {
let query = res.relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
if (app.mk.shuffleMode == 1){shuffleArray(query); console.log('shf')}
app.mk.queue.append(query)
if (!res.relationships.tracks.next) {
return
} else {
getPlaylistTracks(res.relationships.tracks.next)
}
// try {
// function getPlaylist(id, params, isLibrary){
// if (isLibrary){
// return app.mk.api.library.playlist(id, params)
// } else { return app.mk.api.playlist(id, params)}
// }
// getPlaylist(id, params, isLibrary).then(res => {
// let query = res.relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
// if (app.mk.shuffleMode == 1){shuffleArray(query); console.log('shf')}
// app.mk.queue.append(query)
// if (!res.relationships.tracks.next) {
// return
// } else {
// getPlaylistTracks(res.relationships.tracks.next)
// }
function getPlaylistTracks(next) {
app.apiCall(app.musicBaseUrl + next, res => {
if (res.id != playlistId) {
return
}
let query = res.data.map(item => new MusicKit.MediaItem(item))
if (app.mk.shuffleMode == 1){shuffleArray(query); console.log('shf')}
app.mk.queue.append(query)
// function getPlaylistTracks(next) {
// app.apiCall(app.musicBaseUrl + next, res => {
// if (res.id != playlistId) {
// return
// }
// let query = res.data.map(item => new MusicKit.MediaItem(item))
// if (app.mk.shuffleMode == 1){shuffleArray(query); console.log('shf')}
// app.mk.queue.append(query)
if (res.next) {
getPlaylistTracks(res.next)
}
})
}
})
} catch (e) {}
// if (res.next) {
// getPlaylistTracks(res.next)
// }
// })
// }
// })
// } catch (e) {}
})
})
})
}
})
} else {
// })
// })
// })
// }
// })
// }
else {
app.playMediaItemById((id), (kind), (isLibrary), item.attributes.url ?? '')
}
})
@ -1565,9 +1568,13 @@ const app = new Vue({
processChunk(response)
})
} else {
if (downloaded.next != null && typeof downloaded.next === "function") {
downloaded.next("", params, {includeResponseMeta: !0}).then((response) => {
processChunk(response)
})
}) } else {
console.log("Download next", downloaded.next)
}
}
}
@ -1641,9 +1648,12 @@ const app = new Vue({
processChunk(response)
})
} else {
if (downloaded.next != null && typeof downloaded.next === "function") {
downloaded.next("", params, {includeResponseMeta: !0}).then((response) => {
processChunk(response)
})
}) } else {
console.log("Download next", downloaded.next)
}
}
}
@ -1718,9 +1728,13 @@ const app = new Vue({
processChunk(response)
})
} else {
downloaded.next("", "artists", {includeResponseMeta: !0}).then((response) => {
processChunk(response)
})
if (downloaded.next != null && typeof downloaded.next === "function") {
downloaded.next("", "artists", {includeResponseMeta: !0}).then((response) => {
processChunk(response)
}) } else {
console.log("Download next", downloaded.next)
}
}
}
@ -2012,6 +2026,7 @@ const app = new Vue({
const track = encodeURIComponent((this.mk.nowPlayingItem != null) ? this.mk.nowPlayingItem.title ?? '' : '');
const artist = encodeURIComponent((this.mk.nowPlayingItem != null) ? this.mk.nowPlayingItem.artistName ?? '' : '');
const time = encodeURIComponent((this.mk.nowPlayingItem != null) ? (Math.round((this.mk.nowPlayingItem.attributes["durationInMillis"] ?? -1000) / 1000) ?? -1) : -1);
const id = encodeURIComponent((this.mk.nowPlayingItem != null) ? app.mk.nowPlayingItem._songId ?? '' : '');
let lrcfile = "";
let richsync = [];
const lang = app.cfg.lyrics.mxm_language // translation language
@ -2020,7 +2035,7 @@ const app = new Vue({
}
/* get token */
function getToken(mode, track, artist, songid, lang, time) {
function getToken(mode, track, artist, songid, lang, time, id) {
if (attempt > 2) {
app.loadAMLyrics();
} else {
@ -2041,7 +2056,7 @@ const app = new Vue({
app.mxmtoken = token;
if (mode == 1) {
getMXMSubs(track, artist, app.mxmtoken, lang, time);
getMXMSubs(track, artist, app.mxmtoken, lang, time, id);
} else {
getMXMTrans(songid, lang, app.mxmtoken);
}
@ -2063,11 +2078,12 @@ const app = new Vue({
}
}
function getMXMSubs(track, artist, token, lang, time) {
function getMXMSubs(track, artist, token, lang, time, id) {
let usertoken = encodeURIComponent(token);
let richsyncQuery = (app.cfg.lyrics.mxm_karaoke) ? "&optional_calls=track.richsync" : ""
let timecustom = (!time || (time && time < 0)) ? '' : `&f_subtitle_length=${time}&q_duration=${time}&f_subtitle_length_max_deviation=40`;
let url = "https://apic-desktop.musixmatch.com/ws/1.1/macro.subtitles.get?format=json&namespace=lyrics_richsynched" + richsyncQuery + "&subtitle_format=lrc&q_artist=" + artist + "&q_track=" + track + "&usertoken=" + usertoken + timecustom + "&app_id=web-desktop-app-v1.0&t=" + revisedRandId();
let itunesid = (id && id != "") ? `&track_itunes_id=${id}` : '';
let url = "https://apic-desktop.musixmatch.com/ws/1.1/macro.subtitles.get?format=json&namespace=lyrics_richsynched" + richsyncQuery + "&subtitle_format=lrc&q_artist=" + artist + "&q_track=" + track + itunesid + "&usertoken=" + usertoken + timecustom + "&app_id=web-desktop-app-v1.0&t=" + revisedRandId();
let req = new XMLHttpRequest();
req.overrideMimeType("application/json");
req.open('GET', url, true);
@ -2198,7 +2214,7 @@ const app = new Vue({
if (track != "" & track != "No Title Found") {
if (app.mxmtoken != null && app.mxmtoken != '') {
getMXMSubs(track, artist, app.mxmtoken, lang, time)
getMXMSubs(track, artist, app.mxmtoken, lang, time, id)
} else {
getToken(1, track, artist, '', lang, time);
}
@ -2370,27 +2386,23 @@ const app = new Vue({
}
})
} else {
try {
app.mk.stop()
} catch (e) {
}
app.mk.stop().then(() => {
if (truekind == "playlists" && (id.startsWith("p.") || id.startsWith("pl.u"))){
app.mk.playNext({[item.attributes.playParams.kind ?? item.type]: item.attributes.playParams.id ?? item.id}).then(function () {
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.id) ?? 1)
app.mk.play().then(function(){
app.mk.clearQueue().then(function () {
if ((app.showingPlaylist && app.showingPlaylist.id == id)) {
app.mk.setQueue({[item.attributes.playParams.kind ?? item.type]: item.attributes.playParams.id ?? item.id}).then(function () {
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.id) ?? 1).then(function(){
if ((app.showingPlaylist && app.showingPlaylist.id == id)) {
let query = app.showingPlaylist.relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
if (query.length > 100) {
let u = query.slice(100); if (app.mk.shuffleMode == 1) { shuffleArray(u) }
app.mk.queue.append(u)}
} else {
app.getPlaylistFromID(id, true).then(function () {
let query = app.showingPlaylist.relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
if (app.mk.shuffleMode == 1){ shuffleArray(query)}
app.mk.queue.append(query)
} else {
app.getPlaylistFromID(id, true).then(function () {
let query = app.showingPlaylist.relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
if (app.mk.shuffleMode == 1){ shuffleArray(query)}
app.mk.queue.append(query)
})
}
})
if (query.length > 100) {
let u = query.slice(100); if (app.mk.shuffleMode == 1) { shuffleArray(u) }
app.mk.queue.append(u)}
})
}
})
})
@ -2411,7 +2423,7 @@ const app = new Vue({
app.mk.play()
}
})}
}
})}
} catch (err) {
console.log(err)
try {
@ -3050,9 +3062,18 @@ const app = new Vue({
}
},
fullscreen(flag){
if (flag){
ipcRenderer.send('setFullScreen', true); app.appMode = 'fullscreen';}
else { ipcRenderer.send('setFullScreen', false); app.appMode = 'player';}
if (flag) {
ipcRenderer.send('setFullScreen', true);
app.appMode = 'fullscreen';
document.addEventListener('keydown', event => {
if (event.key === 'Escape' && app.appMode === 'fullscreen') {
this.fullscreen(false);
}
});
} else {
ipcRenderer.send('setFullScreen', false);
app.appMode = 'player';
}
}
}

View file

@ -654,12 +654,12 @@ input[type=range].web-slider::-webkit-slider-runnable-track {
}
.spinner {
background-image: url("assets/spinner.gif");
background-image: url("assets/spinner.svg");
background-position: center;
background-repeat: no-repeat;
background-size: contain;
width: 32px;
height: 32px;
width: 50px;
height: 50px;
display: inline-block;
}
@ -3578,6 +3578,10 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
background-color: rgba(200, 200, 200, 0.7);
}
.playback-button--small{
opacity: 0.7;
}
.right-col{
height: 50vh;
}
@ -3614,8 +3618,8 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
transform: scale(0.5);
-webkit-appearance: none;
appearance: none;
width: 12px;
height: 12px;
width: 23px;
height: 23px;
border-radius: 100%;
background: rgba(236, 234, 234, 0.733);
cursor: default;
@ -3657,7 +3661,7 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
.lyrics-col{
height: 75vh;
height: 62vh;
display: flex;
justify-content: center;
align-content: center;
@ -4135,7 +4139,7 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
}
#apple-music-video-player-controls #player-fullscreen > svg {
width: 50%;
width: 70%;
}
#apple-music-video-player-controls:hover {

View file

@ -1,5 +1,5 @@
<script type="text/x-template" id="fullscreen-view">
<div class="fullscreen-view">
<div class="fullscreen-view" tabindex="0">
<div class="background">
<div class="bgArtworkMaterial">
<div class="bg-artwork-container">
@ -140,10 +140,19 @@
tabMode: "lyrics",
}
},
beforeMount() {
window.addEventListener('keyup', this.onEscapeKeyUp);
},
beforeDestroy() {
window.removeEventListener('keyup', this.onEscapeKeyUp)
},
methods: {
sayHello: function () {
alert('Hello world!');
}
onEscapeKeyUp(event) {
if (event.which === 27) {
app.fullscreen(false);
console.log('js')
}
},
}
});
</script>

View file

@ -410,12 +410,13 @@
let kind = (item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')) : (item.type ?? ''));
let id = (item.attributes.playParams ? (item.attributes.playParams.id ?? (item.id ?? '')) : (item.id ?? ''));;
let isLibrary = item.attributes.playParams ? (item.attributes.playParams.isLibrary ?? false) : false;
let truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
console.log(item, parent, childIndex, kind, id, isLibrary, kind == "playlists", id.startsWith("p.") || id.startsWith("pl.u"))
app.mk.stop().then(() => {
if (parent != null && childIndex != null) {
app.queueParentandplayChild(parent, childIndex, item);
} else if (kind.includes("playlist") && (id.startsWith("p.") || id.startsWith("pl."))){
/* Randomize array in-place using Durstenfeld shuffle algorithm */
}
else if (kind.includes("playlist") && (id.startsWith("p.") || id.startsWith("pl."))){
function shuffleArray(array) {
for (var i = array.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
@ -424,21 +425,9 @@
array[j] = temp;
}
}
app.mk.clearQueue().then(function () {
app.mk.setQueue({[item.attributes.playParams.kind ?? item.type]: item.attributes.playParams.id ?? item.id}).then(function () {
app.mk.setQueue({[truekind]: [item.attributes.playParams.id ?? item.id]}).then(function () {
app.mk.play().then(function (){
app.mk.clearQueue().then(function (){
var playlistId = id
const params = {
include: "tracks",
platform: "web",
"include[library-playlists]": "catalog,tracks",
"fields[playlists]": "curatorName,playlistType,name,artwork,url",
"include[library-songs]": "catalog,artists,albums",
"fields[catalog]": "artistUrl,albumUrl",
"fields[songs]": "artistUrl,albumUrl"
}
var playlistId = ''
function getPlaylist(id, params, isLibrary){
if (isLibrary){
return app.mk.api.library.playlist(id, params)
@ -447,9 +436,10 @@
try {
getPlaylist(id, params, isLibrary).then(res => {
let query = res.relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
if (app.mk.shuffleMode == 1){shuffleArray(query); console.log('shf')}
app.mk.queue.append(query)
//let query = res.relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
//if (app.mk.shuffleMode == 1){shuffleArray(query); }
// console.log(query)
// app.mk.queue.append(query)
if (!res.relationships.tracks.next) {
return
} else {
@ -458,9 +448,10 @@
function getPlaylistTracks(next) {
app.apiCall(app.musicBaseUrl + next, res => {
if (res.id != playlistId) {
return
}
// if (res.id != playlistId || next.includes(playlistId)) {
// return
// }
console.log('nextres', res)
let query = res.data.map(item => new MusicKit.MediaItem(item))
if (app.mk.shuffleMode == 1){shuffleArray(query); console.log('shf')}
app.mk.queue.append(query)
@ -474,12 +465,13 @@
} catch (e) {}
})
})
})
})
} else {
}
else {
app.playMediaItemById(item.attributes.playParams.id ?? item.id, item.attributes.playParams.kind ?? item.type, item.attributes.playParams.isLibrary ?? false, item.attributes.url)
}})
}

View file

@ -24,13 +24,15 @@
<div class="button" style="
border-radius: 50%;
background: rgba(50,50,50,0.7);"
:style="[(!(item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')): (item.type ?? '')).includes('radioStation') && !(item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')): (item.type ?? '')).includes('song')) ? {'margin': '205px',
:style="[(!(item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')): (item.type ?? '')).includes('radioStation') && !(item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')): (item.type ?? '')).includes('song')) ?
{'margin': '205px',
'margin-left': '260px', 'margin-bottom': '140px',
width: '30px',
height: '30px',} :
{margin: '35px', 'margin-left': '95px',
width: '120px',
height: '120px',}]" @click="app.playMediaItem(item)">
{'margin': '205px',
'margin-left': '260px', 'margin-bottom': '140px',
width: '30px',
height: '30px',}]" @click="app.playMediaItem(item)">
<%- include("../svg/play.svg") %>
</div>
</div>
@ -39,13 +41,15 @@
<div class="button" style="
border-radius: 50%;
background: rgba(50,50,50,0.7);"
:style="[(!(item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')): (item.type ?? '')).includes('radioStation') && !(item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')): (item.type ?? '')).includes('song')) ? {'margin': '205px',
:style="[(!(item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')): (item.type ?? '')).includes('radioStation') && !(item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')): (item.type ?? '')).includes('song')) ?
{'margin': '205px',
'margin-left': '260px', 'margin-bottom': '140px',
width: '30px',
height: '30px',} :
{margin: '35px', 'margin-left': '95px',
width: '120px',
height: '120px',}]" @click="app.playMediaItem(item)">
{'margin': '205px',
'margin-left': '260px', 'margin-bottom': '140px',
width: '30px',
height: '30px',}]" @click="app.playMediaItem(item)">
<%- include("../svg/play.svg") %>
</div>
</div>

View file

@ -29,7 +29,7 @@
<div class="info-rect" :class="{'info-rect-card': kind == 'card'}" :style="{'--bgartwork': getArtworkUrl(size, true)}">
<div class="title" v-if="item.attributes.artistNames == null || kind!= 'card'" @click='app.routeView(item)'>
<div class="item-navigate text-overflow-elipsis">{{ item.attributes.name }}</div>
<div v-if="item.attributes && item.attributes.contentRating == 'explicit'" style= "margin-top: -2.6px;margin-left: 3px;">🅴</div>
<div class="explicit-icon" v-if="item.attributes && item.attributes.contentRating == 'explicit'" style= "background-image: url(./assets/explicit.svg);height: 12px;width: 12px;filter: contrast(0);background-repeat: no-repeat;margin-top: 2.63px;margin-left: 4px;"></div>
</div>
<div class="subtitle item-navigate text-overflow-elipsis" @click="getSubtitleNavigation()"
v-if="getSubtitle() != ''">

View file

@ -36,7 +36,16 @@
<div class="mv-chrome" v-if="chrome.topChromeVisible == false"></div>
<div class="app-chrome" :style="{'display': chrome.topChromeVisible ? '' : 'none'}">
<div class="app-chrome--left">
<div class="app-chrome-item full-height">
<div class="app-chrome-item full-height" v-if="chrome.windowControlPosition == 'left'">
<div class="window-controls">
<div class="close" @click="ipcRenderer.send('close')"></div>
<div class="minimize" @click="ipcRenderer.send('minimize')"></div>
<div class="minmax restore" v-if="chrome.maximized" @click="ipcRenderer.send('maximize')">
</div>
<div class="minmax" v-else @click="ipcRenderer.send('maximize')"></div>
</div>
</div>
<div class="app-chrome-item full-height" v-else>
<div class="app-title"></div>
</div>
<div class="app-chrome-item">
@ -83,9 +92,9 @@
{{ mk.nowPlayingItem["attributes"]["artistName"] }}
</div>
<div class="song-artist item-navigate" style="display: inline-block;"
@click="getNowPlayingItemDetailed('album')">
{{ (mk.nowPlayingItem["attributes"]["albumName"]) ? (" - " +
mk.nowPlayingItem["attributes"]["albumName"]) : "" }}
@click="getNowPlayingItemDetailed('album')">
<div class="separator" style="display: inline-block;">{{"-"}}</div>
{{(mk.nowPlayingItem["attributes"]["albumName"]) ? (mk.nowPlayingItem["attributes"]["albumName"]) : "" }}
</div>
</div>
@ -134,7 +143,7 @@
<button class="playback-button--small lyrics" :class="{'active': drawer.panel == 'lyrics'}"
@click="invokeDrawer('lyrics')"></button>
</div>
<div class="app-chrome-item full-height">
<div class="app-chrome-item full-height" v-if="chrome.windowControlPosition == 'right'">
<div class="window-controls">
<div class="minimize" @click="ipcRenderer.send('minimize')"></div>
<div class="minmax restore" v-if="chrome.maximized" @click="ipcRenderer.send('maximize')">
@ -489,7 +498,7 @@
</transition>
<div id="apple-music-video-container">
<div id="apple-music-video-player-controls">
<div id="player-exit" title="Close" @click="app.exitMV()">
<div id="player-exit" title="Close" @click="exitMV()">
<svg fill="white" xmlns="http://www.w3.org/2000/svg" width="21" height="21" viewBox="0 0 21 21"
aria-role="presentation" focusable="false">
<path
@ -507,7 +516,7 @@
<div id="player-pip"
@click="document.querySelector('video#apple-music-video-player').requestPictureInPicture()"
title="Picture-in-Picture">
<%- include("svg/fullscreen.svg") %>
<%- include("svg/pip.svg") %>
</div>
<div id="player-fullscreen"
@click="document.querySelector('video#apple-music-video-player').requestFullscreen()"

View file

@ -59,11 +59,11 @@
</template>
<div class="playlist-controls">
<button class="wr-btn" style="min-width: 120px;"
@click="app.mk.shuffleMode = 0;app.playMediaItemById(data.attributes.playParams.id ?? data.id, data.attributes.playParams.kind ?? data.type, data.attributes.playParams.isLibrary ?? false, data.attributes.url)">
@click="app.mk.shuffleMode = 0; play()">
Play
</button>
<button class="wr-btn" style="min-width: 120px;"
@click="app.mk.shuffleMode = 1;app.playMediaItemById(data.attributes.playParams.id ?? data.id, data.attributes.playParams.kind ?? data.type, data.attributes.playParams.isLibrary ?? false, data.attributes.url)">
@click="app.mk.shuffleMode = 1;play()">
Shuffle
</button>
<button class="wr-btn" style="min-width: 120px;" v-if="inLibrary!=null"
@ -152,7 +152,7 @@
}
this.$root.getSocialBadges((badges) => {
let friends = badges[id]
if(friends) {
if (friends) {
friends.forEach(function (friend) {
self.app.mk.api.socialProfile(friend).then(data => {
self.itemBadges.push(data)
@ -192,7 +192,7 @@
async isInLibrary() {
if (this.data.type && !this.data.type.includes("library")) {
// please keep using vars here
var params = {"fields[playlists]": "inLibrary", "fields[albums]": "inLibrary", "relate": "library"}
var params = { "fields[playlists]": "inLibrary", "fields[albums]": "inLibrary", "relate": "library" }
var res = await app.mkapi(this.data.attributes.playParams.kind ?? this.data.type, this.data.attributes.playParams.isLibrary ?? false, this.data.attributes.playParams.id ?? this.data.id, params);
this.inLibrary = (res && res.attributes && res.attributes.inLibrary) ? res.attributes.inLibrary : false
console.log(res)
@ -214,7 +214,7 @@
this.inLibrary = true
},
async removeFromLibrary(id) {
var params = {"fields[somgs]": "inLibrary", "fields[albums]": "inLibrary", "relate": "library"}
var params = { "fields[somgs]": "inLibrary", "fields[albums]": "inLibrary", "relate": "library" }
var id = this.data.id ?? this.data.attributes.playParams.id
var res = await app.mkapi(this.data.attributes.playParams.kind ?? this.data.type, this.data.attributes.playParams.isLibrary ?? false, this.data.attributes.playParams.id ?? this.data.id, params);
if (res && res.relationships && res.relationships.library && res.relationships.library.data && res.relationships.library.data.length > 0) {
@ -222,7 +222,7 @@
}
let kind = this.data.attributes.playParams.kind ?? this.data.type ?? '';
var truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
app.mk.api.library.remove({[truekind]: id})
app.mk.api.library.remove({ [truekind]: id })
this.inLibrary = false
},
editPlaylistName() {
@ -304,7 +304,7 @@
if (date == null || date === "") return "";
try {
var releaseDate = new Date(date);
month = new Intl.DateTimeFormat('en-US', {month: 'long'}).format(releaseDate);
month = new Intl.DateTimeFormat('en-US', { month: 'long' }).format(releaseDate);
date = releaseDate.getDate();
year = releaseDate.getFullYear();
@ -312,7 +312,39 @@
} catch (e) {
return ""
}
},
play() {
function shuffleArray(array) {
for (var i = array.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = array[i];
array[i] = array[j];
array[j] = temp;
}
}
var id = this.data.attributes.playParams.id ?? this.data.id;
//console.log("1")
var kind = this.data.attributes.playParams.kind ?? this.data.type ?? '';
//console.log("1")
var truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
let query = (this.data ?? app.showingPlaylist).relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
app.mk.stop().then(function () {
app.mk.setQueue({[truekind]: [id]}).then(function () {
app.mk.play().then(function () {
if (query.length > 100) {
let u = query.slice(100); if (app.mk.shuffleMode == 1) { shuffleArray(u) }
app.mk.queue.append(u)}
})
})
})
}
}
})
</script>

View file

@ -25,9 +25,8 @@
<template v-if="artistFeed.length > 0">
<mediaitem-list-item v-for="item in artistFeed.limit(6)" :item="item"></mediaitem-list-item>
</template>
<template v-else>
<div class="spinner"></div>
</template>
<div class="spinner" v-else-if="followedArtists.length > 0"></div>
<div class="no-artist" v-else> Follow some artists first and their latest releases will be here</div>
</div>
</div>
</div>
@ -54,7 +53,7 @@
</div>
</div>
</div>
<div class="row" v-if="friendsListeningTo && friendsListeningTo != []">
<div class="row" v-if="friendsListeningTo && friendsListeningTo.length > 0">
<div class="col">
<h3>Friends Listening To</h3>
<div class="well">

View file

@ -51,7 +51,7 @@
<div class="well">
<div class="albums-square-container">
<div>
<mediaitem-square v-if="library.albums.viewAs == 'covers'" :size="'150'" :item="item" v-for="item in library.albums.displayListing">
<mediaitem-square v-if="library.albums.viewAs == 'covers'" :size="'300'" :item="item" v-for="item in library.albums.displayListing">
</mediaitem-square>
</div>
</div>

View file

@ -454,10 +454,10 @@
</div>
<div class="md-option-line" v-show ="app.cfg.lastfm.enabled">
<div class="md-option-segment">
LastFM Scrobble Delay
LastFM Scrobble Delay (%)
</div>
<div class="md-option-segment md-option-segment_auto" >
<input type="number" v-model="app.cfg.lastfm.scrobble_after"/>
<input type="number" min="50" max="100" v-model="app.cfg.lastfm.scrobble_after"/>
</div>
</div>
<div class="md-option-line" v-show ="app.cfg.lastfm.enabled">

View file

@ -1,55 +1,4 @@
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
fill="#eee" viewBox="0 0 384.97 384.97" style="enable-background:new 0 0 384.97 384.97;" xml:space="preserve">
<g>
<g id="Fullscreen_1_">
<path d="M372.939,216.545c-6.123,0-12.03,5.269-12.03,12.03v132.333H24.061V24.061h132.333c6.388,0,12.03-5.642,12.03-12.03
S162.409,0,156.394,0H24.061C10.767,0,0,10.767,0,24.061v336.848c0,13.293,10.767,24.061,24.061,24.061h336.848
c13.293,0,24.061-10.767,24.061-24.061V228.395C384.97,221.731,380.085,216.545,372.939,216.545z"/>
<path d="M372.939,0H252.636c-6.641,0-12.03,5.39-12.03,12.03s5.39,12.03,12.03,12.03h91.382L99.635,268.432
c-4.668,4.668-4.668,12.235,0,16.903c4.668,4.668,12.235,4.668,16.891,0L360.909,40.951v91.382c0,6.641,5.39,12.03,12.03,12.03
s12.03-5.39,12.03-12.03V12.03l0,0C384.97,5.558,379.412,0,372.939,0z"/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36" fill="white">
<path d="M0 0h36v36h-36z" fill="none"/>
<path d="M10 21h-3v8h8v-3h-5v-5zm-3-6h3v-5h5v-3h-8v8zm19 11h-5v3h8v-8h-3v5zm-5-19v3h5v5h3v-8h-8z"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 252 B

Before After
Before After

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
fill="white" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
<style type="text/css">
.st0{fill:#333333;}
</style>
<g id="XMLID_6_">
<path id="XMLID_11_" class="st0" d="M418.5,139.4H232.4v139.8h186.1V139.4z M464.8,46.7H46.3C20.5,46.7,0,68.1,0,93.1v325.9
c0,25.8,21.4,46.3,46.3,46.3h419.4c25.8,0,46.3-20.5,46.3-46.3V93.1C512,67.2,490.6,46.7,464.8,46.7z M464.8,418.9H46.3V92.2h419.4
v326.8H464.8z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 716 B