1 Commits

Author SHA1 Message Date
d708151c03 Translated using Weblate (French)
Currently translated at 100.0% (499 of 499 strings)

Translated using Weblate (French)

Currently translated at 96.9% (484 of 499 strings)

Co-authored-by: Ribemont Francois <ribemont.francois+weblate@gmail.com>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: http://translate.droposs.org/projects/drop/drop/fr/
Translation: Drop/Drop
2025-10-20 22:53:32 +00:00
3 changed files with 32 additions and 68 deletions

View File

@ -1,12 +1,3 @@
<i18n>
{
"en": {
"↓": "↓",
"↑": "↑"
}
}
</i18n>
<template>
<div>
<div>
@ -189,7 +180,7 @@
>
{{ option.name }}
<span v-if="currentSort === option.param">
{{ sortOrder === "asc" ? $t("↑") : $t("↓") }}
{{ sortOrder === 'asc' ? '↑' : '↓' }}
</span>
</button>
</MenuItem>
@ -509,10 +500,11 @@ await updateGames(filterQuery.value, true);
function handleSortClick(option: StoreSortOption, event: MouseEvent) {
event.stopPropagation();
if (currentSort.value === option.param) {
sortOrder.value = sortOrder.value === "asc" ? "desc" : "asc";
sortOrder.value = sortOrder.value === 'asc' ? 'desc' : 'asc';
} else {
currentSort.value = option.param;
sortOrder.value = option.param === "name" ? "asc" : "desc";
sortOrder.value = option.param === 'name' ? 'asc' : 'desc';
}
}
</script>
</script>

View File

@ -123,4 +123,4 @@ export default defineEventHandler(async (h3) => {
]);
return { results, count };
});
});

View File

@ -72,7 +72,7 @@ interface IGDBCompanyWebsite extends IGDBItem {
}
interface IGDBCover extends IGDBItem {
image_id: string;
url: string;
}
interface IGDBSearchStub extends IGDBItem {
@ -179,7 +179,7 @@ export class IGDBProvider implements MetadataProvider {
if (response.status !== 200)
throw new Error(
`Error in IGDB \nStatus Code: ${response.status}\n${response.data}`,
`Error in IDGB \nStatus Code: ${response.status}\n${response.data}`,
);
this.accessToken = response.data.access_token;
@ -187,7 +187,7 @@ export class IGDBProvider implements MetadataProvider {
seconds: response.data.expires_in,
});
logger.info("IGDB done authorizing with twitch");
logger.info("IDGB done authorizing with twitch");
}
private async refreshCredentials() {
@ -246,47 +246,39 @@ export class IGDBProvider implements MetadataProvider {
return <T[]>response.data;
}
private async _getMediaInternal(
mediaID: IGDBID,
type: string,
size: string = "t_thumb",
) {
private async _getMediaInternal(mediaID: IGDBID, type: string) {
if (mediaID === undefined)
throw new Error(
`IGDB mediaID when getting item of type ${type} was undefined`,
);
const body = `where id = ${mediaID}; fields image_id;`;
const body = `where id = ${mediaID}; fields url;`;
const response = await this.request<IGDBCover>(type, body);
if (!response.length || !response[0].image_id) {
throw new Error(`No image_id found for ${type} with id ${mediaID}`);
}
let result = "";
const imageId = response[0].image_id;
const result = `https://images.igdb.com/igdb/image/upload/${size}/${imageId}.jpg`;
response.forEach((cover) => {
if (cover.url.startsWith("https:")) {
result = cover.url;
} else {
// twitch *sometimes* provides it in the format "//images.igdb.com"
result = `https:${cover.url}`;
}
});
return result;
}
private async getCoverURL(id: IGDBID) {
return await this._getMediaInternal(id, "covers", "t_cover_big");
return await this._getMediaInternal(id, "covers");
}
private async getArtworkURL(id: IGDBID) {
return await this._getMediaInternal(id, "artworks", "t_1080p");
}
private async getScreenshotURL(id: IGDBID) {
return await this._getMediaInternal(id, "screenshots", "t_1080p");
}
private async getIconURL(id: IGDBID) {
return await this._getMediaInternal(id, "covers", "t_thumb");
return await this._getMediaInternal(id, "artworks");
}
private async getCompanyLogoURl(id: IGDBID) {
return await this._getMediaInternal(id, "company_logos", "t_original");
return await this._getMediaInternal(id, "company_logos");
}
private trimMessage(msg: string, len: number) {
@ -335,7 +327,7 @@ export class IGDBProvider implements MetadataProvider {
let icon = "";
const cover = response[i].cover;
if (cover !== undefined) {
icon = await this.getIconURL(cover);
icon = await this.getCoverURL(cover);
} else {
icon = "";
}
@ -363,26 +355,23 @@ export class IGDBProvider implements MetadataProvider {
const currentGame = (await this.request<IGDBGameFull>("games", body)).at(0);
if (!currentGame) throw new Error("No game found on IGDB with that id");
context?.logger.info("Using IGDB provider.");
context?.logger.info("Using IDGB provider.");
let iconRaw, coverRaw;
let iconRaw;
const cover = currentGame.cover;
if (cover !== undefined) {
context?.logger.info("Found cover URL, using...");
iconRaw = await this.getIconURL(cover);
coverRaw = await this.getCoverURL(cover);
iconRaw = await this.getCoverURL(cover);
} else {
context?.logger.info("Missing cover URL, using fallback...");
iconRaw = jdenticon.toPng(id, 512);
coverRaw = iconRaw;
}
const icon = createObject(iconRaw);
const coverID = createObject(coverRaw);
let banner;
const images = [coverID];
const images = [icon];
for (const art of currentGame.artworks ?? []) {
const objectId = createObject(await this.getArtworkURL(art));
if (!banner) {
@ -395,11 +384,6 @@ export class IGDBProvider implements MetadataProvider {
banner = createObject(jdenticon.toPng(id, 512));
}
for (const screenshot of currentGame.screenshots ?? []) {
const objectId = createObject(await this.getScreenshotURL(screenshot));
images.push(objectId);
}
context?.progress(20);
const publishers: CompanyModel[] = [];
@ -468,25 +452,13 @@ export class IGDBProvider implements MetadataProvider {
const genres = await this.getGenres(currentGame.genres);
let description = "";
let shortDescription = "";
if (currentGame.summary.length > (currentGame.storyline?.length ?? 0)) {
description = currentGame.summary;
shortDescription = this.trimMessage(
currentGame.storyline ?? currentGame.summary,
280,
);
} else {
description = currentGame.storyline ?? currentGame.summary;
shortDescription = this.trimMessage(currentGame.summary, 280);
}
const deck = this.trimMessage(currentGame.summary, 280);
const metadata = {
id: currentGame.id.toString(),
name: currentGame.name,
shortDescription,
description,
shortDescription: deck,
description: currentGame.summary,
released,
genres,
@ -499,7 +471,7 @@ export class IGDBProvider implements MetadataProvider {
icon,
bannerId: banner,
coverId: coverID,
coverId: icon,
images,
};