Club System
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Helpers\HashesHelpers;
|
||||
use App\Models\EntryHash;
|
||||
use App\Models\Game;
|
||||
use App\Models\Genre;
|
||||
@@ -50,12 +51,28 @@ class HashesUpload extends Component
|
||||
*/
|
||||
public function addHash(string $filename, string $crc32, string $sha1, ?string $verified = null): void
|
||||
{
|
||||
$this->hashes[] = [
|
||||
'filename' => $filename,
|
||||
'hash_crc32' => $crc32,
|
||||
'hash_sha1' => $sha1,
|
||||
'verified' => $verified ?? "No-Intro" // TODO: Change it.
|
||||
];
|
||||
|
||||
if( $verified !== null && $verified !== "No" )
|
||||
$this->hashes[] = [
|
||||
'filename' => $filename,
|
||||
'hash_crc32' => $crc32,
|
||||
'hash_sha1' => $sha1,
|
||||
'verified' => $verified
|
||||
];
|
||||
else if( ( $hash = HashesHelpers::findHashes( $sha1 ) ) !== null )
|
||||
$this->hashes[] = [
|
||||
'filename' => $hash->filename,
|
||||
'hash_crc32' => $hash->crc32,
|
||||
'hash_sha1' => $hash->sha1,
|
||||
'verified' => HashesHelpers::getReferenceName( $hash->dat_reference_id )
|
||||
];
|
||||
else
|
||||
$this->hashes[] = [
|
||||
'filename' => $filename,
|
||||
'hash_crc32' => $crc32,
|
||||
'hash_sha1' => $sha1,
|
||||
'verified' => "No"
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user