Skip to content

Commit d8adb37

Browse files
committed
[ 1.0.23 ] * This release requires the SpotifyPlus Integration v1.0.73+ release; please make sure you update the SpotifyPlus integration prior to updating this SpotifyPlus Card release.
* Fixed hidden volume controls, which was caused by a bug introduced with v1.0.20. * Added the ability to disable image caching for userpreset images. More info can be found on the [wiki docs](https://github.com/thlucas1/spotifyplus_card/wiki/Configuration-Options#userpresets-image-url-caching.)
1 parent b319159 commit d8adb37

File tree

5 files changed

+22
-9
lines changed

5 files changed

+22
-9
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Change are listed in reverse chronological order (newest to oldest).
66

77
<span class="changelog">
88

9+
###### [ 1.0.23 ] - 2024/12/20
10+
11+
* This release requires the SpotifyPlus Integration v1.0.73+ release; please make sure you update the SpotifyPlus integration prior to updating this SpotifyPlus Card release.
12+
* Fixed hidden volume controls, which was caused by a bug introduced with v1.0.20.
13+
* Added the ability to disable image caching for userpreset images. More info can be found on the [wiki docs](https://github.com/thlucas1/spotifyplus_card/wiki/Configuration-Options#userpresets-image-url-caching.)
14+
915
###### [ 1.0.22 ] - 2024/12/18
1016

1117
* This release requires the SpotifyPlus Integration v1.0.72+ release; please make sure you update the SpotifyPlus integration prior to updating this SpotifyPlus Card release.

src/components/player-controls.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,9 +548,8 @@ class PlayerControls extends LitElement {
548548
} else if (feature == TURN_ON) {
549549

550550
if (this.player.supportsFeature(TURN_ON)) {
551-
//if ([MediaPlayerState.OFF, MediaPlayerState.UNKNOWN, MediaPlayerState.STANDBY].includes(this.player.state)) {
552551
if ([MediaPlayerState.OFF, MediaPlayerState.STANDBY].includes(this.player.state)) {
553-
return nothing; // show icon
552+
return (this.config.playerVolumeControlsHidePower) ? true : nothing;
554553
}
555554
return true; // hide icon
556555
}

src/components/player-volume.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class Volume extends LitElement {
227227

228228
if (this.player.supportsFeature(TURN_ON)) {
229229
if ([MediaPlayerState.OFF, MediaPlayerState.UNKNOWN, MediaPlayerState.STANDBY].includes(this.player.state)) {
230-
return (this.config.playerVolumeControlsHidePower || nothing); // show / hide icon based on config settings
230+
return (this.config.playerVolumeControlsHidePower) ? true : nothing;
231231
}
232232
return true; // hide icon
233233
}
@@ -236,18 +236,20 @@ class Volume extends LitElement {
236236

237237
if (this.player.supportsFeature(TURN_OFF)) {
238238
if (![MediaPlayerState.OFF, MediaPlayerState.UNKNOWN, MediaPlayerState.STANDBY].includes(this.player.state)) {
239-
return (this.config.playerVolumeControlsHidePower || nothing); // show / hide icon based on config settings
239+
return (this.config.playerVolumeControlsHidePower) ? true : nothing;
240240
}
241241
return true; // hide icon
242242
}
243243

244244
} else if (feature == VOLUME_MUTE) {
245245

246-
return !this.player.supportsFeature(VOLUME_MUTE);
246+
if (this.player.supportsFeature(VOLUME_MUTE))
247+
return nothing;
247248

248249
} else if (feature == VOLUME_SET) {
249250

250-
return !this.player.supportsFeature(VOLUME_SET);
251+
if (this.player.supportsFeature(VOLUME_SET))
252+
return nothing;
251253

252254
}
253255

src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { css } from 'lit';
22

33
/** current version of the card. */
4-
export const CARD_VERSION = '1.0.22';
4+
export const CARD_VERSION = '1.0.23';
55

66
/** SpotifyPlus integration domain identifier. */
77
export const DOMAIN_SPOTIFYPLUS = 'spotifyplus';

src/sections/userpreset-browser.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,12 @@ export class UserPresetBrowser extends FavBrowserBase {
290290
const result = JSON.parse(JSON.stringify(this.config.userPresets || [])) as IUserPreset[];
291291
if (result) {
292292

293-
// set where the configuration items were loaded from.
293+
// set where the configuration items were loaded from, and
294+
// replace nocache indicator if specified.
295+
const noCacheKey = "nocache=" + getUtcNowTimestamp();
294296
result.forEach(item => {
295297
item.origin = "card config";
298+
item.image_url = (item.image_url || "").replace("{nocache}", noCacheKey);
296299
});
297300

298301
// append results to media list.
@@ -333,9 +336,12 @@ export class UserPresetBrowser extends FavBrowserBase {
333336
const responseObj = response as IUserPreset[]
334337
if (responseObj) {
335338

336-
// set where the configuration items were loaded from.
339+
// set where the configuration items were loaded from, and
340+
// replace nocache indicator if specified.
341+
const noCacheKey = "nocache=" + getUtcNowTimestamp();
337342
responseObj.forEach(item => {
338343
item.origin = this.config.userPresetsFile as string;
344+
item.image_url = (item.image_url || "").replace("{nocache}", noCacheKey);
339345
});
340346

341347
// append results to media list.

0 commit comments

Comments
 (0)