Added hashes calculate and fix hashes problems

This commit is contained in:
2026-06-27 19:24:55 +02:00
parent 593479f41f
commit 43018e5aae
4 changed files with 46 additions and 2 deletions

View File

@@ -106,7 +106,9 @@ class StoreEntryRequest extends FormRequest
$rules['new-game-genre'] = 'required_with:new-game-title|integer|nullable|exists:genres,id';
}
if( section_must_be( ['translations', 'romhacks'], $section ) ){
$bypassHashes = $isEdit && $this->user()->can('moderate', $this->route('entry') ) && ($this->input('bypass_hashes') !== null);
if( section_must_be( ['translations', 'romhacks'], $section ) && !$bypassHashes ){
$rules['hashes'] = 'array|required|min:1';
$rules['hashes.*.filename'] = 'required|string|max:512';
$rules['hashes.*.hash_crc32'] = 'required|string|max:512';