Skip to content

Commit

Permalink
fix locating songs
Browse files Browse the repository at this point in the history
  • Loading branch information
yuygfgg committed Jul 21, 2024
1 parent 197b897 commit 136379d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion webui/album.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ <h2>全部歌曲 (共 <span id="song-count">0</span> 首)</h2>
throw new Error("缺少专辑UUID参数");
}

let currentIndex = 0;
window.currentIndex = 0;
let songs = [];
let currentSong = null;

Expand Down
2 changes: 1 addition & 1 deletion webui/artist.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ <h2>歌曲</h2>
throw new Error("缺少艺术家UUID参数");
}

let currentIndex = 0;
window.currentIndex = 0;
let songs = [];
let currentSong = null;

Expand Down
7 changes: 7 additions & 0 deletions webui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,13 @@ <h3>歌词</h3>
const hiddenIframe = document.getElementById("hidden-frame");
const visibleIframe = document.getElementById("content-frame");

console.log(visibleIframe.contentWindow.currentIndex);

hiddenIframe.onload = function () {
hiddenIframe.contentWindow.currentIndex = visibleIframe.contentWindow.currentIndex;

// 发送播放请求到隐藏 iframe
};
// 同步隐藏 iframe 的 URL
hiddenIframe.src = visibleIframe.src;

Expand Down
2 changes: 1 addition & 1 deletion webui/liked.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ <h2>喜欢的专辑</h2>
let apiBaseUrl = "http://127.0.0.1:5010";
const urlParams = new URLSearchParams(window.location.search);
apiBaseUrl = urlParams.get("apibaseUrl");
let currentIndex = 0;
window.currentIndex = 0;
let likedSongs = [];
let currentSong = null;

Expand Down

0 comments on commit 136379d

Please sign in to comment.