Commit Graph

434 Commits

Author SHA1 Message Date
Georges-Antoine Assi
584f35b797 changes from bot review 2026-05-19 07:52:43 -04:00
Georges-Antoine Assi
757fafae5f feat(fs): hardlink import/export assets when possible, harden sync init
Importer (gamelist/launchbox file:// flows) and exporters (gamelist.xml,
metadata.pegasus.txt local exports) now hardlink media assets when source
and destination share a filesystem, falling back transparently to a copy
on EXDEV / EPERM / EOPNOTSUPP / EMLINK / EACCES (cross-device, FAT32,
exFAT, network mounts, etc.). Saves disk space and is effectively
instantaneous on large files (videos, manuals, miximages).

Covers keep a real copy (allow_link=False) because _store_cover resizes
the small cover in place via PIL.Image.save, which would truncate the
shared inode and corrupt the user's source image.

Also makes FSSyncHandler tolerate a missing/unwritable /romm/sync at
startup: an OSError from mkdir now logs a warning instead of crashing
the whole app at module-import time. Sync calls still fail at use time
if the mount remains broken — the right place to surface the error.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 07:38:11 -04:00
Georges-Antoine Assi
4f03cdf03d Copy gamelist media into a local assets/ folder
Mirror the pegasus exporter pattern: collect each ROM's media into a
canonical asset-kind dict, then either copy the files under
<platform>/assets/<subdir>/ for local exports or build absolute URLs
from request.base_url for remote exports. Exclude the generated assets/
directory from filesystem scans.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 08:15:41 -04:00
Georges-Antoine Assi
f4227cafaf Build absolute resource URLs and simplify traversal check
Use URLPath.make_absolute_url with request.base_url to build resource
URLs for non-local exports, and simplify the local-export traversal
check with Path.is_relative_to.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 22:22:09 -04:00
Gavin Tronset
4a2a4d6d38 PR feedback for tests and relpath validation 2026-05-13 15:23:54 -07:00
Gavin Tronset
87f0cbd3de Fix YouTube URL and conditionally use relative 2026-05-13 13:37:45 -07:00
Gavin Tronset
17d5178586 Use relative paths for resources in gamelist exports 2026-05-13 13:37:45 -07:00
Yukine
a00bb281e4 refactor(utils): move fire_and_forget helper into utils.background_tasks 2026-04-21 12:50:10 +02:00
Georges-Antoine Assi
e8a6e9f01d final fixes 2026-04-12 18:43:24 -04:00
Georges-Antoine Assi
d45afb5dde more fixes 2026-04-12 18:32:15 -04:00
Georges-Antoine Assi
8f1b8f41d7 perf: skip RAHasher subprocess for archived disc-platform ROMs
RAHasher was being spawned for every hashable ROM regardless of file
type. When the source file is a zip/7z/tar and the RA platform needs
an on-disk disc image (PSX, PS2, PSP, Saturn, Dreamcast, Sega CD,
3DO, PC-FX, Neo Geo CD, TurboGrafx CD, Atari Jaguar CD, Wii), the
subprocess fails with "Unsupported console for buffer hash: {id}"
after paying full process-spawn overhead per ROM — a serious slowdown
when indexing large zipped collections (e.g. myrient PS2/PSP sets).

calculate_hash now short-circuits those combinations with a debug log
and no subprocess. Raw disc images (.iso, .chd, .cue/.bin) and
archives on cartridge platforms still go through RAHasher as before.

