Commit 9f0ffc18 authored by Chunchi Che's avatar Chunchi Che

suport super pre release

parent a2e52969
Pipeline #25497 passed with stages
in 12 minutes and 41 seconds
{
"version":4960,
"servers":[
{
"name":"koishi",
"ip":"koishi.momobako.com",
"port":"7211"
},
{
"name":"mycard-athletic",
"ip":"tiramisu.moecube.com",
"port":"8912"
},
{
"name":"pre-release",
"ip":"koishi.momobako.com",
"port":"889"
}
],
"assetsPath":"/neos-assets",
"cardImgUrl":"https://cdn02.moecube.com:444/images/ygopro-images-zh-CN",
"releaseDbUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb",
"preReleaseDbUrl":"https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release.cdb",
"stringsUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"lflistUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf",
"replayUrl":"replay.neos.moe",
"loginUrl":"https://accounts.moecube.com/signin",
"logoutUrl":"https://accounts.moecube.com/signout",
"profileUrl":"https://accounts.moecube.com/profiles",
"athleticWatchUrl":"wss://tiramisu.moecube.com:8923",
"entertainWatchUrl":"wss://tiramisu.moecube.com:7923",
"userApi":"https://sapi.moecube.com:444/accounts/users/{username}.json",
"streamInterval":20,
"startDelay":1000,
"ui":{
"hint":{
"maxCount":1
}
},
"unimplementedWhiteList":[
1,
6,
7,
34,
54,
55,
56,
60,
61,
62,
63,
64,
65,
70,
71,
72,
73,
74,
75,
76,
80,
81,
83,
93,
95,
96,
97,
101,
102,
110,
111,
112,
113,
114,
120,
121,
122,
123,
130,
131,
132,
133,
160,
161,
163,
164,
165,
170,
180,
230,
231,
236
]
"version": 4960,
"servers": [{
"name": "koishi",
"ip": "koishi.momobako.com",
"port": "7211"
},
{
"name": "mycard-athletic",
"ip": "tiramisu.moecube.com",
"port": "8912"
},
{
"name": "pre-release",
"ip": "koishi.momobako.com",
"port": "889"
}
],
"assetsPath": "/neos-assets",
"releaseImgUrl": "https://cdn02.moecube.com:444/images/ygopro-images-zh-CN",
"preReleaseImgUrl": "https://cdn02.moecube.com:444/ygopro-super-pre/data/pics",
"releaseDbUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb",
"preReleaseDbUrl": "https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release.cdb",
"stringsUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"lflistUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf",
"replayUrl": "replay.neos.moe",
"loginUrl": "https://accounts.moecube.com/signin",
"logoutUrl": "https://accounts.moecube.com/signout",
"profileUrl": "https://accounts.moecube.com/profiles",
"athleticWatchUrl": "wss://tiramisu.moecube.com:8923",
"entertainWatchUrl": "wss://tiramisu.moecube.com:7923",
"userApi": "https://sapi.moecube.com:444/accounts/users/{username}.json",
"streamInterval": 20,
"startDelay": 1000,
"ui": {
"hint": {
"maxCount": 1
}
},
"unimplementedWhiteList": [
1,
6,
7,
34,
54,
55,
56,
60,
61,
62,
63,
64,
65,
70,
71,
72,
73,
74,
75,
76,
80,
81,
83,
93,
95,
96,
97,
101,
102,
110,
111,
112,
113,
114,
120,
121,
122,
123,
130,
131,
132,
133,
160,
161,
163,
164,
165,
170,
180,
230,
231,
236
]
}
{
"version":4960,
"servers":[
{
"name":"koishi",
"ip":"koishi.momobako.com",
"port":"7211"
},
{
"name":"mycard-athletic",
"ip":"tiramisu.moecube.com",
"port":"8912"
},
{
"name":"pre-release",
"ip":"koishi.momobako.com",
"port":"889"
}
],
"assetsPath":"/neos-assets",
"cardImgUrl":"https://cdn02.moecube.com:444/images/ygopro-images-zh-CN",
"releaseDbUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb",
"preReleaseDbUrl":"https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release.cdb",
"stringsUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"lflistUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf",
"replayUrl":"replay.neos.moe",
"loginUrl":"https://accounts.moecube.com/signin",
"logoutUrl":"https://accounts.moecube.com/signout",
"profileUrl":"https://accounts.moecube.com/profiles",
"athleticWatchUrl":"wss://tiramisu.moecube.com:8923",
"entertainWatchUrl":"wss://tiramisu.moecube.com:7923",
"userApi":"https://sapi.moecube.com:444/accounts/users/{username}.json",
"streamInterval":20,
"startDelay":1000,
"ui":{
"hint":{
"maxCount":1
}
},
"unimplementedWhiteList":[
1,
6,
7,
34,
54,
55,
56,
60,
61,
62,
63,
64,
65,
70,
71,
72,
73,
74,
75,
76,
80,
81,
83,
93,
95,
96,
97,
101,
102,
110,
111,
112,
113,
114,
120,
121,
122,
123,
130,
131,
132,
133,
160,
161,
163,
164,
165,
170,
180,
230,
231,
236
]
"version": 4960,
"servers": [{
"name": "koishi",
"ip": "koishi.momobako.com",
"port": "7211"
},
{
"name": "mycard-athletic",
"ip": "tiramisu.moecube.com",
"port": "8912"
},
{
"name": "pre-release",
"ip": "koishi.momobako.com",
"port": "889"
}
],
"assetsPath": "/neos-assets",
"releaseImgUrl": "https://cdn02.moecube.com:444/images/ygopro-images-zh-CN",
"preReleaseImgUrl": "https://cdn02.moecube.com:444/ygopro-super-pre/data/pics",
"releaseDbUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb",
"preReleaseDbUrl": "https://cdn02.moecube.com:444/ygopro-super-pre/data/test-release.cdb",
"stringsUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"lflistUrl": "https://cdn02.moecube.com:444/ygopro-database/zh-CN/lflist.conf",
"replayUrl": "replay.neos.moe",
"loginUrl": "https://accounts.moecube.com/signin",
"logoutUrl": "https://accounts.moecube.com/signout",
"profileUrl": "https://accounts.moecube.com/profiles",
"athleticWatchUrl": "wss://tiramisu.moecube.com:8923",
"entertainWatchUrl": "wss://tiramisu.moecube.com:7923",
"userApi": "https://sapi.moecube.com:444/accounts/users/{username}.json",
"streamInterval": 20,
"startDelay": 1000,
"ui": {
"hint": {
"maxCount": 1
}
},
"unimplementedWhiteList": [
1,
6,
7,
34,
54,
55,
56,
60,
61,
62,
63,
64,
65,
70,
71,
72,
73,
74,
75,
76,
80,
81,
83,
93,
95,
96,
97,
101,
102,
110,
111,
112,
113,
114,
120,
121,
122,
123,
130,
131,
132,
133,
160,
161,
163,
164,
165,
170,
180,
230,
231,
236
]
}
......@@ -10,8 +10,8 @@ import initSqlJs, { Database } from "sql.js";
import { CardData, CardMeta, CardText } from "@/api/cards";
import { useConfig } from "@/config";
import { pfetch } from "@/infra";
import { isSuperReleaseCard } from "@/superPreRelease";
import SuperReleaseData from "../../../super-pre-release.json";
import { FtsParams, invokeFts } from "./fts";
const NeosConfig = useConfig();
......@@ -101,10 +101,9 @@ function helper<T extends sqliteCmd>(action: sqliteAction<T>) {
) {
const code = action.payload.id;
const db =
SuperReleaseData.find((id) => id === code) !== undefined
? YGODBS.preRelease
: YGODBS.release;
const db = isSuperReleaseCard(code)
? YGODBS.preRelease
: YGODBS.release;
const dataStmt = db.prepare("SELECT * FROM datas WHERE ID = $id");
const dataResult = dataStmt.getAsObject({ $id: code });
......
import SuperReleaseData from "../../super-pre-release.json";
export function isSuperReleaseCard(code: number): boolean {
return SuperReleaseData.find((id) => id === code) !== undefined;
}
......@@ -22,12 +22,10 @@ import { proxy, useSnapshot } from "valtio";
import { sendSortCardResponse } from "@/api";
import { CardMeta } from "@/api/cards";
import { useConfig } from "@/config";
import { getCardImgUrl } from "@/ui/Shared";
import { NeosModal } from "./NeosModal";
const NeosConfig = useConfig();
interface SortOption {
meta: CardMeta;
response: number;
......@@ -118,7 +116,7 @@ const SortableItem = (props: { id: number; meta: CardMeta }) => {
cover={
<img
alt={props.meta.id.toString()}
src={`${NeosConfig.cardImgUrl}/${props.meta.id}.jpg`}
src={getCardImgUrl(props.meta.id)}
/>
}
/>
......
......@@ -2,6 +2,7 @@ import classNames from "classnames";
import { CSSProperties, useMemo } from "react";
import { useConfig } from "@/config";
import { isSuperReleaseCard } from "@/superPreRelease";
import styles from "./index.module.scss";
......@@ -60,5 +61,10 @@ export function getCardImgUrl(code: number, back = false) {
if (back || code === 0) {
return `${ASSETS_BASE}/card_back.jpg`;
}
return `${NeosConfig.cardImgUrl}/${code}.jpg`;
if (isSuperReleaseCard(code)) {
return `${NeosConfig.preReleaseImgUrl}/${code}.jpg`;
} else {
return `${NeosConfig.releaseImgUrl}/${code}.jpg`;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment