diff --git a/js/ui.js b/js/ui.js index f29712a..b3129e6 100644 --- a/js/ui.js +++ b/js/ui.js @@ -3605,6 +3605,11 @@ export class UIRenderer { finalAlbums = Array.from(albumMap.values()); } + const isLicensed = (item) => !item.copyright || !item.copyright.toLowerCase().includes(atob('emVl')); + finalTracks = finalTracks.filter(isLicensed); + finalVideos = finalVideos.filter(isLicensed); + finalAlbums = finalAlbums.filter(isLicensed); + // Track search with results const totalResults = finalTracks.length + finalArtists.length + finalAlbums.length + finalPlaylists.length; @@ -3799,6 +3804,22 @@ export class UIRenderer { const { album, tracks } = await this.api.getAlbum(albumId, provider); this.currentAlbumId = albumId; + if (album.copyright && album.copyright.toLowerCase().includes(atob('emVl'))) { + imageEl.src = ''; + imageEl.style.backgroundColor = 'transparent'; + titleEl.textContent = ''; + metaEl.textContent = ''; + prodEl.textContent = ''; + rateCriticsEl.textContent = ''; + rateUsersEl.textContent = ''; + tracklistContainer.innerHTML = ''; + if (playBtn) playBtn.style.display = 'none'; + if (dlBtn) dlBtn.style.display = 'none'; + document.getElementById('page-album').innerHTML = + '

This content is unavailable due to a DMCA notice.

'; + return; + } + const videoCoverUrl = album.videoCoverUrl || null; if (!videoCoverUrl && tracks.length > 0) { @@ -5051,6 +5072,11 @@ export class UIRenderer { } }); + const isLicensed = (item) => !item.copyright || !item.copyright.toLowerCase().includes(atob('emVl')); + artist.tracks = artist.tracks.filter(isLicensed); + artist.albums = artist.albums.filter(isLicensed); + if (artist.eps) artist.eps = artist.eps.filter(isLicensed); + await this.renderListWithTracks(tracksContainer, artist.tracks, true); // "In your library" section: find liked tracks and playlist tracks for this artist @@ -6001,6 +6027,12 @@ export class UIRenderer { track = await this.api.getTrackMetadata(trackId); this.currentTrackPageId = track.id; + if (track.copyright && track.copyright.toLowerCase().includes(atob('emVl'))) { + document.getElementById('page-track').innerHTML = + '

This content is unavailable due to a DMCA notice.

'; + return; + } + let videoCoverUrl = track.videoUrl || track.videoCoverUrl || track.album?.videoCoverUrl || null; if (!videoCoverUrl && (track.album || track.type === 'video')) {