Skip to content

Commit

Permalink
Bilder på typeinndeling (#510)
Browse files Browse the repository at this point in the history
* Bilder på typeinndeling

* Reservebilder også for kataloger uten data

Travis down
  • Loading branch information
bjornreppen authored Mar 28, 2019
1 parent 8f77d89 commit 4e36fe6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions steg/13/reservebilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,22 @@ io.skrivDatafil(__filename, script)

function finnReserverbilder() {
Object.keys(tre).forEach(xkode => {
if (xkode === "~") debugger
const node = tre[xkode]
const maps = mapfiles[node.url]
if (!maps) return
if (maps["forside_408.jpg"]) return // Already have an image
if (maps && maps["forside_408.jpg"]) return // Already have an image
const barn = barnAv[xkode]
if (!barn) return
barn.sort((a, b) => a > b)
for (let i = 0; i < barn.length; i++) {
const bn = tre[barn[i]]
const burl = bn.url
if (!mapfiles[burl]) continue
script.push(`cp -n ${burl}/forside_408.jpg ${node.url}/`)
const filer = mapfiles[burl]
if (!filer) continue
const bilde = filer["forside_408.png"] || filer["forside_408.jpg"]
if (!bilde) return
script.push(`cp -n ${burl}/${bilde.filename} ${node.url}/`)
log.warn(`cp -n ${burl}/${bilde.filename} ${node.url}/`)
break
}
})
Expand Down

0 comments on commit 4e36fe6

Please sign in to comment.