Merge branch 'ciderapp:upcoming' into upcoming

This commit is contained in:
Maikiwi 2022-01-26 20:32:21 -08:00 committed by GitHub
commit b1e495167c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 39 deletions

View file

@ -1988,6 +1988,10 @@ const app = new Vue({
this.library.albums.meta = response.data.meta this.library.albums.meta = response.data.meta
}, },
async getListenNow(attempt = 0) { async getListenNow(attempt = 0) {
if (this.listennow.timestamp > Date.now() - 120000) {
return
}
if (attempt > 3) { if (attempt > 3) {
return return
} }
@ -2018,6 +2022,7 @@ const app = new Vue({
includeResponseMeta: !0, includeResponseMeta: !0,
reload: !0 reload: !0
})).data; })).data;
this.listennow.timestamp = Date.now()
console.log(this.listennow) console.log(this.listennow)
} catch (e) { } catch (e) {
console.log(e) console.log(e)
@ -2025,6 +2030,9 @@ const app = new Vue({
} }
}, },
async getBrowsePage(attempt = 0) { async getBrowsePage(attempt = 0) {
if (this.browsepage.timestamp > Date.now() - 120000) {
return
}
if (attempt > 3) { if (attempt > 3) {
return return
} }
@ -2041,6 +2049,7 @@ const app = new Vue({
"art[url]": "f" "art[url]": "f"
}); });
this.browsepage = browse.data.data[0]; this.browsepage = browse.data.data[0];
this.browsepage.timestamp = Date.now()
console.log(this.browsepage) console.log(this.browsepage)
} catch (e) { } catch (e) {
console.log(e) console.log(e)
@ -3407,6 +3416,7 @@ const app = new Vue({
let element = document.querySelector(selector); let element = document.querySelector(selector);
var overflowX = element.offsetWidth < element.scrollWidth, var overflowX = element.offsetWidth < element.scrollWidth,
overflowY = element.offsetHeight < element.scrollHeight; overflowY = element.offsetHeight < element.scrollHeight;
element.setAttribute('data-value', '\xa0\xa0\xa0\xa0' + element.textContent);
return (overflowX || overflowY); } catch (e) { return false} return (overflowX || overflowY); } catch (e) { return false}
}, },
@ -3414,34 +3424,6 @@ const app = new Vue({
//this.webremoteqr = await ipcRenderer.invoke('setRemoteQR','') //this.webremoteqr = await ipcRenderer.invoke('setRemoteQR','')
this.webremoteurl = await ipcRenderer.invoke('showQR','') this.webremoteurl = await ipcRenderer.invoke('showQR','')
//this.modals.qrcode = true; //this.modals.qrcode = true;
},
checkMarquee() {
if(isElementOverflowing('#app-main > div.app-chrome > div.app-chrome--center > div > div > div.playback-info > div.song-artist') == true) {
document.getElementsByClassName('song-artist')[0].classList.add('marquee');
document.getElementsByClassName('song-artist')[1].classList.add('marquee-after');
}
if(isElementOverflowing('#app-main > div.app-chrome > div.app-chrome--center > div > div > div.playback-info > div.song-name') == true) {
document.getElementsByClassName('song-name')[0].classList.add('marquee');
document.getElementsByClassName('song-name')[1].classList.add('marquee-after');
}
},
closeWindow(){
switch (app.cfg.general.close_behavior) {
case 0:
case '0':
ipcRenderer.send('close');
break;
case 1:
case '1':
ipcRenderer.send('minimize');
break;
case 2:
case '2':
ipcRenderer.send('minimizeTray');
break;
}
} }
} }

View file

