Skip to content

Commit

Permalink
Remove seenFiles and extractFileName from filteredItems
Browse files Browse the repository at this point in the history
  • Loading branch information
Arasteh authored Dec 30, 2024
1 parent e381d0d commit 7b675f3
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -342,24 +342,6 @@

const filteredItems = computed(() => {
let results = items.value;

// حذف موارد تکراری براساس نام فایل
const extractFileName = url => {
if (!url) return null;
const decodedUrl = decodeURIComponent(url);
const match = decodedUrl.match(/([^/]+)$/); // آخرین بخش از URL را جدا می‌کند
return match ? match[1] : null;
};

const seenFiles = new Set();
results = results.filter(item => {
const fileKey = posterMode.value ? extractFileName(item.poster) : extractFileName(item.logo);
if (fileKey && !seenFiles.has(fileKey)) {
seenFiles.add(fileKey);
return true; // اولین بار دیده شده، نگهش می‌داریم
}
return false; // قبلاً دیده شده، حذف می‌کنیم
});

// فیلتر براساس متن جستجو
if (searchTerm.value.length) {
Expand Down

0 comments on commit 7b675f3

Please sign in to comment.