Merge remote-tracking branch 'upstream/upcoming' into upcoming

This commit is contained in:
Onur Gümüş 2022-01-25 18:24:07 +03:00
commit 061f83deb8
14 changed files with 104 additions and 55 deletions

View file

@ -3296,11 +3296,11 @@ const app = new Vue({
const element = document.getElementById('lfmConnect');
// new key : f9986d12aab5a0fe66193c559435ede3
window.open('https://www.last.fm/api/auth?api_key=f9986d12aab5a0fe66193c559435ede3&cb=cider://auth/lastfm');
element.innerText = app.getLz('term.connecting');
element.innerText = app.getLz('term.connecting') + '...';
/* Just a timeout for the button */
setTimeout(() => {
if (element.innerText === app.getLz('term.connecting')) {
if (element.innerText === app.getLz('term.connecting') +'...') {
element.innerText = app.getLz('term.connect');
console.warn('[LastFM] Attempted connection timed out.');
}
@ -3309,7 +3309,7 @@ const app = new Vue({
ipcRenderer.on('LastfmAuthenticated', function(_event, lfmAuthKey) {
app.cfg.lastfm.auth_token = lfmAuthKey;
app.cfg.lastfm.enabled = true;
element.innerHTML = `Disconnect\n<p style="font-size: 8px"><i>(Authed: ${lfmAuthKey})</i></p>`;
element.innerHTML = `${app.getLz('term.disconnect')}\n<p style="font-size: 8px"><i>(${app.getLz('term.authed')}: ${lfmAuthKey})</i></p>`;
element.onclick = app.LastFMDeauthorize;
});
},
@ -3357,9 +3357,20 @@ const app = new Vue({
} else {
ipcRenderer.send('windowmin', 844, 410)
ipcRenderer.send('windowresize', this.tmpWidth, this.tmpHeight, false)
ipcRenderer.send('windowontop', false)
this.cfg.visual.miniplayer_top_toggle = true;
app.appMode = 'player';
}
},
pinMiniPlayer() {
if (this.cfg.visual.miniplayer_top_toggle) {
ipcRenderer.send('windowontop', true)
this.cfg.visual.miniplayer_top_toggle = false
} else {
ipcRenderer.send('windowontop', false)
this.cfg.visual.miniplayer_top_toggle = true;
}
},
formatTimezoneOffset: (e = new Date) => {
let leadingZeros = (e, s = 2) => {
let n = "" + e;

View file

@ -4799,6 +4799,24 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
-webkit-app-region: no-drag;
}
.player-pin {
z-index: 3;
position: absolute;
min-width: 20px;
min-height: 20px;
top: 5px;
right: 30px;
-webkit-app-region: no-drag;
}
#mini-pin{
display: none;
}
.player-pin:hover #mini-pin {
display: block;
}
.playback-button--small {
opacity: 0.7;
}

View file

@ -1,7 +1,10 @@
<script type="text/x-template" id="mini-view">
<div class="mini-view" tabindex="0">
<div class="background">
</div>
</div>
<div class="player-pin" title="Pin to Top" @click="app.pinMiniPlayer()">
<span id="mini-pin">📌</span>
</div>
<div class="player-exit" title="Close" @click="app.miniPlayer(false)">
<svg fill="#323232e3" xmlns="http://www.w3.org/2000/svg" width="21" height="21" viewBox="0 0 21 21"
aria-role="presentation" focusable="false">

View file

@ -2,15 +2,15 @@
<div class="modal-fullscreen spatialproperties-panel">
<div class="modal-window" v-if="ready">
<div class="modal-header">
<div class="modal-title">Spatial Properties</div>
<div class="modal-title">{{$root.getLz('spatial.spatialProperties')}}</div>
<button class="close-btn" @click="close()"></button>
</div>
<div class="modal-content">
<template v-if="roomEditType == 'dimensions'">
<div class="row">
<div class="col"><h3>Room Dimensions</h3></div>
<div class="col"><h3>{{$root.getLz('spatial.roomDimensions')}}</h3></div>
<div class="col-auto flex-center">
<button class="md-btn" @click="roomEditType = 'positions'">Set Positions</button>
<button class="md-btn" @click="roomEditType = 'positions'">{{$root.getLz('spatial.setPositions')}}</button>
</div>
</div>
<div class="row">
@ -18,7 +18,7 @@
<div class="row">
<div class="col-3 flex-center">
Width
{{$root.getLz('spatial.width')}}
</div>
<div class="col flex-center">
<input type="range" class="md-slider" min="0" max="100" @change="setRoom()" style="width: 100%;"
@ -32,7 +32,7 @@
<div class="row">
<div class="col-3 flex-center">
Height
{{$root.getLz('spatial.height')}}
</div>
<div class="col flex-center">
<input type="range" class="md-slider" min="0" max="100" @change="setRoom()" style="width: 100%;"
@ -46,7 +46,7 @@
<div class="row">
<div class="col-3 flex-center">
Depth
{{$root.getLz('spatial.depth')}}
</div>
<div class="col flex-center">
<input type="range" class="md-slider" min="0" max="100" @change="setRoom()" style="width: 100%;"
@ -73,9 +73,9 @@
</template>
<template v-if="roomEditType == 'positions'">
<div class="row">
<div class="col"><h3>Room Positions</h3></div>
<div class="col"><h3>{{$root.getLz('spatial.roomPositons')}}</h3></div>
<div class="col-auto flex-center">
<button class="md-btn" @click="roomEditType = 'dimensions'">Set Dimensions</button>
<button class="md-btn" @click="roomEditType = 'dimensions'">{{$root.getLz('spatial.setDimensions')}}</button>
</div>
</div>
<div class="row">
@ -83,7 +83,7 @@
<div class="row">
<div class="col-3 flex-center">
X (Listener)
X ({{$root.getLz('spatial.listener')}})
</div>
<div class="col flex-center">
<input type="range" class="md-slider" min="0" max="100" @change="setRoom()" style="width: 100%;"
@ -97,7 +97,7 @@
<div class="row">
<div class="col-3 flex-center">
Y (Listener)
Y ({{$root.getLz('spatial.listener')}})
</div>
<div class="col flex-center">
<input type="range" class="md-slider" min="0" max="100" @change="setRoom()" style="width: 100%;"
@ -111,7 +111,7 @@
<div class="row">
<div class="col-3 flex-center">
Z (Listener)
Z ({{$root.getLz('spatial.listener')}})
</div>
<div class="col flex-center">
<input type="range" class="md-slider" min="0" max="100" @change="setRoom()" style="width: 100%;"
@ -125,7 +125,7 @@
<div class="row">
<div class="col-3 flex-center">
X (Audio Source)
X ({{$root.getLz('spatial.audioSource')}})
</div>
<div class="col flex-center">
<input type="range" class="md-slider" min="0" max="100" @change="setRoom()" style="width: 100%;"
@ -139,7 +139,7 @@
<div class="row">
<div class="col-3 flex-center">
Y (Audio Source)
Y ({{$root.getLz('spatial.audioSource')}})
</div>
<div class="col flex-center">
<input type="range" class="md-slider" min="0" max="100" @change="setRoom()" style="width: 100%;"
@ -153,7 +153,7 @@
<div class="row">
<div class="col-3 flex-center">
Z (Audio Source)
Z ({{$root.getLz('spatial.audioSource')}})
</div>
<div class="col flex-center">
<input type="range" class="md-slider" min="0" max="100" @change="setRoom()" style="width: 100%;"
@ -179,13 +179,13 @@
</template>
<div class="row">
<div class="col"><h3>Room Materials</h3></div>
<div class="col"><h3>{{$root.getLz('spatial.roomMaterials')}}</h3></div>
</div>
<div class="row">
<div class="col"></div>
<div class="col flex-center">
<label>
Up
{{$root.getLz('spatial.up')}}
<select class="md-select" @change="setRoom()"
v-model="room_materials.up">
<option v-for="prop in roomProps" :value="prop">{{ prop }}</option>
@ -197,7 +197,7 @@
<div class="row">
<div class="col flex-center">
<label>
Left
{{$root.getLz('spatial.left')}}
<select class="md-select" @change="setRoom()"
v-model="room_materials.left">
<option v-for="prop in roomProps" :value="prop">{{ prop }}</option>
@ -206,14 +206,14 @@
</div>
<div class="col flex-center">
<label>
Front
{{$root.getLz('spatial.front')}}
<select class="md-select" @change="setRoom()"
v-model="room_materials.front">
<option v-for="prop in roomProps" :value="prop">{{ prop }}</option>
</select>
</label>
<label>
Back
{{$root.getLz('spatial.back')}}
<select class="md-select" @change="setRoom()"
v-model="room_materials.back">
<option v-for="prop in roomProps" :value="prop">{{ prop }}</option>
@ -222,7 +222,7 @@
</div>
<div class="col flex-center">
<label>
Right
{{$root.getLz('spatial.right')}}
<select class="md-select" @change="setRoom()"
v-model="room_materials.right">
<option v-for="prop in roomProps" :value="prop">{{ prop }}</option>
@ -234,7 +234,7 @@
<div class="col"></div>
<div class="col flex-center">
<label>
Down
{{$root.getLz('spatial.down')}}
<select class="md-select" @change="setRoom()"
v-model="room_materials.down">
<option v-for="prop in roomProps" :value="prop">{{ prop }}</option>

View file

@ -441,11 +441,11 @@
let month, year;
try {
const releaseDate = new Date(date);
month = new Intl.DateTimeFormat('en-US', {month: 'long'}).format(releaseDate);
date = releaseDate.getDate();
year = releaseDate.getFullYear();
// month = new Intl.DateTimeFormat(this.app.cfg.general.language.replace('_','-'), {month: 'long'}).format(releaseDate);
// date = releaseDate.getDate();
// year = releaseDate.getFullYear();
return prefix + date + " " + month + " " + year;
return prefix + new Intl.DateTimeFormat(this.app.cfg.general.language?.replace('_','-') ?? 'en-US', {day:'numeric',month: 'long', year: 'numeric'}).format(releaseDate);
} catch (e) {
return ""
}

View file

@ -472,7 +472,7 @@
</div>
<div class="md-option-line" v-show ="app.cfg.lastfm.enabled">
<div class="md-option-segment">
LastFM Scrobble Delay (%)
{{$root.getLz('settings.option.connectivity.lastfmScrobble.delay')}}
</div>
<div class="md-option-segment md-option-segment_auto" >
<input type="number" min="50" max="100" v-model="app.cfg.lastfm.scrobble_after"/>
@ -480,7 +480,7 @@
</div>
<div class="md-option-line" v-show ="app.cfg.lastfm.enabled">
<div class="md-option-segment">
Enable LastFM Now Playing
{{$root.getLz('settings.option.connectivity.lastfmScrobble.nowPlaying')}}
</div>
<div class="md-option-segment md-option-segment_auto" >
<input type="checkbox" v-model="app.cfg.lastfm.NowPlaying" switch/>
@ -488,7 +488,7 @@
</div>
<div class="md-option-line" v-show ="app.cfg.lastfm.enabled">
<div class="md-option-segment">
Remove featuring artists from song title (LastFM)
{{$root.getLz('settings.option.connectivity.lastfmScrobble.removeFeatured')}}
</div>
<div class="md-option-segment md-option-segment_auto" >
<input type="checkbox" v-model="app.cfg.lastfm.enabledRemoveFeaturingArtists" switch/>