Compare commits
3 Commits
f8344ba1d3
...
6055783404
Author | SHA1 | Date | |
---|---|---|---|
6055783404 | |||
f5a838442c | |||
a7385028c0 |
@ -1,13 +1,13 @@
|
||||
<script>
|
||||
import {createEventDispatcher} from 'svelte'
|
||||
import stringify from 'json-stable-stringify';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import createScoresStore from '../../stores/http/http-scores-store.js';
|
||||
import {opt} from '../../utils/js'
|
||||
import {scrollToTargetAdjusted} from '../../utils/browser'
|
||||
import SongScore from './SongScore.svelte'
|
||||
import Error from '../Common/Error.svelte'
|
||||
import ScoreServiceSwitcher from './ScoreServiceSwitcher.svelte'
|
||||
import ScoresPager from './ScoresPager.svelte'
|
||||
import stringify from 'json-stable-stringify'
|
||||
import { scrollToTargetAdjusted } from '../../utils/browser';
|
||||
import { opt } from '../../utils/js';
|
||||
import Error from '../Common/Error.svelte';
|
||||
import ScoreServiceSwitcher from './ScoreServiceSwitcher.svelte';
|
||||
import ScoresPager from './ScoresPager.svelte';
|
||||
import SongScore from './SongScore.svelte';
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<script>
|
||||
import {SS_HOST} from '../../network/queues/scoresaber/page-queue'
|
||||
import {navigate} from 'svelte-routing'
|
||||
import Difficulty from '../Song/Difficulty.svelte'
|
||||
import { navigate } from 'svelte-routing';
|
||||
import { SS_CDN_HOST } from '../../network/queues/scoresaber/page-queue';
|
||||
import Difficulty from '../Song/Difficulty.svelte';
|
||||
|
||||
export let leaderboard = null;
|
||||
export let url = null;
|
||||
@ -31,10 +31,12 @@
|
||||
}
|
||||
|
||||
$: hash = leaderboard?.song?.hash ?? null;
|
||||
$: ssCoverUrl = hash ? `${SS_HOST}/imports/images/songs/${encodeURIComponent(hash)}.png` : null;
|
||||
$: ssCoverUrl = hash ? `${SS_CDN_HOST}/covers/${encodeURIComponent(hash.toUpperCase())}.png` : null;
|
||||
$: beatSaverCoverUrl = leaderboard?.beatMaps?.versions?.[0]?.coverURL ?? null;
|
||||
|
||||
$: preloadImages([{url: ssCoverUrl, priority: 10}, {url: beatSaverCoverUrl, priority: 5}]);
|
||||
console.log(leaderboard)
|
||||
|
||||
$: preloadImages([{url: ssCoverUrl, priority: 10}, {url: beatSaverCoverUrl, priority: 15}]);
|
||||
|
||||
$: coverUrl = loadedImages.length ? (loadedImages.sort((a, b) => a?.priority - b?.priority))[0].url : DEFAULT_IMG;
|
||||
</script>
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { SS_CDN_HOST } from "../../../network/queues/scoresaber/page-queue";
|
||||
import tweened from "../../../svelte-utils/tweened";
|
||||
import { opt } from "../../../utils/js";
|
||||
|
||||
@ -170,7 +171,7 @@ function updateSsBadges(playerData) {
|
||||
if (!opt(playerData, "playerInfo.badges.length")) return null;
|
||||
|
||||
return playerData.playerInfo.badges.map((b) => ({
|
||||
src: `https://cdn.scoresaber.com/badges/${b.image}`,
|
||||
src: `${SS_CDN_HOST}/badges/${b.image}`,
|
||||
title: b.description,
|
||||
}));
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { default as createQueue, PRIORITY } from "../http-queue";
|
||||
import ssrConfig from "../../../ssr-config";
|
||||
import { substituteVars } from "../../../utils/format";
|
||||
import { default as createQueue, PRIORITY } from "../http-queue";
|
||||
|
||||
const ACCSABER_API_URL = "https://api.accsaber.com";
|
||||
const ACCSABER_API_URL = ssrConfig.proxy + "/https://api.accsaber.com";
|
||||
const CATEGORIES_URL = ACCSABER_API_URL + "/categories";
|
||||
const RANKING_URL = ACCSABER_API_URL + "/categories/${category}/standings";
|
||||
const PLAYER_SCORES_URL = ACCSABER_API_URL + "/players/${playerId}/scores";
|
||||
|
@ -2,7 +2,8 @@ import ssrConfig from "../../../ssr-config";
|
||||
import { substituteVars } from "../../../utils/format";
|
||||
import { default as createQueue, PRIORITY } from "../http-queue";
|
||||
|
||||
const BEATSAVIOR_API_URL = "https://www.beatsavior.io/api/livescores/player/";
|
||||
const BEATSAVIOR_API_URL =
|
||||
"https://beat-savior.herokuapp.com/api/livescores/player/";
|
||||
const PLAYER_URL = ssrConfig.proxy + "/" + BEATSAVIOR_API_URL + "/${playerId}";
|
||||
|
||||
export default (options = {}) => {
|
||||
|
@ -8,6 +8,7 @@ import { extractDiffAndType } from "../../../utils/scoresaber/format";
|
||||
import { PRIORITY, default as createQueue } from "../http-queue";
|
||||
|
||||
export const SS_HOST = "https://scoresaber.com";
|
||||
export const SS_CDN_HOST = "https://cdn.scoresaber.com";
|
||||
const SS_CORS_HOST = `${ssrConfig.proxy}/${SS_HOST}`;
|
||||
const RANKEDS_URL =
|
||||
SS_CORS_HOST +
|
||||
|
Reference in New Issue
Block a user