Skip to content

Commit

Permalink
Merge pull request #7798 from NBKelly/dont-overwrite-flip-images
Browse files Browse the repository at this point in the history
dont overwrite flips
  • Loading branch information
NoahTheDuke authored Oct 10, 2024
2 parents a7e9f17 + cbe5c0b commit 24d84bc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/clj/tasks/images.clj
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
(mc/update db card-collection {:code code} {$set {k path}})
(mc/update db card-collection {:previous-versions {$elemMatch {:code code}}} {$set {prev-k path}})))

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

(defn- add-card-image
"Add an image to a card in the db"
([db base-path lang resolution f] (add-card-image db base-path lang resolution :stock f))
Expand All @@ -69,8 +71,9 @@
prev-k-root (if (= :stock art-set) code (name art-set))
prev-k (str/join "." ["images" (name lang) (name resolution) prev-k-root])
path (str/join "/" [base-path (name lang) (name resolution) (name art-set) filename])]
(mc/update db card-collection {:code code} {$set {k path}})
(mc/update db card-collection {:previous-versions {$elemMatch {:code code}}} {$set {prev-k path}}))))))
(when-not (some #(= % code) cards-to-skip)
(mc/update db card-collection {:code code} {$set {k path}})
(mc/update db card-collection {:previous-versions {$elemMatch {:code code}}} {$set {prev-k path}})))))))

(defn- add-alt-images
"All all images in the specified alt directory"
Expand Down

0 comments on commit 24d84bc

Please sign in to comment.