unreleased songs will now display properly
This commit is contained in:
parent
ed8e977786
commit
40c8925193
3 changed files with 1570 additions and 12 deletions
1538
src/renderer/less/elements.css
Normal file
1538
src/renderer/less/elements.css
Normal file
File diff suppressed because it is too large
Load diff
|
@ -547,6 +547,11 @@
|
||||||
color: #eee;
|
color: #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.disabled {
|
||||||
|
opacity: 0.5;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
// list item compact
|
// list item compact
|
||||||
&.compact {
|
&.compact {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
<div v-observe-visibility="{callback: visibilityChanged}"
|
<div v-observe-visibility="{callback: visibilityChanged}"
|
||||||
@contextmenu="contextMenu"
|
@contextmenu="contextMenu"
|
||||||
@click="select"
|
@click="select"
|
||||||
:data-id="item.attributes.playParams.id ?? item.id"
|
:data-id="itemId"
|
||||||
:data-type="getDataType()"
|
:data-type="getDataType()"
|
||||||
:data-index="index"
|
:data-index="index"
|
||||||
:data-guid="guid"
|
:data-guid="guid"
|
||||||
:data-islibrary="this.item.attributes.playParams.isLibrary ?? false"
|
:data-islibrary="isLibrary"
|
||||||
:key="item.attributes.playParams.id ?? item.id"
|
:key="itemId"
|
||||||
class="cd-mediaitem-list-item"
|
class="cd-mediaitem-list-item"
|
||||||
@mouseenter="checkLibrary"
|
@mouseenter="checkLibrary"
|
||||||
@mouseover="showInLibrary = true"
|
@mouseover="showInLibrary = true"
|
||||||
|
@ -26,12 +26,12 @@
|
||||||
<%- include("../svg/play.svg") %>
|
<%- include("../svg/play.svg") %>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!(app.mk.isPlaying && (((app.mk.nowPlayingItem._songId ?? (app.mk.nowPlayingItem.songId ?? app.mk.nowPlayingItem.id )) == item.attributes.playParams.id) || (app.mk.nowPlayingItem.id == item.id ))) && showIndex" :style="{display: ((showIndex && !showInLibrary) ? 'block' : 'none'), 'margin-left':'11px'}">
|
<div v-if="!(app.mk.isPlaying && (((app.mk.nowPlayingItem._songId ?? (app.mk.nowPlayingItem.songId ?? app.mk.nowPlayingItem.id )) == itemId) || (app.mk.nowPlayingItem.id == item.id ))) && showIndex" :style="{display: ((showIndex && !showInLibrary) ? 'block' : 'none'), 'margin-left':'11px'}">
|
||||||
<div>
|
<div>
|
||||||
<div>{{ (item.attributes && !showIndexPlaylist) ? (item.attributes.trackNumber ?? '') : ((index * 1 + 1 ) ?? '')}}</div>
|
<div>{{ (item.attributes && !showIndexPlaylist) ? (item.attributes.trackNumber ?? '') : ((index * 1 + 1 ) ?? '')}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="app.mk.isPlaying && (((app.mk.nowPlayingItem._songId ?? (app.mk.nowPlayingItem.songId ?? app.mk.nowPlayingItem.id )) == item.attributes.playParams.id) || (app.mk.nowPlayingItem.id == item.id))" :style="{display: (showInLibrary ? 'none' : 'block')}">
|
<div v-if="app.mk.isPlaying && (((app.mk.nowPlayingItem._songId ?? (app.mk.nowPlayingItem.songId ?? app.mk.nowPlayingItem.id )) == itemId) || (app.mk.nowPlayingItem.id == item.id))" :style="{display: (showInLibrary ? 'none' : 'block')}">
|
||||||
<div class="loadbar-sound"></div>
|
<div class="loadbar-sound"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -95,7 +95,9 @@
|
||||||
guid: this.uuidv4(),
|
guid: this.uuidv4(),
|
||||||
app: this.$root,
|
app: this.$root,
|
||||||
displayDuration: true,
|
displayDuration: true,
|
||||||
addClasses: {}
|
addClasses: {},
|
||||||
|
itemId: 0,
|
||||||
|
isLibrary: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
@ -112,6 +114,12 @@
|
||||||
'class-list': { type: String, required: false, default: "" },
|
'class-list': { type: String, required: false, default: "" },
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
if (this.item.attributes.playParams) {
|
||||||
|
this.itemId = this.item.attributes.playParams.id ?? this.item.id;
|
||||||
|
this.isLibrary = this.item.attributes.playParams.isLibrary ?? false;
|
||||||
|
} else {
|
||||||
|
this.itemId = this.item.id;
|
||||||
|
}
|
||||||
let duration = this.item.attributes.durationInMillis ?? 0
|
let duration = this.item.attributes.durationInMillis ?? 0
|
||||||
if (duration == 0 || !this.showDuration) {
|
if (duration == 0 || !this.showDuration) {
|
||||||
this.displayDuration = false
|
this.displayDuration = false
|
||||||
|
@ -135,8 +143,11 @@
|
||||||
return this.addedToLibrary
|
return this.addedToLibrary
|
||||||
},
|
},
|
||||||
getClasses() {
|
getClasses() {
|
||||||
|
this.addClasses = {}
|
||||||
|
if(typeof this.item.attributes.playParams == "undefined") {
|
||||||
|
this.addClasses["disabled"] = true
|
||||||
|
}
|
||||||
if (this.classList) {
|
if (this.classList) {
|
||||||
this.addClasses = {}
|
|
||||||
let classList = this.classList.split(' ')
|
let classList = this.classList.split(' ')
|
||||||
for (let i = 0; i < classList.length; i++) {
|
for (let i = 0; i < classList.length; i++) {
|
||||||
this.addClasses[classList[i]] = true
|
this.addClasses[classList[i]] = true
|
||||||
|
@ -160,10 +171,14 @@
|
||||||
return minutes + ":" + (seconds < 10 ? '0' : '') + seconds;
|
return minutes + ":" + (seconds < 10 ? '0' : '') + seconds;
|
||||||
},
|
},
|
||||||
getDataType() {
|
getDataType() {
|
||||||
if (this.item.attributes.playParams.isLibrary) {
|
if (typeof this.item.attributes.playParams != "undefined") {
|
||||||
|
if (this.item.attributes.playParams.isLibrary) {
|
||||||
|
return this.item.type
|
||||||
|
} else {
|
||||||
|
return this.item.attributes.playParams.kind
|
||||||
|
}
|
||||||
|
}else{
|
||||||
return this.item.type
|
return this.item.type
|
||||||
} else {
|
|
||||||
return this.item.attributes.playParams.kind
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
select(e) {
|
select(e) {
|
||||||
|
@ -537,7 +552,7 @@
|
||||||
array[j] = temp;
|
array[j] = temp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
app.mk.setQueue({ [truekind]: [item.attributes.playParams.id ?? item.id] , parameters : {l : this.app.mklang} }).then(function () {
|
app.mk.setQueue({ [truekind]: [item.attributes.playParams.id ?? item.id], parameters: { l: this.app.mklang } }).then(function () {
|
||||||
app.mk.play().then(function () {
|
app.mk.play().then(function () {
|
||||||
var playlistId = id
|
var playlistId = id
|
||||||
function getPlaylist(id, isLibrary) {
|
function getPlaylist(id, isLibrary) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue