Merge pull request #174 from zurdi15/develop

v1.7
This commit is contained in:
Zurdi
2023-04-14 16:11:05 +02:00
committed by GitHub
26 changed files with 397 additions and 210 deletions

View File

@@ -1,3 +1,12 @@
# v1.7 (_14-04-2023_)
## Added
- More options and flexibility to prevent files/folders to be scanned. Check [config.yml](docker/config.example.yml) example
- Config file example added to docker/config.example.yml
## Changed
- Rom details page revamped
- RomM logo revamped
# v1.6.5 (_12-04-2023_)
## Added

View File

@@ -1,5 +1,5 @@
<div align="center">
<h1 style="padding:20px;"><img src="romm.svg" height="128px" width="auto" alt="RomM Logo"></h1>
<h1 style="padding:20px;"><img src="romm.svg" height="220px" width="auto" alt="RomM Logo"></h1>
<img alt="GitHub" src="https://img.shields.io/github/license/zurdi15/romm">
<img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/zurdi15/romm">
<img alt="GitHub Workflow Status (with branch)" src="https://img.shields.io/github/actions/workflow/status/zurdi15/romm/image.yml?branch=master">
@@ -111,21 +111,13 @@ RomM will try to find the structure 1 and if it doesn't exists, RomM will try to
## ⚙️ Config.yml file
RomM can be configured through a yml file. This is used to exclude platform folders and game files with a certain extension to be scanned. For a configuration change to take effect, RomM must be restarted.
RomM can be configured through a yml file. This is used to exclude platforms and/or roms to be scanned.
Check the [docker-compose.yml](https://github.com/zurdi15/romm/blob/master/docker/docker-compose.example.yml) to see where to bind it.
For a configuration change to take effect, RomM must be restarted.
Config file example:
Check the [config.yml](https://github.com/zurdi15/romm/blob/master/docker/config.example.yml) example.
```
exclude:
folders:
- 'folder_1_to_exclude'
- 'folder_2_to_exclude'
files:
- 'txt'
- 'file_extension_to_exclude'
```
Check the [docker-compose.yml](https://github.com/zurdi15/romm/blob/master/docker/docker-compose.example.yml) example to see how to bind it.
# Naming convention

View File

@@ -21,6 +21,10 @@ def store_default_resources() -> None:
# ========= Platforms utils =========
def _exclude_platforms(platforms) -> list['str']:
[platforms.remove(excluded) for excluded in user_config['exclude']['platforms'] if excluded in platforms]
def get_platforms() -> list[str]:
"""Gets all filesystem platforms
@@ -30,7 +34,7 @@ def get_platforms() -> list[str]:
try:
platforms: list[str] = list(os.walk(HIGH_PRIO_STRUCTURE_PATH))[0][1] if os.path.exists(HIGH_PRIO_STRUCTURE_PATH) else list(os.walk(LIBRARY_BASE_PATH))[0][1]
try:
[platforms.remove(excluded) for excluded in user_config['exclude']['folders'] if excluded in platforms]
_exclude_platforms(platforms)
except (KeyError, TypeError):
pass
return platforms
@@ -45,17 +49,65 @@ def _get_roms_structure(p_slug) -> tuple:
return f"{HIGH_PRIO_STRUCTURE_PATH}/{p_slug}" if os.path.exists(HIGH_PRIO_STRUCTURE_PATH) else f"{LIBRARY_BASE_PATH}/{p_slug}/roms"
def _exclude_files(roms_files) -> list[str]:
def _exclude_single_roms(roms) -> list[str]:
try:
excluded_files: list = user_config['exclude']['files']
filtered_files: list = []
for file_name in roms_files:
if file_name.split('.')[-1] in excluded_files:
filtered_files.append(file_name)
roms_files = [f for f in roms_files if f not in filtered_files]
excluded_extensions: list = []
excluded_extensions = user_config['exclude']['roms']['single_file']['extensions']
except (TypeError, KeyError):
pass
return roms_files
try:
excluded_names: list = []
excluded_names = user_config['exclude']['roms']['single_file']['names']
except (TypeError, KeyError):
pass
filtered_files: list = []
for rom in roms:
try:
if rom.split('.')[-1] in excluded_extensions or rom in excluded_names:
filtered_files.append(rom)
except TypeError:
pass
roms = [f for f in roms if f not in filtered_files]
return roms
def _exclude_multi_roms(roms) -> list[str]:
try:
excluded_names: list = []
excluded_names = user_config['exclude']['roms']['multi_file']['names']
except (TypeError, KeyError):
pass
filtered_files: list = []
for rom in roms:
try:
if rom in excluded_names:
filtered_files.append(rom)
except TypeError:
pass
roms = [f for f in roms if f not in filtered_files]
return roms
def _exclude_multi_roms_parts(parts) -> list[str]:
try:
excluded_extensions: list = []
excluded_extensions = user_config['exclude']['roms']['multi_file']['parts']['extensions']
except (TypeError, KeyError):
pass
try:
excluded_names: list = []
excluded_names = user_config['exclude']['roms']['multi_file']['parts']['names']
except (TypeError, KeyError):
pass
filtered_files: list = []
for part in parts:
try:
if part.split('.')[-1] in excluded_extensions or part in excluded_names:
filtered_files.append(part)
except TypeError:
log.warning(f"Config file is malformed")
parts = [f for f in parts if f not in filtered_files]
return parts
def parse_tags(file_name: str) -> tuple:
@@ -80,7 +132,7 @@ def _get_file_extension(file: str) -> str:
def _get_rom_files(multi: bool, rom: str, roms_path: str) -> list[str]:
return [] if not multi else _exclude_files(list(os.walk(f"{roms_path}/{rom}"))[0][2])
return [] if not multi else _exclude_multi_roms_parts(list(os.walk(f"{roms_path}/{rom}"))[0][2])
def _get_file_size(multi: bool, rom: str, files: list, roms_path:str) -> str:
@@ -102,14 +154,18 @@ def get_roms(p_slug: str, full_scan: bool, only_amount: bool = False) -> list[di
"""
roms_path = _get_roms_structure(p_slug)
roms: list[dict] = []
db_roms: list[str] = [rom.file_name for rom in dbh.get_roms(p_slug)]
fs_roms: list[dict] = [{'multi': False, 'file': rom} for rom in _exclude_files(list(os.walk(roms_path))[0][2])] + \
[{'multi': True, 'file': rom} for rom in list(os.walk(roms_path))[0][1]]
if only_amount: return len(db_roms)
db_roms: list[str] = [rom.file_name for rom in dbh.get_roms(p_slug)]
fs_single_roms: list[str] = list(os.walk(roms_path))[0][2]
fs_multi_roms: list[str] = list(os.walk(roms_path))[0][1]
fs_roms: list[dict] = [{'multi': False, 'file': rom} for rom in _exclude_single_roms(fs_single_roms)] + \
[{'multi': True, 'file': rom} for rom in _exclude_multi_roms(fs_multi_roms)]
if only_amount: return len(fs_roms)
for rom in fs_roms:
if rom['file'] in db_roms and not full_scan: continue
if rom['file'] in db_roms and not full_scan and not rom['multi']: continue
reg, rev, other_tags = parse_tags(rom['file'])
file_extension: str = _get_file_extension(rom['file'])
files: list = _get_rom_files(rom['multi'], rom['file'], roms_path)

31
docker/config.example.yml Normal file
View File

@@ -0,0 +1,31 @@
exclude:
# Exclude platforms to be scanned
platforms:
- 'romm'
# Exclude roms or parts of roms to be scanned
roms:
## Single file games section
single_file:
# Exclude matched file names to be sanned
names:
- 'info.txt'
# Exclude all files with certain extensions to be scanned
extensions:
- 'xml'
## Multi files games section
multi_file:
# Exclude matched 'folder' (RomM identifies folders as multi file games) names to be scanned
names:
- 'my_multi_file_game'
- 'DLC'
parts:
# Exclude matched file names to be sanned from multi file roms
# Keep in mind that RomM doesn't scan folders inside multi files games,
# so there is no need to exclude folders from inside of multi files games.
names:
- 'data.xml'
# Exclude all files with certain extensions to be scanned from multi file roms
extensions:
- 'txt'

View File

@@ -1 +1 @@
VITE_ROMM_VERSION=1.6.5
VITE_ROMM_VERSION=1.7

View File

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 110 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

1
frontend/assets/romm.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 51 KiB

View File

@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<link rel="icon" href="/public/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>RomM</title>
</head>

View File

@@ -1,12 +1,12 @@
{
"name": "romm",
"version": "1.6.5",
"version": "1.7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "romm",
"version": "1.6.5",
"version": "1.7",
"dependencies": {
"@mdi/font": "7.0.96",
"axios": "^1.3.4",

View File

@@ -1,6 +1,6 @@
{
"name": "romm",
"version": "1.6.5",
"version": "1.7",
"private": true,
"scripts": {
"dev": "vite --host",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -25,7 +25,7 @@ emitter.on('refresh', () => { refresh.value = !refresh.value })
<platforms-drawer :key="refresh"/>
<v-main>
<v-container class="pa-0" fluid>
<v-container fluid>
<router-view :key="refresh"/>
</v-container>
</v-main>

View File

@@ -1,6 +1,6 @@
<script setup>
import { ref, inject } from "vue"
import RomMIcon from '@/components/AppBar/RomMIcon.vue'
import { useRouter } from 'vue-router'
import PlatformsBtn from '@/components/AppBar/PlatformsBtn.vue'
import UploadBtn from '@/components/AppBar/UploadBtn.vue'
import SearchBar from '@/components/AppBar/SearchBar.vue'
@@ -9,31 +9,34 @@ import SettingsBtn from '@/components/AppBar/SettingsBtn.vue'
// Props
const scanning = ref(false)
const router = useRouter()
// Event listeners bus
const emitter = inject('emitter')
emitter.on('scanning', (s) => { scanning.value = s })
// Functions
async function goHome(){
await router.push(import.meta.env.BASE_URL)
}
</script>
<template>
<v-app-bar class="elevation-3">
<v-progress-linear
:active="scanning"
:indeterminate="true"
absolute/>
<rom-m-icon/>
<v-progress-linear :active="scanning" :indeterminate="true" absolute/>
<v-avatar size="100" class="ml-3 home-btn hidden-sm-and-down" @click="goHome()"><v-img src="/assets/romm.svg"></v-img></v-avatar>
<platforms-btn/>
<v-spacer class="hidden-xs-and-down"/>
<upload-btn/>
<search-bar/>
<search-bar/>
<template v-slot:append>
<gallery-view-btn/>
<settings-btn/>
@@ -42,3 +45,9 @@ emitter.on('scanning', (s) => { scanning.value = s })
</v-app-bar>
</template>
<style scoped>
.home-btn{
cursor: pointer;
}
</style>

View File

@@ -1,11 +0,0 @@
<template>
<v-avatar
class="ml-4 mr-2 hidden-md-and-down"
:rounded="0">
<v-img src="/assets/romm.ico"/>
</v-avatar>
<v-list-item-title
class="text-h6 font-weight-black ma-2 hidden-md-and-down">
RomM
</v-list-item-title>
</template>

View File

@@ -32,20 +32,22 @@ const emitter = inject('emitter')
<v-list-item>{{ rom.file_name }}</v-list-item>
</div>
</v-expand-transition>
<div>
<v-chip-group class="pl-1 pt-0">
<v-chip
v-show="rom.region"
class="ml-1 mr-1 bg-primary"
size="x-small">
class="bg-primary"
size="x-small"
label>
{{ rom.region }}
</v-chip>
<v-chip
v-show="rom.revision"
class="mr-1 bg-primary"
size="x-small">
class="bg-primary"
size="x-small"
label>
{{ rom.revision }}
</v-chip>
</div>
</v-chip-group>
</v-img>
</template>
@@ -59,4 +61,4 @@ const emitter = inject('emitter')
.rom-title:not(.on-hover) {
opacity: 0.85;
}
</style>
</style>

View File

@@ -10,6 +10,7 @@
</v-row>
<template v-slot:prepend><v-avatar/></template>
<template v-slot:append>
<!-- TODO: remake this little trick -->
<v-col class="pa-0 ml-1">
<v-btn disabled size="x-small" variant="text"/>
<v-btn size="x-small" variant="text" disabled/>

View File

@@ -1,6 +1,7 @@
<script setup>
import axios from "axios"
import { ref, inject } from "vue"
import { useRouter } from 'vue-router'
import RailBtn from '@/components/PlatformsDrawer/RailBtn.vue'
import Platform from '@/components/PlatformsDrawer/Platform.vue'
@@ -9,6 +10,7 @@ const selectedPlatform = ref(JSON.parse(localStorage.getItem('selectedPlatform')
const platforms = ref([])
const platformsDrawer = ref(null)
const rail = (localStorage.getItem('rail') == 'true') ? ref(true) : ref(false)
const router = useRouter()
// Event listeners bus
const emitter = inject('emitter')
@@ -23,15 +25,24 @@ async function getPlatforms() {
}).catch((error) => {console.log(error)})
}
async function goHome(){
await router.push(import.meta.env.BASE_URL)
}
getPlatforms()
emitter.emit('selectedPlatform', selectedPlatform.value)
</script>
<template>
<v-navigation-drawer v-model="platformsDrawer" :rail="rail" width="300" rail-width="72">
<v-navigation-drawer v-model="platformsDrawer" :rail="rail" width="300" rail-width="75">
<v-list>
<v-row @click="goHome()" class="justify-center hidden-md-and-up">
<v-img src="/assets/romm.svg" class="home-btn justify-center"></v-img>
</v-row>
<v-divider class="border-opacity-25 hidden-md-and-up"/>
<platform v-for="platform in platforms" :platform="platform" :rail="rail"/>
</v-list>
@@ -42,3 +53,11 @@ emitter.emit('selectedPlatform', selectedPlatform.value)
</v-navigation-drawer>
</template>
<style scoped>
.home-btn {
width: 100px;
height: 100px;
cursor: pointer;
}
</style>

View File

@@ -2,6 +2,7 @@
import axios from 'axios'
import { ref, inject } from 'vue'
import { useRouter } from 'vue-router'
import { useDisplay } from "vuetify"
import { downloadRom, downloadSave } from '@/utils/utils.js'
// Props
@@ -19,6 +20,9 @@ const dialogDeleteRom = ref(false)
const deleteFromFs = ref(false)
const router = useRouter()
const filesToDownload = ref([])
const tab = ref('info')
const selectedPlatform = ref(JSON.parse(localStorage.getItem('selectedPlatform')) || '')
const { xs, sm, mdAndUp } = useDisplay()
// Event listeners bus
const emitter = inject('emitter')
@@ -75,132 +79,180 @@ async function deleteRom() {
</script>
<template>
<v-row class="text-body-1 justify-center pa-5">
<v-col cols="8" xs="8" sm="4" md="3" lg="2">
<v-container class="pa-0" fluid>
<v-row>
<v-col>
<v-card >
<v-img :src="'/assets'+rom.path_cover_l+'?reload='+Date.now()" :lazy-src="'/assets'+rom.path_cover_s+'?reload='+Date.now()" cover>
<template v-slot:placeholder>
<div class="d-flex align-center justify-center fill-height">
<v-progress-circular :width="2" :size="20" indeterminate/>
</div>
</template>
</v-img>
</v-card>
</v-col>
</v-row>
<v-row class="pt-1 pb-1 pl-2 pr-2 mt-0">
<v-container>
<v-row>
<v-col class="pa-1">
<v-btn
@click="downloadRom(rom, emitter, filesToDownload)"
rounded="0"
block>
<v-icon
icon="mdi-download"
size="large"/>
</v-btn>
</v-col>
<v-col class="pa-1">
<v-btn @click="downloadSave(rom, emitter)" rounded="0" block :disabled="!saveFiles"><v-icon icon="mdi-content-save-all" size="large"/></v-btn>
</v-col>
<v-col class="pa-1">
<v-menu location="bottom">
<template v-slot:activator="{ props }">
<v-btn v-bind="props" rounded="0" block>
<v-icon icon="mdi-dots-vertical" size="large"/>
</v-btn>
<v-card class="bg" position="absolute" rounded="0" flat><v-img :src="'/assets'+rom.path_cover_l+'?reload='+Date.now()" cover class="bg-img"/></v-card>
<div :class="{'content': mdAndUp, 'content-tablet': sm, 'content-mobile': xs}">
<v-row class="pt-8 justify-center">
<v-col :class="{'cover': mdAndUp, 'cover-tablet': sm, 'cover-mobile': xs}">
<v-row>
<v-col>
<v-card class="hidden-md-and-down" elevation="5">
<v-img :src="'/assets'+rom.path_cover_l+'?reload='+Date.now()" :lazy-src="'/assets'+rom.path_cover_s+'?reload='+Date.now()" cover>
<template v-slot:placeholder>
<div class="d-flex align-center justify-center fill-height">
<v-progress-circular :width="2" :size="20" indeterminate/>
</div>
</template>
<v-list rounded="0" class="pa-0">
<v-list-item @click="searchRomIGDB()" class="pt-4 pb-4 pr-5">
<v-list-item-title class="d-flex"><v-icon icon="mdi-search-web" class="mr-2"/>Search IGDB</v-list-item-title>
</v-list-item>
<v-divider class="border-opacity-25"/>
<v-list-item @click="dialogEditRom=true" class="pt-4 pb-4 pr-5">
<v-list-item-title class="d-flex"><v-icon icon="mdi-pencil-box" class="mr-2"/>Edit</v-list-item-title>
</v-list-item>
<v-divider class="border-opacity-25"/>
<v-list-item @click="dialogDeleteRom=true" class="pt-4 pb-4 pr-5 bg-red">
<v-list-item-title class="d-flex"><v-icon icon="mdi-delete" class="mr-2"/>Delete</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-col>
</v-row>
</v-container>
</v-row>
</v-container>
</v-col>
<v-col cols="15" xs="15" sm="12" md="6" lg="10">
<v-table density="comfortable">
<tbody>
<tr><td>Name</td><td>{{ rom.name }}</td></tr>
<tr v-show="!rom.multi"><td>File</td><td>{{ rom.file_name }}</td></tr>
<tr v-show="rom.multi"><td>Files</td><td>
<v-select :label="rom.file_name" item-title="file_name" v-model="filesToDownload" :items="rom.files" class="mt-2 mb-2" density="compact" variant="outlined" return-object multiple hide-details clearable chips/>
</td></tr>
<tr><td>Platform</td><td>{{ rom.p_slug }}</td></tr>
<tr><td>Size</td><td>{{ rom.file_size }} MB</td></tr>
<tr><td>IGDB id</td><td><a :href="'https://www.igdb.com/games/'+rom.r_slug">{{ rom.r_igdb_id }}</a></td></tr>
<tr v-show="rom.region"><td>Region</td><td>{{ rom.region }}</td></tr>
<tr v-show="rom.revision"><td>Revision</td><td>{{ rom.revision }}</td></tr>
<tr v-show="rom.tags.length>0"><td>Tags</td><td><v-chip-group><v-chip v-for="tag in rom.tags" label>{{ tag }}</v-chip></v-chip-group></td></tr>
<tr><td>Summary</td><td class="pt-3">{{ rom.summary }}</td></tr>
</tbody>
</v-table>
</v-col>
</v-row>
</v-img>
</v-card>
<v-card class="hidden-lg-and-up" elevation="5">
<v-img :src="'/assets'+rom.path_cover_l+'?reload='+Date.now()" :lazy-src="'/assets'+rom.path_cover_s+'?reload='+Date.now()" cover>
<template v-slot:placeholder>
<div class="d-flex align-center justify-center fill-height">
<v-progress-circular :width="2" :size="20" indeterminate/>
</div>
</template>
</v-img>
</v-card>
</v-col>
</v-row>
<v-row class="pl-3 pr-3">
<v-col class="pa-0">
<v-btn @click="downloadRom(rom, emitter, filesToDownload)" rounded="0" block><v-icon icon="mdi-download" size="large"/></v-btn>
</v-col>
<v-col class="pa-0">
<v-btn @click="downloadSave(rom, emitter)" rounded="0" block :disabled="!saveFiles"><v-icon icon="mdi-content-save-all" size="large"/></v-btn>
</v-col>
<v-col class="pa-0">
<v-menu location="bottom">
<template v-slot:activator="{ props }">
<v-btn v-bind="props" rounded="0" block>
<v-icon icon="mdi-dots-vertical" size="large"/>
</v-btn>
</template>
<v-list rounded="0" class="pa-0">
<v-list-item @click="searchRomIGDB()" class="pt-4 pb-4 pr-5">
<v-list-item-title class="d-flex"><v-icon icon="mdi-search-web" class="mr-2"/>Search IGDB</v-list-item-title>
</v-list-item>
<v-divider class="border-opacity-25"/>
<v-list-item @click="dialogEditRom=true" class="pt-4 pb-4 pr-5">
<v-list-item-title class="d-flex"><v-icon icon="mdi-pencil-box" class="mr-2"/>Edit</v-list-item-title>
</v-list-item>
<v-divider class="border-opacity-25"/>
<v-list-item @click="dialogDeleteRom=true" class="pt-4 pb-4 pr-5 bg-red">
<v-list-item-title class="d-flex"><v-icon icon="mdi-delete" class="mr-2"/>Delete</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-col>
</v-row>
</v-col>
<v-col class="mt-10" :class="{'info': mdAndUp, 'info-tablet': sm, 'info-mobile': xs}">
<div class="info-header text-white">
<v-row no-gutters>
<p class="text-h4 font-weight-bold">{{ rom.name }}</p>
<v-chip-group class="ml-3 mt-1 hidden-xs">
<v-chip v-show="rom.region" size="x-small" class="bg-primary" label>{{ rom.region }}</v-chip>
<v-chip v-show="rom.revision" size="x-small" class="bg-primary" label>{{ rom.revision }}</v-chip>
</v-chip-group>
</v-row>
<v-row no-gutters class="align-center">
<p class="font-italic mt-1">{{ selectedPlatform['name'] }}</p>
<v-chip-group class="ml-3 mt-1 hidden-sm-and-up">
<v-chip v-show="rom.region" size="x-small" class="bg-primary" label>{{ rom.region }}</v-chip>
<v-chip v-show="rom.revision" size="x-small" class="bg-primary" label>{{ rom.revision }}</v-chip>
</v-chip-group>
</v-row>
</div>
<div class="mb-10" :class="{'info-content': mdAndUp, 'info-content-tablet': sm, 'info-content-mobile': xs}">
<v-tabs v-model="tab">
<v-tab value="info">Info</v-tab>
<v-tab value="saves" disabled>Saves</v-tab>
<v-tab value="screenshots" disabled>Screenshots</v-tab>
</v-tabs>
<v-window v-model="tab" class="mt-2">
<v-window-item value="info">
<v-row v-if="!rom.multi" class="d-flex align-center text-body-1 mt-0">
<v-col cols="3" xs="3" sm="2" md="2" lg="2" class="font-weight-medium"><p>File</p></v-col>
<v-col class="text-body-1"><p>{{ rom.file_name }}</p></v-col>
</v-row>
<v-row v-if="rom.multi" class="d-flex align-center text-body-1 mt-0">
<v-col cols="3" xs="3" sm="2" md="2" lg="2" class="font-weight-medium"><p>Files</p></v-col>
<v-col><v-select :label="rom.file_name" item-title="file_name" v-model="filesToDownload" :items="rom.files" class="mt-2 mb-2" density="compact" variant="outlined" return-object multiple hide-details clearable chips/></v-col>
</v-row>
<v-row class="d-flex align-center text-body-1 mt-0">
<v-col cols="3" xs="3" sm="2" md="2" lg="2" class="font-weight-medium"><p>Size</p></v-col>
<v-col><p>{{ rom.file_size }} MB</p></v-col>
</v-row>
<v-row v-if="rom.r_igdb_id!=''" class="d-flex align-center text-body-1 mt-0">
<v-col cols="3" xs="3" sm="2" md="2" lg="2" class="font-weight-medium"><p>IGDB</p></v-col>
<v-col>
<v-chip variant="outlined" :href="'https://www.igdb.com/games/'+rom.r_slug" label>{{ rom.r_igdb_id }}</v-chip>
</v-col>
</v-row>
<v-row v-if="rom.tags.length>0" class="d-flex align-center text-body-1 mt-0">
<v-col cols="3" xs="3" sm="2" md="2" lg="2" class="font-weight-medium"><p>Tags</p></v-col>
<v-col><v-chip-group class="pt-0"><v-chip v-for="tag in rom.tags" label>{{ tag }}</v-chip></v-chip-group></v-col>
</v-row>
<v-row class="d-flex mt-3">
<v-col class="font-weight-medium text-caption"><p>{{ rom.summary }}</p></v-col>
</v-row>
</v-window-item>
<v-window-item value="saves">
<v-row class="d-flex mt-2"></v-row>
</v-window-item>
<v-window-item value="screenshots">
<v-row class="d-flex mt-2">
<v-col class="font-weight-medium text-caption"><p>{{ rom.summary }}</p></v-col>
</v-row>
</v-window-item>
</v-window>
</div>
</v-col>
</v-row>
</div>
<v-dialog v-model="dialogSearchRom" scroll-strategy="none" width="auto" :scrim="false">
<v-card max-width="600">
<v-card rounded="0" :class="{'search-content': mdAndUp, 'search-content-tablet': sm, 'search-content-mobile': xs}">
<v-toolbar v-show="searching">
<v-toolbar-title>Searching...</v-toolbar-title>
<v-toolbar>
<v-toolbar-title v-show="searching">Searching...</v-toolbar-title>
<v-toolbar-title v-show="!searching">Results found</v-toolbar-title>
<v-btn icon @click="dialogSearchRom=false" class="ml-1" rounded="0"><v-icon>mdi-close</v-icon></v-btn>
</v-toolbar>
<v-toolbar v-show="!searching">
<v-toolbar-title>Results found</v-toolbar-title>
<v-btn icon @click="dialogSearchRom=false" class="ml-1" rounded="0"><v-icon>mdi-close</v-icon></v-btn>
</v-toolbar>
<v-text-field
@keyup.enter="searchRomIGDB()"
@click:clear="igdb_id=''"
v-show="!searching"
v-model="igdb_id"
label="search by id"
prepend-inner-icon="mdi-search-web"
class="ml-5 mt-5 mr-5 mb-5 shrink"
variant="outlined"
density="compact"
hide-details
clearable/>
<v-card-text rounded="0" class="pa-3 scroll">
<div class="d-flex justify-center">
<v-progress-circular v-show="searching" :width="2" :size="40" class="pa-3 ma-3" indeterminate/>
</div>
<v-row v-show="!searching" class="pa-4">
<p v-show="matchedRoms.length==0">No results found</p>
<v-col v-for="rom in matchedRoms">
<v-card-text class="pa-3 scroll justify-center align-center">
<v-row>
<v-text-field
@keyup.enter="searchRomIGDB()"
@click:clear="igdb_id=''"
v-show="!searching"
v-model="igdb_id"
label="search by id"
prepend-inner-icon="mdi-search-web"
class="ml-5 mt-5 mr-5 mb-5 "
variant="outlined"
density="compact"
hide-details
clearable/>
</v-row>
<v-row class="justify-center align-center loader-searching" v-show="searching"><v-progress-circular :width="2" :size="40" class="pa-3 ma-3" indeterminate/></v-row>
<v-row class="justify-center align-center no-results-searching" v-show="!searching && matchedRoms.length==0" ><p>No results found</p></v-row>
<v-row class="pl-4 pr-4">
<v-col cols="6" xs="6" sm="4" md="3" lg="3" v-show="!searching" v-for="rom in matchedRoms">
<v-hover v-slot="{isHovering, props}">
<v-card @click="updateRom(rom, undefined)" v-bind="props" :class="{'on-hover': isHovering}" :elevation="isHovering ? 20 : 3" min-width="100" max-width="140">
<v-card @click="updateRom(rom, undefined)" v-bind="props" :class="{'on-hover': isHovering}" :elevation="isHovering ? 20 : 3">
<v-img v-bind="props" :src="rom.url_cover" cover/>
<v-card-text>
<v-row class="pa-2">{{ rom.name }}</v-row>
<v-row class="pa-2">
<span class="d-inline-block text-truncate">{{ rom.name }}</span>
</v-row>
</v-card-text>
</v-card>
</v-hover>
</v-col>
</v-row>
</v-card-text>
<v-card-actions v-show="!searching">
<v-checkbox v-model="renameAsIGDB" label="Rename file" class="pl-3" hide-details="true"/>
</v-card-actions>
</v-card>
</v-dialog>
@@ -209,7 +261,7 @@ async function deleteRom() {
</v-dialog>
<v-dialog v-model="dialogEditRom" scroll-strategy="none" width="auto" :scrim="false">
<v-card max-width="600" min-width="340">
<v-card rounded="0" max-width="600" min-width="340">
<v-toolbar>
<v-toolbar-title>Editing {{ rom.file_name }}</v-toolbar-title>
<v-btn icon @click="dialogEditRom=false" class="ml-1" rounded="0"><v-icon>mdi-close</v-icon></v-btn>
@@ -225,7 +277,7 @@ async function deleteRom() {
</v-dialog>
<v-dialog v-model="dialogDeleteRom" width="auto">
<v-card max-width="600">
<v-card rounded="0" max-width="600">
<v-toolbar class="bg-red">
<v-toolbar-title>Deleting {{ rom.file_name }}</v-toolbar-title>
<v-btn icon @click="dialogDeleteRom=false" class="ml-1" rounded="0"><v-icon>mdi-close</v-icon></v-btn>
@@ -249,4 +301,63 @@ async function deleteRom() {
.scroll {
overflow-y: scroll
}
.bg {
top: 0px;
left: 0px;
width: 100%;
max-height: 330px;
}
.bg-img{
-webkit-filter: blur(15px);
filter: blur(15px);
}
.content, .content-tablet{
margin-left: 100px;
margin-right: 100px;
}
.content, .content-tablet, .content-mobile {
position: relative;
}
.cover, .cover-tablet, .cover-mobile {
min-width: 245px;
min-height: 326px;
max-width: 245px;
max-height: 326px;
}
.info, .info-tablet, .info-mobile {
padding-left: 25px;
padding-right: 25px;
}
.info-header{
text-shadow: 1px 1px 3px #000000, 0 0 3px #000000;
}
.info-content{
margin-top: 110px;
max-width: 700px;
}
.info-content-tablet {
margin-top: 70px;
max-width: 700px;
}
.info-content-mobile{
margin-top: 40px;
}
.loader-searching {
margin-top: 200px;
}
.no-results-searching {
margin-top: 150px;
}
.search-content{
width: 700px;
height: 540px;
}
.search-content-tablet{
width: 500px;
height: 540px;
}
.search-content-mobile{
width: 310px;
height: 540px;
}
</style>

View File

@@ -4,7 +4,7 @@ import { ref, inject, onMounted } from 'vue'
import { normalizeString, views } from '@/utils/utils.js'
import GameCard from '@/components/GameEntry/Card/Base.vue'
import GameListHeader from '@/components/GameEntry/ListItem/Header.vue'
import GameListItem from '@/components/GameEntry/ListItem/Base.vue'
import GameListItem from '@/components/GameEntry/ListItem/Item.vue'
// Props
const roms = ref([])
@@ -50,7 +50,7 @@ onMounted(() => {
<template>
<v-row class="pa-5" v-show="currentView != 2">
<v-row v-show="currentView != 2">
<v-col v-for="rom in romsFiltered"
:cols="views[currentView]['size-cols']"
:xs="views[currentView]['size-xs']"

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 52 KiB