mirror of
https://github.com/qwertyforce/scenery.git
synced 2025-05-31 11:42:35 +00:00
fixes
This commit is contained in:
parent
82c396f509
commit
a7c1ebdfea
@ -86,7 +86,7 @@ export async function getStaticProps(context: any) {
|
||||
if (context.params.page) {
|
||||
const images = (await db_ops.image_ops.get_all_images()).reverse()
|
||||
const page = parseInt(context.params.page)
|
||||
if (page <= Math.ceil(images.length / images_on_page)) {
|
||||
if (page >= 1 && page <= Math.ceil(images.length / images_on_page)) {
|
||||
for (let i = (page - 1) * images_on_page; (i < (page) * images_on_page) && (i < images.length); i++) {
|
||||
photos.push({
|
||||
src: `/webp_images/${images[i].id}.webp`,
|
||||
|
@ -60,7 +60,7 @@ export async function getServerSideProps(context: any) {
|
||||
if (page <= Math.ceil(images.length / images_on_page)) {
|
||||
for (let i = (page - 1) * images_on_page; (i < (page) * images_on_page) && (i < images.length); i++) {
|
||||
photos.push({
|
||||
src: `/images/${images[i].id}.${images[i].file_ext}`,
|
||||
src: `/webp_images/${images[i].id}.webp`,
|
||||
key: `/image/${images[i].id}`,
|
||||
width: images[i].width,
|
||||
height: images[i].height
|
||||
|
@ -86,7 +86,7 @@ export async function getStaticProps(context: any) {
|
||||
if (context.params.page) {
|
||||
const images = (await db_ops.image_ops.get_all_images()).sort((a, b) => b.wilson_score - a.wilson_score)
|
||||
const page = parseInt(context.params.page)
|
||||
if (page <= Math.ceil(images.length / images_on_page)) {
|
||||
if (page >= 1 && page <= Math.ceil(images.length / images_on_page)) {
|
||||
for (let i = (page - 1) * images_on_page; (i < (page) * images_on_page) && (i < images.length); i++) {
|
||||
photos.push({
|
||||
src: `/webp_images/${images[i].id}.webp`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user