This is a (hopefully temporary) workaround to display existing data from the buggy/crashing SMP/Biography panel.
It will display the review and biography data previously saved (in default location) by @Wilb Biography panel.
It only displays what already exists and DOES NOT retrieve any new data.
**Make sure to update your own local file path-->
** return `file:///S:/Jukebox Hero/foobar2000/profile/yttm/review/${baseDir}/${artistInitial}/${artist} - ${album}.txt`;
**adjust heights in CSS .fileContent
Reviews:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: 'Oswald', sans-serif; color: #d5d2d2;
margin: 5px;
}
.fileContent {
border: 1px solid #d1d1d1;
padding: 1px;
background-color: #d1d1d1;
width: 90%;
height: 125px;
}
</style>
<link href="https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap" rel="stylesheet">
</head>
<body>
<span style="position:absolute; font-size: 6em; margin-top: -65px; margin-left: -15px; font-family: 'Oswald', sans-serif; color: rgb(12,180,171); font-weight:700; z-index:-1;">Reviews</span>
<div style="display: flex; justify-content: space-between; position:relative;"><span style="font-size: .9em; margin: 5px; text-align: left; font-family: 'Oswald', sans-serif; color: #d5d2d2; ">AllMusic <iframe id="file1Frame" class="fileContent"></iframe></span><span style="font-size: .9em; margin: 5px; text-align: left; font-family: 'Oswald', sans-serif; color: #d5d2d2; ">LastFM<iframe id="file2Frame" class="fileContent"></iframe></span><span style="font-size: .9em; margin: 5px; text-align: left; font-family: 'Oswald', sans-serif; color: #d5d2d2; ">Wikipedia<iframe id="file3Frame" class="fileContent"></iframe></span></div>
<script>
async function getFormattedText(format) {
return chrome.webview.hostObjects.sync.foo_uie_webview.GetFormattedText(format);
}
function constructFilePath(baseDir, artist, album) {
const artistInitial = artist.charAt(0).toUpperCase();
return `file:///S:/Jukebox Hero/foobar2000/profile/yttm/review/${baseDir}/${artistInitial}/${artist} - ${album}.txt`;
}
async function loadFileContent() {
try {
const artist = await getFormattedText("[%artist%]");
const album = await getFormattedText("[%album%]");
// Construct file paths
const file1Path = constructFilePath('allmusic', artist, album);
const file2Path = constructFilePath('lastfm', artist, album);
const file3Path = constructFilePath('wikipedia', artist, album);
// Display file contents in iframes
document.getElementById('file1Frame').src = file1Path;
document.getElementById('file2Frame').src = file2Path;
document.getElementById('file3Frame').src = file3Path;
} catch (error) {
console.error('Error retrieving formatted text:', error);
document.getElementById('file1Frame').contentDocument.body.textContent = 'Failed to load file content.';
document.getElementById('file2Frame').contentDocument.body.textContent = 'Failed to load file content.';
document.getElementById('file3Frame').contentDocument.body.textContent = 'Failed to load file content.';
}
}
// Called when playback is being initialized.
function OnPlaybackStarting(command, paused)
{
document.getElementById("Starting").textContent = command + " (" + (paused ? "Paused" : "Playing") + ")";
}
// Called when playback advances to a new track.
function OnPlaybackNewTrack()
{
Refresh()
}
// Called when playback stops.
function OnPlaybackStop(reason)
{
document.getElementById("StopReason").textContent = reason; // "User" / "EOF" / "Starting another" / "Shutting down"
}
// Called when the user seeks to a specific time.
function OnPlaybackSeek(time)
{
document.getElementById("Time").textContent = time; // in seconds
}
// Called when playback pauses or resumes.
function OnPlaybackPause(paused)
{
document.getElementById("Paused").textContent = paused; // true / false
}
// Called when the currently played file gets edited.
function OnPlaybackEdited()
{
Refresh();
}
// Called when dynamic info (VBR bitrate etc...) changes.
function OnPlaybackDynamicInfo()
{
Refresh();
}
// Called when the per-track dynamic info (stream track titles etc...) change. Happens less often than OnPlaybackDynamicInfo().
function OnPlaybackDynamicTrackInfo()
{
Refresh();
}
// Called, every second, for time display.
function OnPlaybackTime(time)
{
document.getElementById("Time").textContent = time; // in seconds
document.getElementById("TrackTime").textContent = chrome.webview.hostObjects.sync.foo_uie_webview.GetFormattedText("[%playback_time%[/%length%]]");
}
// Called when the user changes the volume.
function OnVolumeChange(newValue)
{
document.getElementById("Volume").textContent = newValue; // in dBFS
}
// Called when the focused playlist item changes.
function OnPlaylistFocusedItemChanged()
{
Refresh();
}
// Refreshes the content of all elements.
function Refresh()
{
// Load the file contents when the page loads
loadFileContent();
}
</script>
</body>
</html>
Biographies:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: 'Oswald', sans-serif; color: #d5d2d2;
margin: 5px;
background-color: #333;
}
.fileContent {
border: 1px solid #d1d1d1;
padding: 1px;
background-color: #d1d1d1;
width: 90%;
height: 250px;
}
</style>
<link href="https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap" rel="stylesheet">
</head>
<body>
<span style="position:absolute; font-size: 6em; margin-top: -65px; margin-left: -15px; font-family: 'Oswald', sans-serif; color: rgb(12,180,171); font-weight:700; z-index:-1;">Biographies</span>
<div style="display: flex; justify-content: space-between; position:relative;"><span style="font-size: .9em; margin: 5px; text-align: left; font-family: 'Oswald', sans-serif; color: #d5d2d2; ">AllMusic <iframe id="file1Frame" class="fileContent"></iframe></span><span style="font-size: .9em; margin: 5px; text-align: left; font-family: 'Oswald', sans-serif; color: #d5d2d2; ">LastFM<iframe id="file2Frame" class="fileContent"></iframe></span><span style="font-size: .9em; margin: 5px; text-align: left; font-family: 'Oswald', sans-serif; color: #d5d2d2; ">Wikipedia<iframe id="file3Frame" class="fileContent"></iframe></span></div>
<script>
async function getFormattedText(format) {
return chrome.webview.hostObjects.sync.foo_uie_webview.GetFormattedText(format);
}
function constructFilePath(baseDir, artist, album) {
const artistInitial = artist.charAt(0).toUpperCase();
return `file:///S:/Jukebox Hero/foobar2000/profile/yttm/biography/${baseDir}/${artistInitial}/${artist}.txt`;
}
async function loadFileContent() {
try {
const artist = await getFormattedText("[%artist%]");
const album = await getFormattedText("[%album%]");
// Construct file paths
const file1Path = constructFilePath('allmusic', artist);
const file2Path = constructFilePath('lastfm', artist);
const file3Path = constructFilePath('wikipedia', artist);
// Display file contents in iframes
document.getElementById('file1Frame').src = file1Path;
document.getElementById('file2Frame').src = file2Path;
document.getElementById('file3Frame').src = file3Path;
} catch (error) {
console.error('Error retrieving formatted text:', error);
document.getElementById('file1Frame').contentDocument.body.textContent = 'Failed to load file content.';
document.getElementById('file2Frame').contentDocument.body.textContent = 'Failed to load file content.';
document.getElementById('file3Frame').contentDocument.body.textContent = 'Failed to load file content.';
}
}
// Called when playback is being initialized.
function OnPlaybackStarting(command, paused)
{
document.getElementById("Starting").textContent = command + " (" + (paused ? "Paused" : "Playing") + ")";
}
// Called when playback advances to a new track.
function OnPlaybackNewTrack()
{
Refresh()
}
// Called when playback stops.
function OnPlaybackStop(reason)
{
document.getElementById("StopReason").textContent = reason; // "User" / "EOF" / "Starting another" / "Shutting down"
}
// Called when the user seeks to a specific time.
function OnPlaybackSeek(time)
{
document.getElementById("Time").textContent = time; // in seconds
}
// Called when playback pauses or resumes.
function OnPlaybackPause(paused)
{
document.getElementById("Paused").textContent = paused; // true / false
}
// Called when the currently played file gets edited.
function OnPlaybackEdited()
{
Refresh();
}
// Called when dynamic info (VBR bitrate etc...) changes.
function OnPlaybackDynamicInfo()
{
Refresh();
}
// Called when the per-track dynamic info (stream track titles etc...) change. Happens less often than OnPlaybackDynamicInfo().
function OnPlaybackDynamicTrackInfo()
{
Refresh();
}
// Called, every second, for time display.
function OnPlaybackTime(time)
{
document.getElementById("Time").textContent = time; // in seconds
document.getElementById("TrackTime").textContent = chrome.webview.hostObjects.sync.foo_uie_webview.GetFormattedText("[%playback_time%[/%length%]]");
}
// Called when the user changes the volume.
function OnVolumeChange(newValue)
{
document.getElementById("Volume").textContent = newValue; // in dBFS
}
// Called when the focused playlist item changes.
function OnPlaylistFocusedItemChanged()
{
Refresh();
}
// Refreshes the content of all elements.
function Refresh()
{
// Load the file contents when the page loads
loadFileContent();
}
</script>
</body>
</html>