Merge branch 'ciderapp:upcoming' into upcoming
This commit is contained in:
commit
77851b8bde
18 changed files with 634 additions and 85 deletions
|
@ -134,9 +134,7 @@ const app = new Vue({
|
|||
platform: "",
|
||||
mk: {},
|
||||
quickPlayQuery: "",
|
||||
lz: {
|
||||
|
||||
},
|
||||
lz: ipcRenderer.sendSync("get-i18n", "en_US"),
|
||||
search: {
|
||||
term: "",
|
||||
hints: [],
|
||||
|
@ -339,6 +337,12 @@ const app = new Vue({
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
setLz(lang) {
|
||||
if(lang == "") {
|
||||
lang = this.cfg.general.language
|
||||
}
|
||||
this.lz = ipcRenderer.sendSync("get-i18n", lang)
|
||||
},
|
||||
getLz(message) {
|
||||
if(this.lz[message]) {
|
||||
return this.lz[message]
|
||||
|
@ -499,6 +503,7 @@ const app = new Vue({
|
|||
},
|
||||
async init() {
|
||||
let self = this
|
||||
this.setLz(this.cfg.general.language)
|
||||
clearTimeout(this.hangtimer)
|
||||
this.mk = MusicKit.getInstance()
|
||||
let needsReload = (typeof localStorage["music.ampwebplay.media-user-token"] == "undefined")
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
v-observe-visibility="{callback: visibilityChanged}">
|
||||
<img :src="app.getMediaItemArtwork(url, size, width)"
|
||||
decoding="async" loading="lazy"
|
||||
:style="{background: bgcolor}"
|
||||
class="mediaitem-artwork--img">
|
||||
<div v-if="video && isVisible && getVideoPriority()" class="animatedartwork-view-box">
|
||||
<animatedartwork-view :priority="getVideoPriority()" :video="video"></animatedartwork-view>
|
||||
|
@ -22,6 +23,10 @@
|
|||
type: [String, Number],
|
||||
required: false
|
||||
},
|
||||
bgcolor: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
url: {
|
||||
type: String,
|
||||
default: ''
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
<mediaitem-artwork
|
||||
:url="item.attributes.artwork ? item.attributes.artwork.url : ''"
|
||||
:size="48"
|
||||
:bgcolor="getBgColor()"
|
||||
:type="item.type"></mediaitem-artwork>
|
||||
<button class="overlay-play" @click="playTrack()"><%- include("../svg/play.svg") %></button>
|
||||
</div>
|
||||
|
@ -102,6 +103,10 @@
|
|||
this.getClasses()
|
||||
},
|
||||
methods: {
|
||||
getBgColor() {
|
||||
let color = `#${(this.item.attributes.artwork != null && this.item.attributes.artwork.bgColor != null) ? (this.item.attributes.artwork.bgColor) : ``}`
|
||||
return color
|
||||
},
|
||||
async checkLibrary() {
|
||||
if(this.addedToLibrary) {return this.addedToLibrary}
|
||||
if(this.item.type.includes("library-playlists") || this.item.type.includes("station")) {
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
:video="(item.attributes != null && item.attributes.editorialVideo != null) ? (item.attributes.editorialVideo.motionDetailSquare ? item.attributes.editorialVideo.motionDetailSquare.video : (item.attributes.editorialVideo.motionSquareVideo1x1 ? item.attributes.editorialVideo.motionSquareVideo1x1.video : '')) : '' "
|
||||
:size="size"
|
||||
shadow="subtle"
|
||||
:bgcolor="getBgColor()"
|
||||
:type="item.type"></mediaitem-artwork>
|
||||
</div>
|
||||
<button class="menu-btn" v-if="!nomenu.includes(item.type)"
|
||||
|
@ -75,22 +76,8 @@
|
|||
},
|
||||
methods: {
|
||||
getBgColor() {
|
||||
let color = `#${(this.item.attributes.artwork != null && this.item.attributes.artwork.bgColor != null) ? (this.item.attributes.artwork.bgColor) : `333333`}`
|
||||
let c = color.substring(1); // strip #
|
||||
var rgb = parseInt(c, 16); // convert rrggbb to decimal
|
||||
var r = (rgb >> 16) & 0xff; // extract red
|
||||
var g = (rgb >> 8) & 0xff; // extract green
|
||||
var b = (rgb >> 0) & 0xff; // extract blue
|
||||
|
||||
var luma = 0.2126 * r + 0.7152 * g + 0.0722 * b; // per ITU-R BT.709
|
||||
|
||||
if (luma > 140) {
|
||||
return "#aaaaaa"
|
||||
}else{
|
||||
return color
|
||||
}
|
||||
|
||||
|
||||
let color = `#${(this.item.attributes.artwork != null && this.item.attributes.artwork.bgColor != null) ? (this.item.attributes.artwork.bgColor) : ``}`
|
||||
return color
|
||||
},
|
||||
getSubtitle() {
|
||||
if(this.kind == 'card') {
|
||||
|
|
|
@ -204,32 +204,32 @@
|
|||
<div class="app-sidebar-header-text">
|
||||
Cider
|
||||
</div>
|
||||
<sidebar-library-item name="Home" svg-icon="./assets/feather/home.svg" page="home">
|
||||
<sidebar-library-item :name="$root.getLz('home.title')" svg-icon="./assets/feather/home.svg" page="home">
|
||||
</sidebar-library-item>
|
||||
<div class="app-sidebar-header-text">
|
||||
Apple Music
|
||||
</div>
|
||||
<sidebar-library-item name="Listen Now" svg-icon="./assets/feather/play-circle.svg"
|
||||
<sidebar-library-item :name="$root.getLz('term.listenNow')" svg-icon="./assets/feather/play-circle.svg"
|
||||
page="listen_now"></sidebar-library-item>
|
||||
<sidebar-library-item name="Browse" svg-icon="./assets/feather/globe.svg" page="browse">
|
||||
<sidebar-library-item :name="$root.getLz('term.browse')" svg-icon="./assets/feather/globe.svg" page="browse">
|
||||
</sidebar-library-item>
|
||||
<sidebar-library-item name="Radio" svg-icon="./assets/feather/radio.svg" page="radio">
|
||||
<sidebar-library-item :name="$root.getLz('term.radio')" svg-icon="./assets/feather/radio.svg" page="radio">
|
||||
</sidebar-library-item>
|
||||
<div class="app-sidebar-header-text">
|
||||
Library
|
||||
</div>
|
||||
<sidebar-library-item name="Recently Added" svg-icon="./assets/feather/plus-circle.svg"
|
||||
<sidebar-library-item :name="$root.getLz('term.recentlyAdded')" svg-icon="./assets/feather/plus-circle.svg"
|
||||
page="library-recentlyadded"></sidebar-library-item>
|
||||
<sidebar-library-item name="Songs" svg-icon="./assets/feather/music.svg"
|
||||
<sidebar-library-item :name="$root.getLz('term.songs')" svg-icon="./assets/feather/music.svg"
|
||||
page="library-songs"></sidebar-library-item>
|
||||
<sidebar-library-item name="Albums" svg-icon="./assets/feather/disc.svg"
|
||||
<sidebar-library-item :name="$root.getLz('term.albums')" svg-icon="./assets/feather/disc.svg"
|
||||
page="library-albums"></sidebar-library-item>
|
||||
<sidebar-library-item name="Artists" svg-icon="./assets/feather/user.svg"
|
||||
<sidebar-library-item :name="$root.getLz('term.artists')" svg-icon="./assets/feather/user.svg"
|
||||
page="library-artists"></sidebar-library-item>
|
||||
<sidebar-library-item name="Podcasts" svg-icon="./assets/feather/mic.svg" page="podcasts">
|
||||
<sidebar-library-item :name="$root.getLz('term.podcasts')" svg-icon="./assets/feather/mic.svg" page="podcasts">
|
||||
</sidebar-library-item>
|
||||
<div class="app-sidebar-header-text" @contextmenu="playlistHeaderContextMenu">
|
||||
Playlists
|
||||
{{ $root.getLz('term.playlists') }}
|
||||
</div>
|
||||
<sidebar-playlist v-for="item in getPlaylistFolderChildren('p.playlistsroot')" :item="item">
|
||||
</sidebar-playlist>
|
||||
|
@ -240,7 +240,7 @@
|
|||
<button class="usermenu-item" @click="showWebRemoteQR()">
|
||||
<div class="row nopadding">
|
||||
<div class="col nopadding">
|
||||
Show Web Remote QR
|
||||
{{$root.getLz('action.showWebRemoteQR')}}
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
|
|
|
@ -508,6 +508,22 @@
|
|||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="md-option-line">
|
||||
<div class="md-option-segment">
|
||||
Language
|
||||
</div>
|
||||
<div class="md-option-segment md-option-segment_auto">
|
||||
<select class="md-select" @change="$root.setLz('')" v-model="app.cfg.general.language">
|
||||
<option value="en_US">en_US</option>
|
||||
<option value="el_GR">el_GR</option>
|
||||
<option value="ja_JP">ja_JP</option>
|
||||
<option value="tr_TR">tr_TR</option>
|
||||
<option value="zh_CN">zh_CN</option>
|
||||
<option value="zh_TW">zh_TW</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="opacity: 0.5; pointer-events: none">
|
||||
<div class="md-option-header">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue