refactor: rename project from wedding-photo-sharing to PicPeak
- Update Docker image names and network configurations - Rename package.json project names to picpeak-backend/frontend - Update CI/CD configurations (Drone CI and GitHub Actions) - Update documentation and setup scripts - Update application branding in source code - Change default database name to picpeak - Update PM2 ecosystem config 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { Photo } from '../types';
|
||||
|
||||
interface PhotoUrlOptions {
|
||||
slug: string;
|
||||
photo: Photo;
|
||||
watermarkEnabled?: boolean;
|
||||
token?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the appropriate URL for a photo, using watermarked endpoint if enabled
|
||||
*/
|
||||
export function getPhotoUrl({ slug, photo, watermarkEnabled = false, token }: PhotoUrlOptions): string {
|
||||
if (watermarkEnabled && token) {
|
||||
// Use the watermarked photo endpoint
|
||||
return `/api/gallery/${slug}/photo/${photo.id}`;
|
||||
}
|
||||
|
||||
// Use the static photo URL
|
||||
return photo.url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the download URL for a photo
|
||||
*/
|
||||
export function getPhotoDownloadUrl(slug: string, photoId: number): string {
|
||||
return `/api/gallery/${slug}/download/${photoId}`;
|
||||
}
|
||||
Reference in New Issue
Block a user