 root =
   path: '/'
   title: 'Anikin kuva-arkisto'
-  thumbnail: PLACEHOLDER_IMAGE
   breadcrumb: []
   subalbums: []
   pictures: []

  ]).then ->
    convertSubcategories(0, root, 0)
  .then ->
    saveAlbum root
  .then(createIndexes)


      edegalAlbum =
        path: path.join(parent.path, slug)
        breadcrumb: breadcrumb
        title: coppermineAlbum.title
        description: coppermineAlbum.description
        subalbums: []
        pictures: []

      convertPictures(coppermineAlbum.aid, edegalAlbum, indent + 1).then ->
        setThumbnail edegalAlbum
        parent.subalbums.push _.pick edegalAlbum, 'path', 'title', 'thumbnail'
        saveAlbum edegalAlbum

convertPictures = (albumId, parent, indent=0) ->
  query('SELECT pid, filename, filepath, title, caption FROM cpg11d_pictures WHERE aid = ? ORDER BY position', [albumId]).spread (pictures) ->
