From 48937ed57378d022cc9e1a67ca2a244c661c7224 Mon Sep 17 00:00:00 2001 From: SamidyFR <168582143+SamidyFR@users.noreply.github.com> Date: Thu, 19 Feb 2026 13:55:31 +0000 Subject: [PATCH] style: auto-fix linting issues --- index.html | 371 ++++++++++++++++++++++++++++++++-------- js/profile.js | 283 ++++++++++++++++-------------- js/settings.js | 2 +- self-hosted-database.md | 38 ++-- styles.css | 10 +- 5 files changed, 485 insertions(+), 219 deletions(-) diff --git a/index.html b/index.html index 266fdfb..0720add 100644 --- a/index.html +++ b/index.html @@ -738,95 +738,272 @@
Integrating Last.fm enables recent activity and top stats on your profile. Authorize it in Settings > Scrobbling. Note: Last.fm authorization is stored locally and must be repeated on each device.
++ Integrating Last.fm enables recent activity and top stats on your profile. Authorize it in + Settings > Scrobbling. Note: Last.fm authorization is stored locally and + must be repeated on each device. +
diff --git a/js/profile.js b/js/profile.js
index 3a64b96..3d5153b 100644
--- a/js/profile.js
+++ b/js/profile.js
@@ -5,7 +5,6 @@ import { MusicAPI } from './music-api.js';
import { apiSettings } from './storage.js';
import { debounce, escapeHtml } from './utils.js';
-
// objects execution february 29th 2027
const profilePage = document.getElementById('page-profile');
@@ -101,7 +100,9 @@ function setupImageUploadControl(idPrefix) {
urlInput.value = url;
statusEl.textContent = 'Done!';
statusEl.style.color = '#10b981';
- setTimeout(() => { statusEl.style.display = 'none'; }, 2000);
+ setTimeout(() => {
+ statusEl.style.display = 'none';
+ }, 2000);
} catch (error) {
statusEl.textContent = 'Failed - try URL';
statusEl.style.color = '#ef4444';
@@ -123,9 +124,9 @@ const resetAvatarControl = setupImageUploadControl('edit-profile-avatar');
const resetBannerControl = setupImageUploadControl('edit-profile-banner');
export async function loadProfile(username) {
- document.querySelectorAll('.page').forEach(p => p.classList.remove('active'));
+ document.querySelectorAll('.page').forEach((p) => p.classList.remove('active'));
profilePage.classList.add('active');
-
+
document.getElementById('profile-banner').style.backgroundImage = '';
document.getElementById('profile-avatar').src = '/assets/appicon.png';
document.getElementById('profile-display-name').textContent = 'Loading...';
@@ -135,7 +136,7 @@ export async function loadProfile(username) {
document.getElementById('profile-website').style.display = 'none';
document.getElementById('profile-lastfm').style.display = 'none';
document.getElementById('profile-playlists-container').innerHTML = '';
-
+
const favAlbumsSection = document.getElementById('profile-favorite-albums-section');
const favAlbumsContainer = document.getElementById('profile-favorite-albums-container');
if (favAlbumsSection) favAlbumsSection.style.display = 'none';
@@ -145,7 +146,7 @@ export async function loadProfile(username) {
const recentContainer = document.getElementById('profile-recent-scrobbles-container');
if (recentSection) recentSection.style.display = 'none';
if (recentContainer) recentContainer.innerHTML = '';
-
+
const topArtistsSection = document.getElementById('profile-top-artists-section');
const topArtistsContainer = document.getElementById('profile-top-artists-container');
const topAlbumsSection = document.getElementById('profile-top-albums-section');
@@ -174,7 +175,7 @@ export async function loadProfile(username) {
document.getElementById('profile-display-name').textContent = profile.display_name || username;
if (profile.banner) document.getElementById('profile-banner').style.backgroundImage = `url('${profile.banner}')`;
if (profile.avatar_url) document.getElementById('profile-avatar').src = profile.avatar_url;
-
+
if (profile.status) {
const statusEl = document.getElementById('profile-status');
try {
@@ -184,7 +185,10 @@ export async function loadProfile(username) {
${statusObj.text}
`;
- statusEl.querySelector('.status-link').onclick = (e) => { e.preventDefault(); navigate(statusObj.link); };
+ statusEl.querySelector('.status-link').onclick = (e) => {
+ e.preventDefault();
+ navigate(statusObj.link);
+ };
} catch {
statusEl.textContent = `Listening to: ${profile.status}`;
}
@@ -204,9 +208,10 @@ export async function loadProfile(username) {
if (profile.favorite_albums && profile.favorite_albums.length > 0) {
if (favAlbumsSection && favAlbumsContainer) {
favAlbumsSection.style.display = 'block';
- favAlbumsContainer.innerHTML = profile.favorite_albums.map(album => {
- const image = api.getCoverUrl(album.cover);
- return `
+ favAlbumsContainer.innerHTML = profile.favorite_albums
+ .map((album) => {
+ const image = api.getCoverUrl(album.cover);
+ return `
No public playlists.
'; + container.innerHTML = + 'No public playlists.
'; } } } export function openEditProfile() { - syncManager.getUserData().then(data => { + syncManager.getUserData().then((data) => { if (!data || !data.profile) return; const p = data.profile; - + editUsername.value = p.username || ''; editDisplayName.value = p.display_name || ''; resetAvatarControl(p.avatar_url); resetBannerControl(p.banner); - + editStatusJson.value = p.status || ''; editStatusSearch.value = ''; if (p.status) { @@ -476,7 +511,7 @@ export function openEditProfile() { editAbout.value = p.about || ''; editWebsite.value = p.website || ''; editLastfm.value = p.lastfm_username || ''; - + privacyPlaylists.checked = p.privacy?.playlists !== 'private'; privacyLastfm.checked = p.privacy?.lastfm !== 'private'; @@ -487,7 +522,7 @@ export function openEditProfile() { async function saveProfile() { const newUsername = editUsername.value.trim(); if (!newUsername) { - usernameError.textContent = "Username cannot be empty"; + usernameError.textContent = 'Username cannot be empty'; usernameError.style.display = 'block'; return; } @@ -496,7 +531,7 @@ async function saveProfile() { if (currentUser.profile.username !== newUsername) { const taken = await syncManager.isUsernameTaken(newUsername); if (taken) { - usernameError.textContent = "Username is already taken"; + usernameError.textContent = 'Username is already taken'; usernameError.style.display = 'block'; return; } @@ -518,8 +553,8 @@ async function saveProfile() { lastfm_username: editLastfm.value.trim(), privacy: { playlists: privacyPlaylists.checked ? 'public' : 'private', - lastfm: privacyLastfm.checked ? 'public' : 'private' - } + lastfm: privacyLastfm.checked ? 'public' : 'private', + }, }; try { @@ -552,7 +587,7 @@ viewMyProfileBtn.addEventListener('click', async () => { } }); -authManager.onAuthStateChanged(user => { +authManager.onAuthStateChanged((user) => { viewMyProfileBtn.style.display = user ? 'inline-block' : 'none'; }); @@ -585,18 +620,19 @@ const performStatusSearch = debounce(async (query) => { try { const [tracks, albums] = await Promise.all([ api.searchTracks(query, { limit: 3 }), - api.searchAlbums(query, { limit: 3 }) + api.searchAlbums(query, { limit: 3 }), ]); statusSearchResults.innerHTML = ''; - + const createItem = (item, type) => { const div = document.createElement('div'); div.className = 'search-result-item'; const title = item.title; - const subtitle = type === 'track' ? (item.artist?.name || 'Unknown Artist') : (item.artist?.name || 'Unknown Artist'); + const subtitle = + type === 'track' ? item.artist?.name || 'Unknown Artist' : item.artist?.name || 'Unknown Artist'; const image = api.getCoverUrl(item.album?.cover || item.cover); - + div.innerHTML = `