Add additional cover styles

This commit is contained in:
Yannick
2026-03-02 17:47:31 +01:00
parent b2cfb953b8
commit d449e52d8d
2 changed files with 33 additions and 4 deletions

View File

@@ -44,6 +44,31 @@ const aspectRatioOptions = computed(() => [
size: 3 / 4,
source: "IGDB / MobyGames",
},
{
name: "0.71 / 1",
size: 0.71 / 1,
source: "DVD",
},
{
name: "0.79 / 1",
size: 0.79 / 1,
source: "Blu-ray (Full artwork)",
},
{
name: "0.87 / 1",
size: 0.87 / 1,
source: "Blu-ray (Plastic header)",
},
{
name: "1.08 / 1",
size: 1.08 / 1,
source: "Nintendo DS / 3DS",
},
{
name: "0.58 / 1",
size: 0.58 / 1,
source: "PSP",
},
{
name: "1 / 1",
size: 1 / 1,

View File

@@ -46,10 +46,14 @@ export default defineStore("galleryView", {
const platformsStore = storePlatforms();
const platform = platformId ? platformsStore.get(platformId) : null;
if (platform?.aspect_ratio) {
return (
parseInt(platform.aspect_ratio.split("/")[0]) /
parseInt(platform.aspect_ratio.split("/")[1])
);
const ratioParts = platform.aspect_ratio.match(/\d+(?:\.\d+)?/g);
if (ratioParts && ratioParts.length >= 2) {
const width = Number(ratioParts[0]);
const height = Number(ratioParts[1]);
if (Number.isFinite(width) && Number.isFinite(height) && height !== 0) {
return width / height;
}
}
}
return this.defaultAspectRatio;