diff --git a/CHANGELOG.md b/CHANGELOG.md index f124040..d535838 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ Change are listed in reverse chronological order (newest to oldest). +###### [ 1.0.11 ] - 2024/11/04 + + * Fixed a bug in all media list rendering controls that was causing the media list not to render for some browser types (Fire HD, iPad Air, etc). + * Replaced all `lastupdatedon` properties with `date_last_refreshed` property that is populated by the spotifywebapiPython package. + ###### [ 1.0.10 ] - 2024/11/03 * This release requires the SpotifyPlus v1.0.64 release; please make sure you update the SpotifyPlus integration prior to updating this SpotifyPlus Card release. diff --git a/src/components/artist-actions.ts b/src/components/artist-actions.ts index 820836b..41af640 100644 --- a/src/components/artist-actions.ts +++ b/src/components/artist-actions.ts @@ -4,6 +4,7 @@ import { property, state } from 'lit/decorators.js'; import copyTextToClipboard from 'copy-text-to-clipboard'; import { mdiAccountMusic, + mdiAlbum, mdiClipboardPlusOutline, mdiHeart, mdiHeartOutline, @@ -36,6 +37,7 @@ enum Actions { ArtistFavoriteAdd = "ArtistFavoriteAdd", ArtistFavoriteRemove = "ArtistFavoriteRemove", ArtistFavoriteUpdate = "ArtistFavoriteUpdate", + ArtistSearchAlbums = "ArtistSearchAlbums", ArtistSearchPlaylists = "ArtistSearchPlaylists", ArtistSearchRadio = "ArtistSearchRadio", ArtistSearchTracks = "ArtistSearchTracks", @@ -114,6 +116,10 @@ class ArtistActions extends FavActionsBase { + this.onClickAction(Actions.ArtistSearchAlbums)} hide=${this.hideSearchType(SearchMediaTypes.ALBUMS)}> + +
Search for Artist Albums
+
this.onClickAction(Actions.ArtistSearchPlaylists)} hide=${this.hideSearchType(SearchMediaTypes.PLAYLISTS)}>
Search Playlists for Artist
@@ -247,6 +253,11 @@ class ArtistActions extends FavActionsBase { copyTextToClipboard(this.mediaItem.uri); return true; + } else if (action == Actions.ArtistSearchAlbums) { + + this.dispatchEvent(SearchMediaEvent(SearchMediaTypes.ALBUMS, this.mediaItem.name)); + return true; + } else if (action == Actions.ArtistSearchPlaylists) { this.dispatchEvent(SearchMediaEvent(SearchMediaTypes.PLAYLISTS, this.mediaItem.name)); diff --git a/src/components/media-browser-icons.ts b/src/components/media-browser-icons.ts index 91c34c2..8f16b85 100644 --- a/src/components/media-browser-icons.ts +++ b/src/components/media-browser-icons.ts @@ -38,12 +38,7 @@ export class MediaBrowserIcons extends MediaBrowserBase { // render html. return html` - -
+
${buildMediaBrowserItems(this.items || [], this.config, this.mediaType, this.store).map( (item, index) => html` ${styleMediaBrowserItemBackgroundImage(item.mbi_item.image_url, index, this.mediaType)} @@ -79,33 +74,6 @@ export class MediaBrowserIcons extends MediaBrowserBase { `; } - //${(() => { - // if (this.isTouchDevice) { - // return (html` - // this.onMediaBrowserItemTouchStart(customEvent(ITEM_SELECTED, item))} - // @touchend=${() => this.onMediaBrowserItemTouchEnd(customEvent(ITEM_SELECTED, item))} - // > - // ${renderMediaBrowserItem(item, !item.mbi_item.image_url || !this.hideTitle, !this.hideSubTitle)} - // - // `); - // } else { - // return (html` - // this.onMediaBrowserItemClick(customEvent(ITEM_SELECTED, item))} - // @mousedown=${() => this.onMediaBrowserItemMouseDown()} - // @mouseup=${() => this.onMediaBrowserItemMouseUp(customEvent(ITEM_SELECTED, item))} - // > - // ${renderMediaBrowserItem(item, !item.mbi_item.image_url || !this.hideTitle, !this.hideSubTitle)} - // - // `); - // } - //})()} - /** * Style definitions used by this card section. diff --git a/src/components/media-browser-list.ts b/src/components/media-browser-list.ts index b39525f..58aec90 100644 --- a/src/components/media-browser-list.ts +++ b/src/components/media-browser-list.ts @@ -49,12 +49,7 @@ export class MediaBrowserList extends MediaBrowserBase { // render html. return html` - - + ${buildMediaBrowserItems(this.items || [], this.config, this.mediaType, this.store).map((item, index) => { return html` ${styleMediaBrowserItemBackgroundImage(item.mbi_item.image_url, index, this.mediaType)} diff --git a/src/constants.ts b/src/constants.ts index 5790caa..d1fb9e0 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,7 +1,7 @@ import { css } from 'lit'; /** current version of the card. */ -export const CARD_VERSION = '1.0.10'; +export const CARD_VERSION = '1.0.11'; /** SpotifyPlus integration domain identifier. */ export const DOMAIN_SPOTIFYPLUS = 'spotifyplus'; diff --git a/src/sections/album-fav-browser.ts b/src/sections/album-fav-browser.ts index 8a2e505..692a2f2 100644 --- a/src/sections/album-fav-browser.ts +++ b/src/sections/album-fav-browser.ts @@ -141,7 +141,7 @@ export class AlbumFavBrowser extends FavBrowserBase { // load media list results. this.mediaList = GetAlbums(result); - this.mediaListLastUpdatedOn = result.lastUpdatedOn || (Date.now() / 1000); + this.mediaListLastUpdatedOn = result.date_last_refreshed || (Date.now() / 1000); // call base class method, indicating media list update succeeded. super.updatedMediaListOk(); diff --git a/src/sections/artist-fav-browser.ts b/src/sections/artist-fav-browser.ts index 02d12ef..2550a20 100644 --- a/src/sections/artist-fav-browser.ts +++ b/src/sections/artist-fav-browser.ts @@ -139,7 +139,7 @@ export class ArtistFavBrowser extends FavBrowserBase { // load media list results. this.mediaList = result.items; - this.mediaListLastUpdatedOn = result.lastUpdatedOn || (Date.now() / 1000); + this.mediaListLastUpdatedOn = result.date_last_refreshed || (Date.now() / 1000); // call base class method, indicating media list update succeeded. super.updatedMediaListOk(); diff --git a/src/sections/audiobook-fav-browser.ts b/src/sections/audiobook-fav-browser.ts index b7f0555..da709c3 100644 --- a/src/sections/audiobook-fav-browser.ts +++ b/src/sections/audiobook-fav-browser.ts @@ -139,7 +139,7 @@ export class AudiobookFavBrowser extends FavBrowserBase { // load media list results. this.mediaList = result.items; - this.mediaListLastUpdatedOn = result.lastUpdatedOn || (Date.now() / 1000); + this.mediaListLastUpdatedOn = result.date_last_refreshed || (Date.now() / 1000); // call base class method, indicating media list update succeeded. super.updatedMediaListOk(); diff --git a/src/sections/device-browser.ts b/src/sections/device-browser.ts index 8862f10..018274f 100644 --- a/src/sections/device-browser.ts +++ b/src/sections/device-browser.ts @@ -221,7 +221,7 @@ export class DeviceBrowser extends FavBrowserBase { // load media list results. this.mediaList = result.Items; - this.mediaListLastUpdatedOn = result.lastUpdatedOn || (Date.now() / 1000); + this.mediaListLastUpdatedOn = result.DateLastRefreshed || (Date.now() / 1000); // call base class method, indicating media list update succeeded. super.updatedMediaListOk(); diff --git a/src/sections/episode-fav-browser.ts b/src/sections/episode-fav-browser.ts index f2a54fd..a838920 100644 --- a/src/sections/episode-fav-browser.ts +++ b/src/sections/episode-fav-browser.ts @@ -140,7 +140,7 @@ export class EpisodeFavBrowser extends FavBrowserBase { // load media list results. this.mediaList = GetEpisodes(result); - this.mediaListLastUpdatedOn = result.lastUpdatedOn || (Date.now() / 1000); + this.mediaListLastUpdatedOn = result.date_last_refreshed || (Date.now() / 1000); // call base class method, indicating media list update succeeded. super.updatedMediaListOk(); diff --git a/src/sections/playlist-fav-browser.ts b/src/sections/playlist-fav-browser.ts index 7ae06d9..bec8e16 100644 --- a/src/sections/playlist-fav-browser.ts +++ b/src/sections/playlist-fav-browser.ts @@ -139,7 +139,7 @@ export class PlaylistFavBrowser extends FavBrowserBase { // load media list results. this.mediaList = result.items; - this.mediaListLastUpdatedOn = result.lastUpdatedOn || (Date.now() / 1000); + this.mediaListLastUpdatedOn = result.date_last_refreshed || (Date.now() / 1000); // call base class method, indicating media list update succeeded. super.updatedMediaListOk(); diff --git a/src/sections/recent-browser.ts b/src/sections/recent-browser.ts index 417fd78..e9b2639 100644 --- a/src/sections/recent-browser.ts +++ b/src/sections/recent-browser.ts @@ -139,7 +139,7 @@ export class RecentBrowser extends FavBrowserBase { // load media list results. this.mediaList = GetTracks(result); - this.mediaListLastUpdatedOn = result.lastUpdatedOn || (Date.now() / 1000); + this.mediaListLastUpdatedOn = result.date_last_refreshed || (Date.now() / 1000); // call base class method, indicating media list update succeeded. super.updatedMediaListOk(); diff --git a/src/sections/search-media-browser.ts b/src/sections/search-media-browser.ts index 069e76a..290b668 100644 --- a/src/sections/search-media-browser.ts +++ b/src/sections/search-media-browser.ts @@ -490,7 +490,7 @@ export class SearchBrowser extends FavBrowserBase { // load media list results. this.mediaList = result.items as [any]; - this.mediaListLastUpdatedOn = result.lastUpdatedOn || (Date.now() / 1000); + this.mediaListLastUpdatedOn = result.date_last_refreshed || (Date.now() / 1000); // clear certain info messsages if they are temporary. if (this.alertInfo?.startsWith("Searching Spotify")) { diff --git a/src/sections/show-fav-browser.ts b/src/sections/show-fav-browser.ts index 4f176f3..94d03b1 100644 --- a/src/sections/show-fav-browser.ts +++ b/src/sections/show-fav-browser.ts @@ -141,7 +141,7 @@ export class ShowFavBrowser extends FavBrowserBase { // load media list results. this.mediaList = GetShows(result); - this.mediaListLastUpdatedOn = result.lastUpdatedOn || (Date.now() / 1000); + this.mediaListLastUpdatedOn = result.date_last_refreshed || (Date.now() / 1000); // call base class method, indicating media list update succeeded. super.updatedMediaListOk(); diff --git a/src/sections/track-fav-browser.ts b/src/sections/track-fav-browser.ts index d41a068..61877d2 100644 --- a/src/sections/track-fav-browser.ts +++ b/src/sections/track-fav-browser.ts @@ -141,7 +141,7 @@ export class TrackFavBrowser extends FavBrowserBase { // load media list results. this.mediaList = GetTracks(result); - this.mediaListLastUpdatedOn = result.lastUpdatedOn || (Date.now() / 1000); + this.mediaListLastUpdatedOn = result.date_last_refreshed || (Date.now() / 1000); // call base class method, indicating media list update succeeded. super.updatedMediaListOk(); diff --git a/src/services/spotifyplus-service.ts b/src/services/spotifyplus-service.ts index 4c36d1f..596fe12 100644 --- a/src/services/spotifyplus-service.ts +++ b/src/services/spotifyplus-service.ts @@ -145,13 +145,13 @@ export class SpotifyPlusService { }] }); - if (debuglog.enabled) { - debuglog("%cCallServiceWithResponse - Service %s response:\n%s", - "color: orange", - JSON.stringify(serviceRequest.service), - JSON.stringify(serviceResponse.response, null, 2) - ); - } + //if (debuglog.enabled) { + // debuglog("%cCallServiceWithResponse - Service %s response:\n%s", + // "color: orange", + // JSON.stringify(serviceRequest.service), + // JSON.stringify(serviceResponse.response, null, 2) + // ); + //} // return the service response data or an empty dictionary if no response data was generated. return JSON.stringify(serviceResponse.response) @@ -726,6 +726,16 @@ export class SpotifyPlusService { } } + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } @@ -807,10 +817,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + // return results to caller. return responseObj; } @@ -886,6 +902,16 @@ export class SpotifyPlusService { } } + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } @@ -970,10 +996,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + // return results to caller. return responseObj; } @@ -1031,6 +1063,16 @@ export class SpotifyPlusService { } } + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } @@ -1095,6 +1137,16 @@ export class SpotifyPlusService { } } + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } @@ -1164,6 +1216,16 @@ export class SpotifyPlusService { } } + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } @@ -1235,10 +1297,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + // return results to caller. return responseObj; } @@ -1306,6 +1374,16 @@ export class SpotifyPlusService { } } + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } @@ -1383,10 +1461,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + // return results to caller. return responseObj; } @@ -1460,10 +1544,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + // return results to caller. return responseObj; } @@ -1529,6 +1619,16 @@ export class SpotifyPlusService { } } + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } @@ -1593,6 +1693,16 @@ export class SpotifyPlusService { } } + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } @@ -1669,10 +1779,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + // return results to caller. return responseObj; } @@ -1760,8 +1876,18 @@ export class SpotifyPlusService { // set the lastUpdatedOn value to epoch (number of seconds), as the // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + responseObj.date_last_refreshed = responseObj.date_last_refreshed || (Date.now() / 1000); + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } @@ -1839,10 +1965,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + // return results to caller. return responseObj; } @@ -1914,10 +2046,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + // return results to caller. return responseObj; } @@ -2012,10 +2150,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + // return results to caller. return responseObj; } @@ -2091,6 +2235,16 @@ export class SpotifyPlusService { }) } + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } @@ -2167,10 +2321,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + // return results to caller. return responseObj; } @@ -2248,10 +2408,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + // return results to caller. return responseObj; } @@ -2308,6 +2474,16 @@ export class SpotifyPlusService { } } + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } @@ -2385,10 +2561,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + // return results to caller. return responseObj; } @@ -3059,9 +3241,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } @@ -3140,9 +3329,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } @@ -3223,9 +3419,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } @@ -3305,9 +3508,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } @@ -3386,9 +3596,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } @@ -3469,9 +3686,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } @@ -3554,9 +3778,16 @@ export class SpotifyPlusService { } } - // set the lastUpdatedOn value to epoch (number of seconds), as the - // service does not provide this field (but we need it for media list processing). - responseObj.lastUpdatedOn = Date.now() / 1000 + // trace. + if (debuglog.enabled) { + debuglog("%cCallServiceWithResponse - Service %s response (trimmed):\n%s", + "color: orange", + JSON.stringify(serviceRequest.service), + JSON.stringify(responseObj, null, 2) + ); + } + + // return results to caller. return responseObj; } diff --git a/src/types/spotifyplus/album-page-saved.ts b/src/types/spotifyplus/album-page-saved.ts index 362826c..55f97f2 100644 --- a/src/types/spotifyplus/album-page-saved.ts +++ b/src/types/spotifyplus/album-page-saved.ts @@ -16,13 +16,6 @@ export interface IAlbumPageSaved extends IPageObject { items: Array; - /** - * Date and time (in epoch format) of when the list was last updated. - * Note that this attribute does not exist in the service response. It was added here for convenience. - */ - lastUpdatedOn?: number; - - /** * Gets a list of all albums contained in the underlying `Items` list. * diff --git a/src/types/spotifyplus/album-page-simplified.ts b/src/types/spotifyplus/album-page-simplified.ts index 90a53c7..7cb0793 100644 --- a/src/types/spotifyplus/album-page-simplified.ts +++ b/src/types/spotifyplus/album-page-simplified.ts @@ -15,12 +15,6 @@ export interface IAlbumPageSimplified extends IPageObject { items: Array; - /** - * Date and time (in epoch format) of when the list was last updated. - * Note that this attribute does not exist in the service response. It was added here for convenience. - */ - lastUpdatedOn?: number; - } diff --git a/src/types/spotifyplus/artist-page.ts b/src/types/spotifyplus/artist-page.ts index ce4df4b..2691836 100644 --- a/src/types/spotifyplus/artist-page.ts +++ b/src/types/spotifyplus/artist-page.ts @@ -15,10 +15,4 @@ export interface IArtistPage extends IPageObject { items: Array; - /** - * Date and time (in epoch format) of when the list was last updated. - * Note that this attribute does not exist in the service response. It was added here for convenience. - */ - lastUpdatedOn?: number; - } diff --git a/src/types/spotifyplus/audiobook-page-simplified.ts b/src/types/spotifyplus/audiobook-page-simplified.ts index ab4ecb2..fdac4a8 100644 --- a/src/types/spotifyplus/audiobook-page-simplified.ts +++ b/src/types/spotifyplus/audiobook-page-simplified.ts @@ -15,13 +15,6 @@ export interface IAudiobookPageSimplified extends IPageObject { items: Array; - /** - * Date and time (in epoch format) of when the list was last updated. - * Note that this attribute does not exist in the service response. It was added here for convenience. - */ - lastUpdatedOn?: number; - - /** * Checks the `Items` collection to see if an item already exists with the * specified Id value. diff --git a/src/types/spotifyplus/chapter-page-simplified.ts b/src/types/spotifyplus/chapter-page-simplified.ts index 09786e6..3fdf632 100644 --- a/src/types/spotifyplus/chapter-page-simplified.ts +++ b/src/types/spotifyplus/chapter-page-simplified.ts @@ -15,13 +15,6 @@ export interface IChapterPageSimplified extends IPageObject { items: Array; - /** - * Date and time (in epoch format) of when the list was last updated. - * Note that this attribute does not exist in the service response. It was added here for convenience. - */ - lastUpdatedOn?: number; - - /** * Checks the `Items` collection to see if an item already exists with the * specified Id value. diff --git a/src/types/spotifyplus/episode-page-saved.ts b/src/types/spotifyplus/episode-page-saved.ts index 91cb703..d77e6bf 100644 --- a/src/types/spotifyplus/episode-page-saved.ts +++ b/src/types/spotifyplus/episode-page-saved.ts @@ -16,13 +16,6 @@ export interface IEpisodePageSaved extends IPageObject { items: Array; - /** - * Date and time (in epoch format) of when the list was last updated. - * Note that this attribute does not exist in the service response. It was added here for convenience. - */ - lastUpdatedOn?: number; - - /** * Gets a list of all episodes contained in the underlying `Items` list. * diff --git a/src/types/spotifyplus/episode-page-simplified.ts b/src/types/spotifyplus/episode-page-simplified.ts index d6d6988..ff84ee1 100644 --- a/src/types/spotifyplus/episode-page-simplified.ts +++ b/src/types/spotifyplus/episode-page-simplified.ts @@ -15,13 +15,6 @@ export interface IEpisodePageSimplified extends IPageObject { items: Array; - /** - * Date and time (in epoch format) of when the list was last updated. - * Note that this attribute does not exist in the service response. It was added here for convenience. - */ - lastUpdatedOn?: number; - - /** * Checks the `Items` collection to see if an item already exists with the * specified Id value. diff --git a/src/types/spotifyplus/play-history-page.ts b/src/types/spotifyplus/play-history-page.ts index 3d1b38c..f0e055b 100644 --- a/src/types/spotifyplus/play-history-page.ts +++ b/src/types/spotifyplus/play-history-page.ts @@ -16,13 +16,6 @@ export interface IPlayHistoryPage extends IPageObject { items: Array; - /** - * Date and time (in epoch format) of when the list was last updated. - * Note that this attribute does not exist in the service response. It was added here for convenience. - */ - lastUpdatedOn?: number; - - /** * Gets a list of all tracks contained in the underlying `Items` list. * diff --git a/src/types/spotifyplus/play-history.ts b/src/types/spotifyplus/play-history.ts index 4d6a5bd..cc36fd0 100644 --- a/src/types/spotifyplus/play-history.ts +++ b/src/types/spotifyplus/play-history.ts @@ -33,10 +33,4 @@ export interface IPlayHistory { track: ITrack; - /** - * Date and time (in epoch format) of when the list was last updated. - * Note that this attribute does not exist in the service response. It was added here for convenience. - */ - lastUpdatedOn?: number; - } diff --git a/src/types/spotifyplus/player-queue-info.ts b/src/types/spotifyplus/player-queue-info.ts index e5421d2..b1e9cdb 100644 --- a/src/types/spotifyplus/player-queue-info.ts +++ b/src/types/spotifyplus/player-queue-info.ts @@ -36,6 +36,6 @@ export interface IPlayerQueueInfo { * Date and time (in epoch format) of when the list was last updated. * Note that this attribute does not exist in the service response. It was added here for convenience. */ - lastUpdatedOn?: number; + date_last_refreshed?: number; } diff --git a/src/types/spotifyplus/playlist-page-simplified.ts b/src/types/spotifyplus/playlist-page-simplified.ts index b7100e0..4be62d5 100644 --- a/src/types/spotifyplus/playlist-page-simplified.ts +++ b/src/types/spotifyplus/playlist-page-simplified.ts @@ -15,13 +15,6 @@ export interface IPlaylistPageSimplified extends IPageObject { items: Array; - /** - * Date and time (in epoch format) of when the list was last updated. - * Note that this attribute does not exist in the service response. It was added here for convenience. - */ - lastUpdatedOn?: number; - - /** * Checks the `Items` collection to see if an item already exists with the * specified Id value. diff --git a/src/types/spotifyplus/playlist-page.ts b/src/types/spotifyplus/playlist-page.ts index d093952..29a172f 100644 --- a/src/types/spotifyplus/playlist-page.ts +++ b/src/types/spotifyplus/playlist-page.ts @@ -16,13 +16,6 @@ export interface IPlaylistPage extends IPageObject { items: Array; - /** - * Date and time (in epoch format) of when the list was last updated. - * Note that this attribute does not exist in the service response. It was added here for convenience. - */ - lastUpdatedOn?: number; - - /** * Gets a list of all tracks contained in the underlying `Items` list. * diff --git a/src/types/spotifyplus/show-page-saved.ts b/src/types/spotifyplus/show-page-saved.ts index c78e2cf..e3a89ea 100644 --- a/src/types/spotifyplus/show-page-saved.ts +++ b/src/types/spotifyplus/show-page-saved.ts @@ -17,13 +17,6 @@ export interface IShowPageSaved extends IPageObject { items: Array; - /** - * Date and time (in epoch format) of when the list was last updated. - * Note that this attribute does not exist in the service response. It was added here for convenience. - */ - lastUpdatedOn?: number; - - /** * Gets a list of all shows contained in the underlying `Items` list. * diff --git a/src/types/spotifyplus/show-page-simplified.ts b/src/types/spotifyplus/show-page-simplified.ts index 2869b4a..684710e 100644 --- a/src/types/spotifyplus/show-page-simplified.ts +++ b/src/types/spotifyplus/show-page-simplified.ts @@ -15,13 +15,6 @@ export interface IShowPageSimplified extends IPageObject { items: Array; - /** - * Date and time (in epoch format) of when the list was last updated. - * Note that this attribute does not exist in the service response. It was added here for convenience. - */ - lastUpdatedOn?: number; - - /** * Checks the `Items` collection to see if an item already exists with the * specified Id value. diff --git a/src/types/spotifyplus/spotify-connect-devices.ts b/src/types/spotifyplus/spotify-connect-devices.ts index 51ff7e0..382f730 100644 --- a/src/types/spotifyplus/spotify-connect-devices.ts +++ b/src/types/spotifyplus/spotify-connect-devices.ts @@ -29,13 +29,6 @@ export interface ISpotifyConnectDevices { ItemsCount: number; - /** - * Date and time (in epoch format) of when the list was last updated. - * Note that this attribute does not exist in the service response. It was added here for convenience. - * Used by SpotifyPlusCard only. - */ - lastUpdatedOn?: number; - } diff --git a/src/types/spotifyplus/track-page-saved.ts b/src/types/spotifyplus/track-page-saved.ts index 56e4073..384ea0d 100644 --- a/src/types/spotifyplus/track-page-saved.ts +++ b/src/types/spotifyplus/track-page-saved.ts @@ -16,13 +16,6 @@ export interface ITrackPageSaved extends IPageObject { items: Array; - /** - * Date and time (in epoch format) of when the list was last updated. - * Note that this attribute does not exist in the service response. It was added here for convenience. - */ - lastUpdatedOn?: number; - - /** * Gets a list of all tracks contained in the underlying `items` list. * diff --git a/src/types/spotifyplus/track-page.ts b/src/types/spotifyplus/track-page.ts index 171aed3..affd48d 100644 --- a/src/types/spotifyplus/track-page.ts +++ b/src/types/spotifyplus/track-page.ts @@ -15,10 +15,4 @@ export interface ITrackPage extends IPageObject { items: Array; - /** - * Date and time (in epoch format) of when the list was last updated. - * Note that this attribute does not exist in the service response. It was added here for convenience. - */ - lastUpdatedOn?: number; - }