File tree 1 file changed +15
-5
lines changed
1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 5
5
"encoding/json"
6
6
"github.com/manasky/cryptomeme/database"
7
7
"github.com/manasky/cryptomeme/meme"
8
+ "github.com/manasky/cryptomeme/common"
8
9
"log"
9
10
"net/http"
10
11
"strconv"
@@ -67,15 +68,24 @@ func (s *Server) Markets(w http.ResponseWriter, r *http.Request) {
67
68
market .MemeCaption = c
68
69
}
69
70
71
+ market .MemeContent = []* common.Content {}
70
72
if len (m .Content ) > 0 {
71
- for i , c := range m .Content {
72
- if c .Text != "" {
73
- if txt , err := meme .ParseCaption (c .Text , market ); err == nil {
74
- m .Content [i ].Text = txt
73
+ var memeContent []* common.Content
74
+ for _ , c := range m .Content {
75
+ tmp := & common.Content {
76
+ Text : c .Text ,
77
+ Image : c .Image ,
78
+ X : c .X ,
79
+ Y : c .Y ,
80
+ }
81
+ if tmp .Text != "" {
82
+ if txt , err := meme .ParseCaption (tmp .Text , market ); err == nil {
83
+ tmp .Text = txt
75
84
}
76
85
}
86
+ memeContent = append (memeContent , tmp )
77
87
}
78
- market .MemeContent = m . Content
88
+ market .MemeContent = memeContent
79
89
}
80
90
}
81
91
}
You can’t perform that action at this time.
0 commit comments