Skip to content

Commit

Permalink
use native thumbnail without modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
Araxeus committed Nov 12, 2021
1 parent 08fdd07 commit cfe719b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/video-toggle/front.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@ function observeThumbnail() {
function forceThumbnail(img) {
const thumbnails = $('#movie_player').getPlayerResponse()?.videoDetails?.thumbnail?.thumbnails;
if (thumbnails && thumbnails.length > 0) {
img.src = thumbnails[thumbnails.length - 1].url;
img.src = thumbnails[thumbnails.length - 1].url.split("?")[0];
}
}
2 changes: 1 addition & 1 deletion providers/song-info-front.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ module.exports = () => {
// name = "dataloaded" and abit later "dataupdated"
apiEvent.detail.addEventListener('videodatachange', (name, dataEvent) => {
if (name !== 'dataloaded') return;
ipcRenderer.send("song-info-request", JSON.stringify(dataEvent.playerResponse));
video.dispatchEvent(srcChangedEvent);
ipcRenderer.send("song-info-request", JSON.stringify(dataEvent.playerResponse));
})

}, { once: true, passive: true });
Expand Down
2 changes: 1 addition & 1 deletion providers/song-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const handleData = async (responseText, win) => {
songInfo.title = cleanupName(data?.videoDetails?.title);
songInfo.artist =cleanupName(data?.videoDetails?.author);
songInfo.views = data?.videoDetails?.viewCount;
songInfo.imageSrc = data?.videoDetails?.thumbnail?.thumbnails?.pop()?.url;
songInfo.imageSrc = data?.videoDetails?.thumbnail?.thumbnails?.pop()?.url.split("?")[0];
songInfo.songDuration = data?.videoDetails?.lengthSeconds;
songInfo.image = await getImage(songInfo.imageSrc);
songInfo.uploadDate = data?.microformat?.microformatDataRenderer?.uploadDate;
Expand Down

0 comments on commit cfe719b

Please sign in to comment.