@ -1111,6 +1111,9 @@ input[type=range].web-slider::-webkit-slider-runnable-track {
&.song-name{ &.song-name{
overflow: unset ; overflow: unset ;
} }
&::after{
content: attr(data-value);
}
} }
@ -1166,11 +1169,11 @@ input[type=range].web-slider::-webkit-slider-runnable-track {
@keyframes marquee { @keyframes marquee {
from { from {
transform: translateX(100%); transform: translateX(0);
} }
to { to {
transform: translateX(-100%); transform: translateX(-140%);
} }
} }
@ -1249,13 +1252,12 @@ input[type=range].web-slider::-webkit-slider-runnable-track {
display: flex; display: flex;
position: relative; position: relative;
} }
.app-chrome .app-chrome-item > .app-playback-controls .song-artist-album { .app-chrome .app-chrome-item > .app-playback-controls > div >.song-artist-album {
font-weight: 400; font-weight: 400;
font-size: 12px; font-size: 12px;
text-align: center; text-align: center;
/*height: 1.2em; /*height: 1.2em;
line-height: 1.2em;*/ line-height: 1.2em;*/
z-index: 1; z-index: 1;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -1263,11 +1265,18 @@ input[type=range].web-slider::-webkit-slider-runnable-track {
max-width: 340px; max-width: 340px;
overflow: hidden; overflow: hidden;
.song-artist-album-content{
font-weight: 400;
font-size: 12px;
text-align: center;
width:100%;
.song-artist-normal { &.song-artist-normal {
height: inherit; height: inherit;
}
} }
&.song-artist-marquee { &.song-artist-marquee {
> marquee { > marquee {
margin-bottom: -3px; margin-bottom: -3px;

View file

@ -86,17 +86,17 @@
<mediaitem-artwork :url="currentArtUrl"></mediaitem-artwork> <mediaitem-artwork :url="currentArtUrl"></mediaitem-artwork>
</div> </div>
<div class="playback-info"> <div class="playback-info">
<!-- :class="[isElementOverflowing('#app-main > div.app-chrome > div.app-chrome--center > div > div > div.playback-info > div.song-name') ? 'marquee' : '']" -->
<div class="song-name" style="-webkit-box-orient: horizontal;" <div class="song-name" style="-webkit-box-orient: horizontal;"
:class="[isElementOverflowing('#app-main > div.app-chrome > div.app-chrome--center > div > div > div.playback-info > div.song-name') ? 'marquee' : '']"
:style="[mk.nowPlayingItem['attributes']['contentRating'] == 'explicit' ? {'margin-left' : '23px'} : {'margin-left' : '0px'} ]"> :style="[mk.nowPlayingItem['attributes']['contentRating'] == 'explicit' ? {'margin-left' : '23px'} : {'margin-left' : '0px'} ]">
{{ mk.nowPlayingItem["attributes"]["name"] }} {{ mk.nowPlayingItem["attributes"]["name"] }}
<div class="explicit-icon" <div class="explicit-icon"
v-if="mk.nowPlayingItem['attributes']['contentRating'] == 'explicit'" v-if="mk.nowPlayingItem['attributes']['contentRating'] == 'explicit'"
style="display: inline-block"></div> style="display: inline-block"></div>
</div> </div>
<!-- :class="[isElementOverflowing('#app-main > div.app-chrome > div.app-chrome--center > div > div > div.playback-info > div.song-artist') ? 'marquee' : '']" --> <div class="song-artist-album">
<div class="song-artist-album" <div class="song-artist-album-content"
:class="[isElementOverflowing('#app-main > .app-chrome .app-chrome-item > .app-playback-controls > div >.song-artist-album > .song-artist-album-content') ? 'marquee' : '']"
style="display: inline-block; -webkit-box-orient: horizontal; white-space: nowrap;"> style="display: inline-block; -webkit-box-orient: horizontal; white-space: nowrap;">
<div class="item-navigate song-artist" style="display: inline-block" <div class="item-navigate song-artist" style="display: inline-block"
@click="getNowPlayingItemDetailed(`artist`)"> @click="getNowPlayingItemDetailed(`artist`)">
@ -110,6 +110,7 @@
(mk.nowPlayingItem["attributes"]["albumName"]) : "" }} (mk.nowPlayingItem["attributes"]["albumName"]) : "" }}
</div> </div>
</div> </div>
</div>
<div class="song-progress"> <div class="song-progress">
<div class="song-duration" <div class="song-duration"