mirror of
https://github.com/rommapp/romm.git
synced 2026-11-30 10:32:57 +01:00
Add additional cover styles
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user