forked from DebaucheryLibrarian/traxxx
Fixed off-by-one in photo plucker. Fixed source duplicate photo function not handling fallback sources.
This commit is contained in:
@@ -18,13 +18,13 @@ function scrapePhotos(html) {
|
||||
const $ = cheerio.load(html, { normalizeWhitespace: true });
|
||||
|
||||
const photos = $('.photo_gallery_thumbnail_wrapper .thumbs')
|
||||
.map((photoIndex, photoElement) => {
|
||||
.toArray()
|
||||
.map((photoElement) => {
|
||||
const src = $(photoElement).attr('src');
|
||||
|
||||
// high res often available in photos/ directory, but not always, provide original as fallback
|
||||
return [src.replace('thumbs/', 'photos/'), src];
|
||||
})
|
||||
.toArray();
|
||||
});
|
||||
|
||||
return photos;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user