function pageThumb(id, size, lastMod) {
  size = size || 320
  let thumb = `/thumbs/v2/page/${size}/${id}.png`
  if(lastMod) {
    if (lastMod) thumb = `${thumb}?t=` + lastMod.getTime();
  }
  return thumb;
}

function workThumb(id, size, lastMod) {
  size = size || 320
  let thumb = `/thumbs/v2/work/${size}/${id}.png`
  if (lastMod) thumb = `${thumb}?t=` + lastMod.getTime();
  return thumb;
}

function specialThumb(id, size, version) {
  size = size || 320
  let thumb = `/thumbs/v2/special/${size}/${id}.png`
  if (version) thumb = `${thumb}?v=` + version;
  return thumb;
}

function specialOutlineThumb(id, size, version) {
  size = size || 320
  let thumb = `/thumbs/v2/special_outline/${size}/${id}.png`
  if (version) thumb = `${thumb}?v=` + version;
  return thumb;
}

function zipPath(workId) {
  return  `/zips/v2/number/1500/${workId}.zip`
}

module.exports = {
  pageThumb,
  workThumb,
  specialThumb, 
  specialOutlineThumb,
  zipPath,
}
