Review of "Spotify Controls + Track Info" version 7

Details Page Preview

GNOME 45+ extension that integrates Spotify playback controls directly into your GNOME top bar. This extension is not affiliated, funded, or in any way associated with Spotify.

Extension Homepage
https://github.com/Sonath21/spotify-controls

No comments.

Diff Against

Files

Note: Binary files aren't shown on the web site. To see all files, please download the extension zipfile.

All Versions

Version Status
9 Active
8 Active
7 Rejected
6 Rejected
5 Active
4 Active
3 Rejected
2 Active
1 Rejected

Previous Reviews on this Version

JustPerfection rejected
Still the timeout isn't getting cleaned up on destroy (line 315 `extension.js`).
Sonath21 posted a review
So would something like the following work? async _retryFetchMetadata(retries = 3, delay = 500) { for (let i = 0; i < retries; i++) { try { let metadata = await this._getMetadata(); if (metadata['xesam:artist'] && metadata['xesam:title']) { this._updateTrackInfo(metadata); logDebug('Successfully fetched valid Metadata on retry'); return; } } catch (e) { logError(e, 'Retry fetching Metadata failed'); } // Await the cancellable sleep await this._sleep(delay); } logDebug('Failed to fetch valid Metadata after retries'); } _sleep(delay) { return new Promise((resolve) => { const timeoutID = setTimeout(() => { resolve(); // Remove the timeoutID from activeTimeouts once resolved const index = this._activeTimeouts.indexOf(timeoutID); if (index > -1) { this._activeTimeouts.splice(index, 1); } }, delay); this._activeTimeouts.push(timeoutID); }); } SpotifyIndicator.destroy(): ... // Clear all active timeouts for (let timeoutID of this._activeTimeouts) { clearTimeout(timeoutID); } this._activeTimeouts = [];
JustPerfection posted a review
Yes, that would be ok.