mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-17 05:02:06 +00:00
lint
This commit is contained in:
@ -18,7 +18,7 @@ const srcChangedEvent = new CustomEvent('srcChanged');
|
|||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
document.addEventListener('apiLoaded', apiEvent => {
|
document.addEventListener('apiLoaded', apiEvent => {
|
||||||
if (config.plugins.isEnabled('tuna-obs')) {
|
if (config.plugins.isEnabled('tuna-obs')) {
|
||||||
setupTimeChangeListener();
|
setupTimeChangeListener();
|
||||||
}
|
}
|
||||||
const video = $('video');
|
const video = $('video');
|
||||||
@ -42,7 +42,7 @@ module.exports = () => {
|
|||||||
|
|
||||||
function sendSongInfo() {
|
function sendSongInfo() {
|
||||||
const data = apiEvent.detail.getPlayerResponse();
|
const data = apiEvent.detail.getPlayerResponse();
|
||||||
data.videoDetails.album = $('ytmusic-player-page')?.__data?.playerPageWatchMetadata?.albumName?.runs[0].text
|
data.videoDetails.album = $('ytmusic-player-page')?.__data?.playerPageWatchMetadata?.albumName?.runs[0].text
|
||||||
data.videoDetails.elapsedSeconds = Math.floor(video.currentTime);
|
data.videoDetails.elapsedSeconds = Math.floor(video.currentTime);
|
||||||
data.videoDetails.isPaused = false;
|
data.videoDetails.isPaused = false;
|
||||||
ipcRenderer.send("video-src-changed", JSON.stringify(data));
|
ipcRenderer.send("video-src-changed", JSON.stringify(data));
|
||||||
|
|||||||
@ -58,7 +58,7 @@ const handleData = async (responseText, win) => {
|
|||||||
songInfo.elapsedSeconds = videoDetails.elapsedSeconds;
|
songInfo.elapsedSeconds = videoDetails.elapsedSeconds;
|
||||||
songInfo.isPaused = videoDetails.isPaused;
|
songInfo.isPaused = videoDetails.isPaused;
|
||||||
songInfo.videoId = videoDetails.videoId;
|
songInfo.videoId = videoDetails.videoId;
|
||||||
songInfo.album = data?.videoDetails?.album
|
songInfo.album = data?.videoDetails?.album; // Will be undefined if video exist
|
||||||
|
|
||||||
const oldUrl = songInfo.imageSrc;
|
const oldUrl = songInfo.imageSrc;
|
||||||
songInfo.imageSrc = videoDetails.thumbnail?.thumbnails?.pop()?.url.split("?")[0];
|
songInfo.imageSrc = videoDetails.thumbnail?.thumbnails?.pop()?.url.split("?")[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user