feat: add dedicated podcast modal player, integrate video modal player in product page, and add media metadata management in admin
Deploy Canina / deploy (push) Successful in 1m50s
Deploy Canina / deploy (push) Successful in 1m50s
This commit is contained in:
1 parent
27a1517464
commit
f9dad098ef
8 files changed
+954
-138
No files matched your search
@@ -40,8 +40,17 @@ interface BackendProduct {
|
||||
image?: string;
|
||||
images?: string[];
|
||||
podcastUrl?: string;
|
||||
podcastTitle?: string;
|
||||
podcastDescription?: string;
|
||||
podcastCover?: string;
|
||||
videoUrl?: string;
|
||||
videoTitle?: string;
|
||||
videoDescription?: string;
|
||||
videoCover?: string;
|
||||
pdfUrl?: string;
|
||||
pdfTitle?: string;
|
||||
pdfDescription?: string;
|
||||
pdfCover?: string;
|
||||
productGroup?: string;
|
||||
ingredientList?: Array<{ ingredient: string }>;
|
||||
ingredients?: string;
|
||||
@@ -157,6 +166,16 @@ export class ProductService {
|
||||
if (data.podcastUrl.startsWith('/uploads/')) return `${apiBase}${data.podcastUrl}`;
|
||||
return data.podcastUrl;
|
||||
})(),
|
||||
podcastTitle: data.podcastTitle || undefined,
|
||||
podcastDescription: data.podcastDescription || undefined,
|
||||
podcastCover: (() => {
|
||||
const apiBase = (process.env.NEXT_PUBLIC_API_URL || '').replace(/\/api$/, '');
|
||||
if (!data.podcastCover) return undefined;
|
||||
if (data.podcastCover.startsWith('http://') || data.podcastCover.startsWith('https://')) return data.podcastCover;
|
||||
if (data.podcastCover.startsWith('/uploads/')) return `${apiBase}${data.podcastCover}`;
|
||||
return data.podcastCover;
|
||||
})(),
|
||||
|
||||
videoUrl: (() => {
|
||||
const apiBase = (process.env.NEXT_PUBLIC_API_URL || '').replace(/\/api$/, '');
|
||||
if (!data.videoUrl) return undefined;
|
||||
@@ -164,6 +183,16 @@ export class ProductService {
|
||||
if (data.videoUrl.startsWith('/uploads/')) return `${apiBase}${data.videoUrl}`;
|
||||
return data.videoUrl;
|
||||
})(),
|
||||
videoTitle: data.videoTitle || undefined,
|
||||
videoDescription: data.videoDescription || undefined,
|
||||
videoCover: (() => {
|
||||
const apiBase = (process.env.NEXT_PUBLIC_API_URL || '').replace(/\/api$/, '');
|
||||
if (!data.videoCover) return undefined;
|
||||
if (data.videoCover.startsWith('http://') || data.videoCover.startsWith('https://')) return data.videoCover;
|
||||
if (data.videoCover.startsWith('/uploads/')) return `${apiBase}${data.videoCover}`;
|
||||
return data.videoCover;
|
||||
})(),
|
||||
|
||||
pdfUrl: (() => {
|
||||
const apiBase = (process.env.NEXT_PUBLIC_API_URL || '').replace(/\/api$/, '');
|
||||
if (!data.pdfUrl) return undefined;
|
||||
@@ -171,6 +200,15 @@ export class ProductService {
|
||||
if (data.pdfUrl.startsWith('/uploads/')) return `${apiBase}${data.pdfUrl}`;
|
||||
return data.pdfUrl;
|
||||
})(),
|
||||
pdfTitle: data.pdfTitle || undefined,
|
||||
pdfDescription: data.pdfDescription || undefined,
|
||||
pdfCover: (() => {
|
||||
const apiBase = (process.env.NEXT_PUBLIC_API_URL || '').replace(/\/api$/, '');
|
||||
if (!data.pdfCover) return undefined;
|
||||
if (data.pdfCover.startsWith('http://') || data.pdfCover.startsWith('https://')) return data.pdfCover;
|
||||
if (data.pdfCover.startsWith('/uploads/')) return `${apiBase}${data.pdfCover}`;
|
||||
return data.pdfCover;
|
||||
})(),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user