(id, fetchFunction)
| 28 | console.log(`تصویر برای شناسه ${id} در کش ذخیره شد`); |
| 29 | } else { |
| 30 | console.log(`تصویر پیشفرض ${defaultPoster} کش نشد`); |
| 31 | } |
| 32 | return poster; |
| 33 | }); |
| 34 | } |
| 35 | |
| 36 | let apiKeySwitcher; |
| 37 | |
| 38 | async function initializeSwitcher() { |
| 39 | apiKeySwitcher = await loadApiKeys(); |
| 40 | console.log('سوئیچر کلید API مقداردهی شد'); |
| 41 | } |
| 42 | |
| 43 | // توابع مدیریت نوار پیشرفت |
| 44 | function startLoadingBar() { |
| 45 | const loadingBar = document.getElementById('loading-bar'); |
| 46 | if (loadingBar) { |
| 47 | loadingBar.style.width = '0'; |