Omit missing years from upload destination paths
ci / module boundaries / boundaries (push) Successful in 7s
ci / db / db (push) Successful in 2m33s
ci / api / api (push) Successful in 1m10s
ci / mobile / mobile (Metro-бандл Android) (push) Successful in 3m45s
ci / ts / ts (packages + web) (push) Successful in 6m29s

This commit is contained in:
mrleo1nid committed 2026-10-30 11:40:42 +03:00
1 parent 3309a79a98
commit db4548b115
10 files changed
+131 -5

No files matched your search

+5 -2
View File
@@ -38,7 +38,7 @@ type PlacementPlanner struct {
// --- Раскладка в хранилище ---
// placement — куда ляжет файл; Reason — почему не получится (код), путь тогда nil.
// placement — куда ляжет файл; Reason при ненулевом пути — предупреждение.
type placement struct {
SourceID *uuid.UUID
RelPath *string
@@ -147,7 +147,7 @@ func (s *PlacementPlanner) plan(ctx context.Context, f File, m Meta, chosen *uui
if m.Disc != nil {
discs = max(discs, *m.Disc)
}
rel, err := tpl.Render(meta.TemplateInput{Fields: m.Fields(), DiscCount: discs, Ext: extFor(f)})
rel, err := tpl.RenderWithoutMissingYear(meta.TemplateInput{Fields: m.Fields(), DiscCount: discs, Ext: extFor(f)})
if err != nil {
var mf *meta.MissingFieldError
if errors.As(err, &mf) {
@@ -164,5 +164,8 @@ func (s *PlacementPlanner) plan(ctx context.Context, f File, m Meta, chosen *uui
}
rel = reuseExisting(root, rel)
pl.RelPath, pl.root = &rel, root
if m.Year == nil || *m.Year <= 0 {
pl.Reason = CodeMissingYear
}
return pl
}