summaryrefslogtreecommitdiff
path: root/pngmeta
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-03-03 11:46:03 +0300
committerGrail Finder <wohilas@gmail.com>2026-03-03 11:46:03 +0300
commit0e5d37666f92bc75f12f118fc77a7e4af4a5924b (patch)
tree967b9de608288a3cfbd40aaf284b6bd7b640a4b9 /pngmeta
parent093103bdd7cd02e10f2339e7beeb71375fb16256 (diff)
Enha: id for card map
Diffstat (limited to 'pngmeta')
-rw-r--r--pngmeta/metareader.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pngmeta/metareader.go b/pngmeta/metareader.go
index 7053546..e1835f9 100644
--- a/pngmeta/metareader.go
+++ b/pngmeta/metareader.go
@@ -109,6 +109,12 @@ func ReadCardJson(fname string) (*models.CharCard, error) {
if err := json.Unmarshal(data, &card); err != nil {
return nil, err
}
+ if card.FilePath == "" {
+ card.FilePath = fname
+ }
+ if card.ID == "" {
+ card.ID = models.ComputeCardID(card.Role, card.FilePath)
+ }
return &card, nil
}