Skip to content

Commit 2237e76

Browse files
authored
Merge pull request #8231 from NBKelly/flip-card-browser-flip-arts
fix cardbrowser flip arts
2 parents fd57275 + 328bb74 commit 2237e76

File tree

5 files changed

+37
-8
lines changed

5 files changed

+37
-8
lines changed

resources/public/i18n/en.ftl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,27 @@ set_name = {$name ->
12401240
[world-champion-2015] World Champion 2015
12411241
[world-champion-2016] World Champion 2016
12421242
[world-champion-2017] World Champion 2017
1243+
[nin419-alt-arts] nin419 Alt Arts
1244+
[ams-alt-arts] Ams Alt Arts
1245+
[adam-s-doyle-alt-arts] Adam S. Doyle Alt Arts
1246+
[brindelmold-alt-arts] Brindelmold Alt Arts
1247+
[ezbior-alt-arts] Ezbior Alt Arts
1248+
[kalypso-alt-arts] Kalypso Alt Arts
1249+
[elessarellie-alt-arts] ElessarEllie Alt Arts
1250+
[mr-alt-arts] M.R. Alt Arts
1251+
[maysleyline-alt-arts] mays.leyline Alt Arts
1252+
[nicky-cheng-alt-arts] Nicky Cheng Alt Arts
1253+
[scott-uminga-alt-arts] Scott Uminga Alt Arts
1254+
[the-tag-mill-alt-arts] The Tag Mill Alt Arts
1255+
[valenetrunner-alt-arts] ValeNetrunner Alt Arts
1256+
[igor-lebedev-alt-arts] Igor Lebedev Alt Arts
1257+
[gnk-2013] 2013 FFG GNK
1258+
[gnk-2014] 2014 FFG GNK
1259+
[gnk-2015] 2015 FFG GNK
1260+
[gnk-2016] 2016 FFG GNK
1261+
[gnk-2017] 2017 FFG GNK
1262+
[nsg-2024-prizing] 2024 NSG Prizing
1263+
[nsg-2025-prizing] 2025 NSG Prizing
12431264
*[unknown] Unknown Set {$name}
12441265
}
12451266

src/clj/tasks/images.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
prev-k-root (if (= :stock art-set) code (name art-set))
6060
prev-k (str/join "." ["faces" face "images" (name lang) (name resolution) prev-k-root])
6161
path (str/join "/" [base-path (name lang) (name resolution) (name art-set) filename])]
62-
(mc/update db card-collection {:code code} {$set {k path}})
62+
(mc/update db card-collection {:code code} {$addToSet {k path}})
6363
(mc/update db card-collection {:previous-versions {$elemMatch {:code code}}} {$set {prev-k path}})))
6464

6565
(def ^:const cards-to-skip #{"08012" "09001" "26066" "26120" "35023" "35057"})

src/clj/tasks/update_alt_arts.clj

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
(recur (.read in-stream buffer))))))
3333
(format "%040x" (BigInteger. 1 (.digest digest)))))
3434

35-
(defn list-content [token key lang high]
35+
(defn list-content [token key lang high verbose]
3636
(let [url (str "https://api.github.com/repos/"
3737
owner "/" repo "/contents/images/"
3838
lang "/"
@@ -43,7 +43,8 @@
4343
{:keys [status body error]} @(http/get url {:headers headers})]
4444
(if (= 200 status)
4545
(json/read-str body :key-fn keyword)
46-
(println "Error fetching files for url:" url "\n -- " status body))))
46+
(if (or verbose (not high))
47+
(println "Error fetching files for url:" url "\n -- " status body)))))
4748

4849
(defn write-to-file
4950
[filename data]
@@ -87,18 +88,18 @@
8788

8889
(defn- get-promo-paths
8990
[]
90-
(->> "data/promos.edn" slurp edn/read-string (mapv :version)))
91+
(->> "data/promos.edn" slurp edn/read-string (mapv :version) (filterv #(not= % "prev"))))
9192

9293
(defn update-promos
93-
[{:keys [token lang force]}]
94+
[{:keys [token lang force verbose]}]
9495
(println "updating promo cards...")
9596
(let [token (str/trim (slurp token))]
9697
(if (download-github-file token "promos.edn" "data/promos.edn")
9798
(doseq [path (get-promo-paths)]
9899
;; get standard res images
99-
(when-let [content (list-content token path lang nil)]
100+
(when-let [content (list-content token path lang nil verbose)]
100101
(cp/pmap 3 #(fetch-image token path lang nil % force) content))
101-
(when-let [content (list-content token path lang :high-res)]
102+
(when-let [content (list-content token path lang :high-res verbose)]
102103
(cp/pmap 3 #(fetch-image token path lang :high-res % force) content)))
103104
(println "Unable to read promo data from remote source - is your key accurate?"))))
104105

@@ -117,6 +118,8 @@
117118
["-l" "--language LANG" "Which language fragment to check/update. Default is 'en'"
118119
:id :lang
119120
:default "en"]
121+
["-v " "--verbose" "Nags you for every path it can't find (ie, high-res images dont exist)"
122+
:id :verbose]
120123
["-t" "--token PATH" "Path to fetch token from"
121124
:id :token
122125
:validate [#(.exists (io/file %))

src/cljs/nr/cardbrowser.cljs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@
591591
^{:key n}
592592
[:option {:value n :key n}
593593
(if indent
594-
(str "* " (tr-set n))
594+
(str " " (tr-set n))
595595
(tr-set n))]))]]
596596
[simple-filter-builder (tr [:card-browser-form_side "Side"])
597597
state :side-filter ["Corp" "Runner"] tr-side]
@@ -620,11 +620,14 @@
620620
alts (:alt-info @app-state)
621621
info (first (filter #(= (:version %) art) alts))
622622
blurb (:artist-blurb info)
623+
about (:artist-about info)
623624
link (:artist-link info)]
624625
(when blurb
625626
[:div.panel.green-shade.artist-blurb
626627
[:h4 (tr [:card-browser_artist-info "Artist Info"])]
627628
[:div blurb]
629+
(when (and about (not= about blurb))
630+
[:div about])
628631
(when link
629632
[:a {:href link} (tr [:card-browser_more-info "More Info"])])])))))
630633

src/cljs/nr/translations.cljs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
(-> (or s "")
2020
(str/replace " " "-")
2121
(str/replace "&" "-")
22+
(str/replace "'" "-")
23+
(str/replace "." "")
2224
(str/lower-case)))
2325

2426
(defn tr-fix-server-name

0 commit comments

Comments
 (0)