Update: Hide play button for music folders

pull/52/head
Juraj Nyíri 3 years ago
parent a99ced6b26
commit 088d46f384

@ -19826,6 +19826,10 @@ class PlayController {
this.playButtons.push(playButton); this.playButtons.push(playButton);
return playButton; return playButton;
}; };
this.setPlayActionDisplay = (displayValue) => {
const playActionButton = this.updateDetailPlayAction();
playActionButton.style.display = displayValue;
};
this.setPlayActionButtonType = (mediaType) => { this.setPlayActionButtonType = (mediaType) => {
const playActionButton = this.updateDetailPlayAction(); const playActionButton = this.updateDetailPlayAction();
playActionButton.setAttribute('data-mediaType', mediaType); playActionButton.setAttribute('data-mediaType', mediaType);
@ -22981,6 +22985,14 @@ class PlexMeetsHomeAssistant extends HTMLElement {
lodash.includes(data.key, 'folder')) { lodash.includes(data.key, 'folder')) {
childrenData = await this.plex.getLibraryData(data.key); childrenData = await this.plex.getLibraryData(data.key);
} }
if (this.playController) {
if (lodash.includes(data.key, 'folder')) {
this.playController.setPlayActionDisplay('none');
}
else {
this.playController.setPlayActionDisplay('block');
}
}
let dataDetails = {}; let dataDetails = {};
if (!lodash.isNil(data.key)) { if (!lodash.isNil(data.key)) {
if (!lodash.includes(data.key, 'folder')) { if (!lodash.includes(data.key, 'folder')) {

@ -507,6 +507,11 @@ class PlayController {
return playButton; return playButton;
}; };
setPlayActionDisplay = (displayValue: string): void => {
const playActionButton = this.updateDetailPlayAction();
playActionButton.style.display = displayValue;
};
setPlayActionButtonType = (mediaType: string): void => { setPlayActionButtonType = (mediaType: string): void => {
const playActionButton = this.updateDetailPlayAction(); const playActionButton = this.updateDetailPlayAction();
playActionButton.setAttribute('data-mediaType', mediaType); playActionButton.setAttribute('data-mediaType', mediaType);

@ -1353,6 +1353,13 @@ class PlexMeetsHomeAssistant extends HTMLElement {
) { ) {
childrenData = await this.plex.getLibraryData(data.key); childrenData = await this.plex.getLibraryData(data.key);
} }
if (this.playController) {
if (_.includes(data.key, 'folder')) {
this.playController.setPlayActionDisplay('none');
} else {
this.playController.setPlayActionDisplay('block');
}
}
let dataDetails: Record<string, any> = {}; let dataDetails: Record<string, any> = {};
if (!_.isNil(data.key)) { if (!_.isNil(data.key)) {
if (!_.includes(data.key, 'folder')) { if (!_.includes(data.key, 'folder')) {

Loading…
Cancel
Save