Merge branch 'main' of github.com:monochrome-music/monochrome
This commit is contained in:
commit
6dbd07ed88
5 changed files with 1068 additions and 8884 deletions
43
.github/workflows/update-lockfile.yml
vendored
Normal file
43
.github/workflows/update-lockfile.yml
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
name: Update Lock File
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
update-lock:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Configure Git
|
||||
uses: DanTheMan827/config-git-user-action@v1
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: latest
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
./bun_modules
|
||||
./node_modules
|
||||
./bun.lock
|
||||
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git add -A . || true
|
||||
git commit "update lockfile" || true
|
||||
git push || true
|
||||
|
|
@ -33,7 +33,6 @@
|
|||
rel="stylesheet"
|
||||
/>
|
||||
<link rel="stylesheet" href="/styles.css" />
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
|||
16
js/app.js
16
js/app.js
|
|
@ -80,12 +80,16 @@ if (typeof window !== 'undefined') {
|
|||
plausibleScript.src = 'https://plausible.canine.tools/js/pa-dCMvQpiD1-AJmi8o3xviO.js';
|
||||
document.head.appendChild(plausibleScript);
|
||||
|
||||
window.plausible = window.plausible || function () {
|
||||
(window.plausible.q = window.plausible.q || []).push(arguments);
|
||||
};
|
||||
window.plausible.init = window.plausible.init || function (i) {
|
||||
window.plausible.o = i || {};
|
||||
};
|
||||
window.plausible =
|
||||
window.plausible ||
|
||||
function () {
|
||||
(window.plausible.q = window.plausible.q || []).push(arguments);
|
||||
};
|
||||
window.plausible.init =
|
||||
window.plausible.init ||
|
||||
function (i) {
|
||||
window.plausible.o = i || {};
|
||||
};
|
||||
window.plausible.init();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ async function loadArtistsPopularity() {
|
|||
|
||||
async function loadArtistsData() {
|
||||
try {
|
||||
const response = await fetch('https://sheets.artistgrid.cx/artists.ndjson');
|
||||
const response = await fetch('https://assets.artistgrid.cx/artists.ndjson');
|
||||
if (!response.ok) throw new Error('Network response was not ok');
|
||||
const text = await response.text();
|
||||
artistsData = text
|
||||
|
|
@ -89,15 +89,49 @@ function getSheetId(url) {
|
|||
return match ? match[1] : null;
|
||||
}
|
||||
|
||||
async function fetchTrackerData(sheetId) {
|
||||
try {
|
||||
const response = await fetch(`https://tracker.israeli.ovh/get/${sheetId}`);
|
||||
if (!response.ok) return null;
|
||||
return await response.json();
|
||||
} catch (e) {
|
||||
console.error('Failed to fetch tracker data', e);
|
||||
return null;
|
||||
function transformImageUrl(url) {
|
||||
if (!url) return url;
|
||||
return url.replace('https://s3.sad.ovh/trackerapi/', 'https://r2.artistgrid.cx/');
|
||||
}
|
||||
|
||||
function transformErasImages(eras) {
|
||||
if (!eras) return eras;
|
||||
for (const eraName in eras) {
|
||||
const era = eras[eraName];
|
||||
if (era.image) {
|
||||
era.image = transformImageUrl(era.image);
|
||||
}
|
||||
}
|
||||
return eras;
|
||||
}
|
||||
|
||||
async function fetchTrackerData(sheetId) {
|
||||
const endpoints = [
|
||||
'https://tracker.israeli.ovh/get/',
|
||||
'https://tracker.thug.surf/get/',
|
||||
'https://trackerapi-2.artistgrid.cx/get/',
|
||||
];
|
||||
|
||||
let lastError = null;
|
||||
for (const baseUrl of endpoints) {
|
||||
try {
|
||||
const response = await fetch(`${baseUrl}${sheetId}`);
|
||||
if (!response.ok) {
|
||||
lastError = new Error(`HTTP ${response.status}`);
|
||||
continue;
|
||||
}
|
||||
const data = await response.json();
|
||||
if (data.eras) {
|
||||
transformErasImages(data.eras);
|
||||
}
|
||||
return data;
|
||||
} catch (e) {
|
||||
lastError = e;
|
||||
console.warn(`Failed to fetch from ${baseUrl}, trying next...`);
|
||||
}
|
||||
}
|
||||
console.error('Failed to fetch tracker data from all endpoints', lastError);
|
||||
return null;
|
||||
}
|
||||
|
||||
function parseDuration(durationStr) {
|
||||
|
|
|
|||
9840
package-lock.json
generated
9840
package-lock.json
generated
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue