feat: add translated names for Devil Fruits and update related schemas
Build Docker Image / build (push) Successful in 1m33s
Build Docker Image / build (push) Successful in 1m33s
- Added support for translated names and French translated names in the DevilFruitRecord and Character interfaces. - Updated JSON import/export scripts to handle new translated name fields. - Enhanced scraping logic to extract translated names from the source. - Modified database schema to include translated names for Devil Fruits. - Updated daily fruit selection to include translated names for characters.
This commit is contained in:
@@ -18,6 +18,8 @@ type ArcRecord = {
|
||||
type DevilFruitRecord = {
|
||||
id: string;
|
||||
name: string;
|
||||
translatedName?: string | null;
|
||||
frTranslatedName?: string | null;
|
||||
type?: DevilFruitType | string | null;
|
||||
url?: string | null;
|
||||
};
|
||||
@@ -94,7 +96,7 @@ function toJsonArray(value: string[] | string | null | undefined): string[] | nu
|
||||
|
||||
function toDevilFruitType(value: DevilFruitType | string | null | undefined): DevilFruitType | null {
|
||||
if (!value) return null;
|
||||
if (value === 'Paramecia' || value === 'Zoan' || value === 'Logia' || value === 'Smile' || value === 'Unknown') {
|
||||
if (value === 'Paramecia' || value === 'Zoan' || value === 'Logia' || value === 'Unknown') {
|
||||
return value;
|
||||
}
|
||||
return 'Unknown';
|
||||
@@ -229,6 +231,8 @@ async function importFromJson(): Promise<void> {
|
||||
.values({
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
translatedName: toNullable(item.translatedName),
|
||||
frTranslatedName: toNullable(item.frTranslatedName),
|
||||
type: toDevilFruitType(item.type),
|
||||
url: toNullable(item.url)
|
||||
})
|
||||
@@ -236,6 +240,8 @@ async function importFromJson(): Promise<void> {
|
||||
target: devilFruit.id,
|
||||
set: {
|
||||
name: item.name,
|
||||
translatedName: toNullable(item.translatedName),
|
||||
frTranslatedName: toNullable(item.frTranslatedName),
|
||||
type: toDevilFruitType(item.type),
|
||||
url: toNullable(item.url)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user