Merge pull request #6 from zurdi15/develop

rom size rounded to two decimals
This commit is contained in:
Zurdi
2023-03-27 10:21:42 +02:00
committed by GitHub
5 changed files with 6 additions and 3 deletions

View File

@@ -53,10 +53,12 @@ def purge(dbh: DBHandler, p_slug: str = '') -> None:
"""Clean the database from non existent platforms or roms"""
if p_slug:
# Purge only roms in platform
log.info(f"Purge {p_slug}")
dbh.purge_roms(p_slug, fs.get_roms(p_slug))
else:
# Purge all platforms / delete non existent platforms and non existen roms
platforms: list = fs.get_platforms()
dbh.purge_platforms(platforms)
for p_slug in platforms:
log.info(f"Purge {p_slug}")
dbh.purge_roms(p_slug, fs.get_roms(p_slug))

View File

@@ -157,7 +157,7 @@ def get_roms(p_slug: str) -> list:
roms_filename = list(os.walk(f"{EMULATION_BASE_PATH}/{p_slug}/roms/"))[0][2]
roms: list[dict] = [
{'filename': rom,
'size': str(os.stat(f"{EMULATION_BASE_PATH}/{p_slug}/roms/{rom}").st_size / (1024 * 1024))}
'size': str(round(os.stat(f"{EMULATION_BASE_PATH}/{p_slug}/roms/{rom}").st_size / (1024 * 1024), 2))}
for rom in roms_filename]
log.info(f"filesystem roms found for {p_slug}: {roms}")
except IndexError:

View File

@@ -74,7 +74,8 @@ async function scan() {
emitter.emit('snackbarScan', {'msg': "Couldn't complete scan. Something went wrong...", 'icon': 'mdi-close-circle', 'color': 'red'})
})
scanning.value = false
if (!platforms.length){emitter.emit('refresh')}else{emitter.emit('refreshRoms')}
// if (!platforms.length){emitter.emit('refresh')}else{emitter.emit('refresh')}
emitter.emit('refresh')
}
function toggleTheme() {

View File

@@ -156,7 +156,7 @@ async function deleteRom() {
</tr>
<tr>
<td>Size</td>
<td>{{ rom.size }}mb</td>
<td>{{ rom.size }} MB</td>
</tr>
<tr>
<td>Slug</td>