sync: add AI review pipeline, parallel skill-files fetch, Redis cache improvements
- feat(review): add skill_reviews table, review API endpoints (pending/submit/stats), admin auth - perf: parallel file fetching in skill-files API (was sequential → timeout) - fix: handle Date serialization from Redis cache - fix: align curation batch scripts with current browseReadyFilter Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -20,10 +20,11 @@ interface NewSkillsPageProps {
|
||||
}
|
||||
|
||||
// Format date to "X hours/days ago" with locale support
|
||||
function formatTimeAgo(date: Date | null, locale: string): string {
|
||||
function formatTimeAgo(date: Date | string | null, locale: string): string {
|
||||
if (!date) return locale === 'fa' ? 'اخیراً' : 'Recently';
|
||||
const d = date instanceof Date ? date : new Date(date);
|
||||
const now = new Date();
|
||||
const diffMs = now.getTime() - date.getTime();
|
||||
const diffMs = now.getTime() - d.getTime();
|
||||
const diffHours = Math.floor(diffMs / (1000 * 60 * 60));
|
||||
const diffDays = Math.floor(diffHours / 24);
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ export default async function SkillPage({ params }: SkillPageProps) {
|
||||
securityStatus: dbSkill.securityStatus || 'pass',
|
||||
isVerified: dbSkill.isVerified || false,
|
||||
createdAt: dbSkill.createdAt,
|
||||
updatedAt: dbSkill.updatedAt ? dbSkill.updatedAt.toLocaleDateString(locale === 'fa' ? 'fa-IR' : 'en-US') : 'N/A',
|
||||
updatedAt: dbSkill.updatedAt ? new Date(dbSkill.updatedAt).toLocaleDateString(locale === 'fa' ? 'fa-IR' : 'en-US') : 'N/A',
|
||||
rating: dbSkill.rating || 0,
|
||||
ratingCount: dbSkill.ratingCount || 0,
|
||||
sourceFormat: dbSkill.sourceFormat || 'skill.md',
|
||||
|
||||
Reference in New Issue
Block a user