رفع الملفات إلى "src"
Signed-off-by: Mohamed-Abdelhalim2 <codepen.io.dropper985@passinbox.com>
هذا الالتزام موجود في:
88
src/types.ts
Normal file
88
src/types.ts
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
export interface Channel {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
description: string;
|
||||||
|
gradient: string;
|
||||||
|
emoji: string;
|
||||||
|
categories: string[];
|
||||||
|
subscriberCount: number;
|
||||||
|
videoCount: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Playlist {
|
||||||
|
id: string;
|
||||||
|
channelId: string;
|
||||||
|
title: string;
|
||||||
|
description: string;
|
||||||
|
videoCount: number;
|
||||||
|
gradient: string;
|
||||||
|
emoji: string;
|
||||||
|
categories: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Video {
|
||||||
|
id: string;
|
||||||
|
playlistId: string;
|
||||||
|
channelId: string;
|
||||||
|
title: string;
|
||||||
|
description: string;
|
||||||
|
duration: string;
|
||||||
|
durationSeconds: number;
|
||||||
|
viewCount: number;
|
||||||
|
publishedAt: string;
|
||||||
|
position: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Folder {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
color: string;
|
||||||
|
emoji: string;
|
||||||
|
channelIds: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UserProgress {
|
||||||
|
watchedVideos: string[];
|
||||||
|
playlistProgress: Record<string, number>;
|
||||||
|
completedPlaylists: string[];
|
||||||
|
streak: number;
|
||||||
|
lastWatchDate: string;
|
||||||
|
totalWatched: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ViewType =
|
||||||
|
| { type: 'dashboard' }
|
||||||
|
| { type: 'channel'; channelId: string }
|
||||||
|
| { type: 'playlist'; playlistId: string }
|
||||||
|
| { type: 'browser' }
|
||||||
|
| { type: 'folder'; folderId: string }
|
||||||
|
| { type: 'video'; videoId: string; playlistId?: string };
|
||||||
|
|
||||||
|
export const CONTENT_FILTER = {
|
||||||
|
blockedKeywords: [
|
||||||
|
'sex', 'porn', 'nude', 'xxx', 'adult', 'erotic', 'nsfw',
|
||||||
|
'مخلة', 'جنس', 'إباحي', 'عارية', 'عري', 'خمر', 'مخدرات',
|
||||||
|
'قمار', 'رذيلة', 'فاحش', 'عاهرة', 'لواط', 'سحاق',
|
||||||
|
'elusive', 'twilight', 'vampire'
|
||||||
|
],
|
||||||
|
allowedCategories: [
|
||||||
|
'تعليم', 'تقنية', 'برمجة', 'علوم', 'دين', 'إسلام', 'تاريخ',
|
||||||
|
'اختراعات', 'تصميم', 'مشاريع', 'ريادة', 'أعمال', 'شريعة',
|
||||||
|
'لغة عربية', 'ثقافة', 'سياسة', 'حروب', 'فقه', 'عقيدة',
|
||||||
|
'تفسير', 'حديث', 'سيرة', 'قرآن', 'ذكاء اصطناعي', 'هندسة',
|
||||||
|
'عمارة', 'فيزياء', 'كيمياء', 'رياضيات', 'طب', 'فلك',
|
||||||
|
'ابتكار', 'شعر', 'نثر', 'أناشيد', 'أدب', 'بلاغة', 'نحو',
|
||||||
|
'صرف', 'حضارة', 'تراث', 'فن إسلامي', 'خط عربي',
|
||||||
|
'روبوتات', 'إلكترونيات', 'طاقة', 'بيئة', 'زراعة',
|
||||||
|
'إدارة', 'تسويق', 'اقتصاد', 'محاسبة', 'قانون',
|
||||||
|
'عسكرية', 'استراتيجية', 'جغرافيا', 'آثار'
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
export function isContentAllowed(title: string, _categories: string[]): boolean {
|
||||||
|
const lowerTitle = title.toLowerCase();
|
||||||
|
for (const keyword of CONTENT_FILTER.blockedKeywords) {
|
||||||
|
if (lowerTitle.includes(keyword.toLowerCase())) return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
المرجع في مشكلة جديدة
حظر مستخدم