more fuckingfixes
Some checks are pending
CI Pipeline / Run Tests (push) Waiting to run
CI Pipeline / Lint Code (push) Waiting to run
CI Pipeline / Security Scan (push) Waiting to run
CI Pipeline / E2E Tests (push) Blocked by required conditions

This commit is contained in:
Enki 2025-08-28 11:02:53 -07:00
parent aa5190c27b
commit 74839c86bf
2 changed files with 5 additions and 3 deletions

View File

@ -35,6 +35,7 @@ type FileMetadata struct {
StorageType string StorageType string
OwnerPubkey string OwnerPubkey string
AccessLevel string AccessLevel string
InfoHash string
CreatedAt time.Time CreatedAt time.Time
AccessCount int64 AccessCount int64
LastAccess time.Time LastAccess time.Time
@ -730,7 +731,8 @@ func (b *Backend) GetPublicFiles() ([]*FileMetadata, error) {
rows, err := b.db.Query(` rows, err := b.db.Query(`
SELECT hash, original_name, size, chunk_count, content_type, SELECT hash, original_name, size, chunk_count, content_type,
COALESCE(storage_type, 'torrent'), COALESCE(owner_pubkey, ''), COALESCE(storage_type, 'torrent'), COALESCE(owner_pubkey, ''),
COALESCE(access_level, 'public'), created_at, access_count, last_access COALESCE(access_level, 'public'), COALESCE(info_hash, ''),
created_at, access_count, last_access
FROM files FROM files
WHERE access_level = 'public' WHERE access_level = 'public'
ORDER BY created_at DESC ORDER BY created_at DESC
@ -746,8 +748,8 @@ func (b *Backend) GetPublicFiles() ([]*FileMetadata, error) {
err := rows.Scan( err := rows.Scan(
&metadata.Hash, &metadata.OriginalName, &metadata.Size, &metadata.Hash, &metadata.OriginalName, &metadata.Size,
&metadata.ChunkCount, &metadata.ContentType, &metadata.StorageType, &metadata.ChunkCount, &metadata.ContentType, &metadata.StorageType,
&metadata.OwnerPubkey, &metadata.AccessLevel, &metadata.CreatedAt, &metadata.OwnerPubkey, &metadata.AccessLevel, &metadata.InfoHash,
&metadata.AccessCount, &metadata.LastAccess, &metadata.CreatedAt, &metadata.AccessCount, &metadata.LastAccess,
) )
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to scan file metadata: %w", err) return nil, fmt.Errorf("failed to scan file metadata: %w", err)

BIN
torrent-gateway Executable file

Binary file not shown.