fix(uploads): serve private previews through API and show batch cover status
ci / mobile / mobile (Metro-бандл Android) (push) Successful in 1m30s
ci / ts / ts (packages + web) (push) Canceled after 4m13s
ci / module boundaries / boundaries (push) Successful in 8s
ci / api / api (push) Successful in 56s
ci / contract / contract (сгенерированный код совпадает с openapi.yaml) (push) Successful in 1m1s
ci / db / db (push) Successful in 1m7s
ci / mobile / mobile (Metro-бандл Android) (push) Successful in 1m30s
ci / ts / ts (packages + web) (push) Canceled after 4m13s
ci / module boundaries / boundaries (push) Successful in 8s
ci / api / api (push) Successful in 56s
ci / contract / contract (сгенерированный код совпадает с openapi.yaml) (push) Successful in 1m1s
ci / db / db (push) Successful in 1m7s
This commit is contained in:
1 parent
37e33c656b
commit
7d62531c02
15 files changed
+533
-410
No files matched your search
@@ -17,17 +17,18 @@ import (
|
||||
type Handler struct {
|
||||
svc *Service
|
||||
signer *sign.Signer
|
||||
xAccel bool
|
||||
}
|
||||
|
||||
// NewHandler создаёт обработчик. signer подписывает ссылки прослушивания из staging.
|
||||
func NewHandler(svc *Service, signer *sign.Signer, xAccel bool) *Handler {
|
||||
return &Handler{svc: svc, signer: signer, xAccel: xAccel}
|
||||
func NewHandler(svc *Service, signer *sign.Signer) *Handler {
|
||||
return &Handler{svc: svc, signer: signer}
|
||||
}
|
||||
|
||||
func (h *Handler) fileDTO(ctx context.Context, f File) gen.UploadFile {
|
||||
hasCover := f.CoverPath != nil && *f.CoverPath != ""
|
||||
out := gen.UploadFile{
|
||||
Id: f.ID, BatchId: f.BatchID, BatchComment: f.BatchComment,
|
||||
BatchHasCover: &hasCover,
|
||||
Id: f.ID, BatchId: f.BatchID, BatchComment: f.BatchComment,
|
||||
Author: gen.UserRef{Id: f.AuthorID, Username: f.AuthorName},
|
||||
Status: gen.UploadStatus(f.Status), OriginalName: f.OriginalName, ClientRelPath: f.ClientRelPath,
|
||||
SizeBytes: f.Size, ReceivedBytes: f.Received, Format: f.Format, Codec: f.Codec, Bitrate: f.Bitrate,
|
||||
|
||||
Reference in new issue
Block a user