Also centralize COMPRESSED_FILE_EXTENSIONS in utils/filesystem.py so
roms_handler (is_compressed_file / hashing), rahasher (skip logic),
and feeds (PKGi passthrough) share one source of truth. The shared
set adds .rar, which is_compressed_file now recognizes too.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 17:18:14 -04:00
Georges-Antoine Assi
62e540d60e changes from bot review 2026-04-12 15:43:14 -04:00
Georges-Antoine Assi
4928041593 manual cleanu 2026-04-12 11:04:12 -04:00
Georges-Antoine Assi
2dc1678931 changes from bot review 2026-04-06 11:22:44 -04:00
Georges-Antoine Assi
f2619ac0d1 Merge branch 'master' into pegasus-metadata-export 2026-04-06 11:06:08 -04:00
Georges-Antoine Assi
21eee327b0 Merge branch 'master' into save-sync 2026-04-06 09:09:53 -04:00
Georges-Antoine Assi
af69630481 more self review 2026-04-05 23:17:57 -04:00
Georges-Antoine Assi
1501f45220 more changes from review 2026-04-05 23:15:42 -04:00
Georges-Antoine Assi
fafb804bc6 mega cleanup 2026-04-05 22:35:37 -04:00
Georges-Antoine Assi
a61ff81e22 Merge branch 'master' into gamelist-customize 2026-04-05 22:11:02 -04:00
Georges-Antoine Assi
f2e8e337b2 Merge branch 'master' into save-sync 2026-04-05 21:47:53 -04:00
Georges-Antoine Assi
b79bcbcfce remove clud meta ID 2026-04-05 19:50:37 -04:00
Georges-Antoine Assi
7c41fb5bac revert fs_name sibling roms 2026-04-05 17:57:48 -04:00
Georges-Antoine Assi
ef35ecaea9 props rom updte endpoint 2026-04-04 14:16:00 -04:00
Georges-Antoine Assi
4a8c3423df run trunk fmt 2026-04-02 10:21:43 -04:00
Eric Daras
9d659bf00b move proxy env handling into config 2026-04-02 06:23:53 +02:00
Vargash
11827d1700 fix: retrieve config from get_config() 2026-03-31 15:08:19 +02:00
Vargash
f4c965be33 feat: add new export.gamelist.media.image configuration
also fix broken title_screen/miximage/physical key name usage
2026-03-31 11:16:40 +02:00
Vargash
ec30b18bba feat: add bezel tag to gamelist export 2026-03-31 11:04:13 +02:00
Vargash
3e072873e1 feat: new export.gamelist.media.thumbnail configuration 2026-03-31 11:00:49 +02:00
Vargash
0b8dffa99d feat: add family and players tags to gamelist export 2026-03-31 10:31:46 +02:00
Vargash
e4ef3b710c fix: correctly normalize average rating metadatum from 0-100 to 0-1 2026-03-31 09:56:11 +02:00
Eric Daras
8540514b46 add outbound HTTP proxy support for backend requests 2026-03-27 07:02:14 +01:00
nendo
e21ea088ed Revert double-encoding in ZipResponse Content-Disposition 2026-03-25 06:51:24 +09:00
nendo
2bad483a84 Fix mod_zip UTF-8 filename handling for non-ASCII downloads
Add X-Archive-Charset: UTF-8 header so mod_zip sets the EFS flag on ZIP
entries, ensuring extractors interpret filenames as UTF-8 instead of
CP437. Also URL-encode the Content-Disposition filename to match
FileRedirectResponse behavior.
2026-03-25 06:26:59 +09:00
Georges-Antoine Assi
f107dc2752 changes from bot rview 2026-03-22 17:17:14 -04:00
Georges-Antoine Assi
6c88333efa cleanup 2026-03-22 09:50:10 -04:00
Georges-Antoine Assi
5bf3a435ee moer fixes 2026-03-21 22:57:44 -04:00
Georges-Antoine Assi
26affaaf36 cleanup 2026-03-21 22:46:05 -04:00
Georges-Antoine Assi
4536deff65 more twekas 2026-03-21 22:30:10 -04:00
Georges-Antoine Assi
49a73e8944 export media to assets folder 2026-03-21 21:55:11 -04:00
Georges-Antoine Assi
770b8f94ac feat: add Pegasus Frontend metadata export support
Add metadata.pegasus.txt export alongside the existing gamelist.xml
export. Restructure the export system: rename the gamelist endpoint to
a general-purpose export endpoint (`/api/export/`) with sub-routes for
each format (`/gamelist-xml`, `/pegasus`). Move config from flat
`scan.export_gamelist` to nested `scan.export.gamelist_xml` and
`scan.export.pegasus` for auto-export on scan.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 16:09:20 -04:00
Georges-Antoine Assi
c61f52ebed clean create web device 2026-03-15 20:25:38 -04:00
Georges-Antoine Assi
e1b07cacfc make devices actually unique 2026-03-15 20:09:33 -04:00
Georges-Antoine Assi
29112b4ddc create device on login web 2026-03-15 11:25:39 -04:00
Georges-Antoine Assi
55ca39cacb fix deprecations in pydantic 2026-03-15 09:34:48 -04:00
nendo
ea5b7546aa refactor: address PR #3114 review feedback
- Use atomic getdel for pairing code exchange
- Add cascade="all, delete-orphan" to User.client_tokens
- Move generate/hash_client_token into AuthHandler as static methods
- Extract endpoint helpers to utils/client_tokens.py
2026-03-11 10:56:35 +09:00
Georges-Antoine Assi
478b7b970a run fmt 2026-03-10 16:53:36 -04:00
Jamie Bond
1e6f0d6000 Add property for path_video and refactor places which use similar logic to access video paths 2026-03-10 20:32:54 +01:00
Georges-Antoine Assi
fcf015ea31 remove config option and always use if it exists 2026-03-08 11:05:08 -04:00