more fuckingfixes
This commit is contained in:
parent
aa5190c27b
commit
74839c86bf
@ -35,6 +35,7 @@ type FileMetadata struct {
|
||||
StorageType string
|
||||
OwnerPubkey string
|
||||
AccessLevel string
|
||||
InfoHash string
|
||||
CreatedAt time.Time
|
||||
AccessCount int64
|
||||
LastAccess time.Time
|
||||
@ -730,7 +731,8 @@ func (b *Backend) GetPublicFiles() ([]*FileMetadata, error) {
|
||||
rows, err := b.db.Query(`
|
||||
SELECT hash, original_name, size, chunk_count, content_type,
|
||||
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
|
||||
WHERE access_level = 'public'
|
||||
ORDER BY created_at DESC
|
||||
@ -746,8 +748,8 @@ func (b *Backend) GetPublicFiles() ([]*FileMetadata, error) {
|
||||
err := rows.Scan(
|
||||
&metadata.Hash, &metadata.OriginalName, &metadata.Size,
|
||||
&metadata.ChunkCount, &metadata.ContentType, &metadata.StorageType,
|
||||
&metadata.OwnerPubkey, &metadata.AccessLevel, &metadata.CreatedAt,
|
||||
&metadata.AccessCount, &metadata.LastAccess,
|
||||
&metadata.OwnerPubkey, &metadata.AccessLevel, &metadata.InfoHash,
|
||||
&metadata.CreatedAt, &metadata.AccessCount, &metadata.LastAccess,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to scan file metadata: %w", err)
|
||||
|
BIN
torrent-gateway
Executable file
BIN
torrent-gateway
Executable file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user