jaynesmax commited on
Commit
a512ec9
Β·
verified Β·
1 Parent(s): 1e5e370

Upload index.html

Browse files
Files changed (1) hide show
  1. index.html +13 -0
index.html CHANGED
@@ -1500,6 +1500,14 @@ function loadTrModel() {
1500
  return trModelP;
1501
  }
1502
  // Rails za mlalo: Trending Now (Top 10, kwa model au mpya zaidi) -> New Releases -> kila DJ (DJ Mack kwanza) -> Series -> More to Watch
 
 
 
 
 
 
 
 
1503
  function buildTranslatedSections(items, model) {
1504
  const pop = (model && model.popularity) || {}, sections = [], covered = new Set();
1505
  const hot = items.filter(it => pop[it.id] > 0).sort((a, b) => pop[b.id] - pop[a.id]);
@@ -3755,6 +3763,11 @@ async function loadLive() {
3755
 
3756
  // ── ZILIZOTAFSIRIWA (movies/series za DJ β€” mradi tofauti) ──
3757
  async function fetchTranslatedList() { // movie-translated-all: orodha moja iliyounganishwa
 
 
 
 
 
3758
  const r = await fetch(TRANSLATED_ALL, { headers: { apikey: SUPABASE_ANON_KEY } });
3759
  if (!r.ok) throw new Error(T('err_generic') + ' ' + r.status);
3760
  const d = await r.json();
 
1500
  return trModelP;
1501
  }
1502
  // Rails za mlalo: Trending Now (Top 10, kwa model au mpya zaidi) -> New Releases -> kila DJ (DJ Mack kwanza) -> Series -> More to Watch
1503
+ const TR_DJ_NOISE = /\b(movies?|filamu|zote|zilizotafsiriwa|zilizotafsiri|imetafsiriwa|iliyotafsiriwa|tafsiriwa|kiswahili|swahili|kwa|mpya|kali|translated|new|all|series|full)\b/gi;
1504
+
1505
+ function normDj(raw) { // jina safi la DJ (bila maneno ya ziada na bila tofauti za herufi kubwa/ndogo)
1506
+ const s = String(raw || '').replace(/\(.*?\)|\[.*?\]/g, ' ').replace(TR_DJ_NOISE, ' ').replace(/[|_\-\u2013\u2014:,.]+/g, ' ').replace(/\s+/g, ' ').trim();
1507
+ if (!s || /^dj$/i.test(s)) return '';
1508
+ return s.split(' ').map(w => /^dj$/i.test(w) ? 'DJ' : w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join(' ');
1509
+ }
1510
+
1511
  function buildTranslatedSections(items, model) {
1512
  const pop = (model && model.popularity) || {}, sections = [], covered = new Set();
1513
  const hot = items.filter(it => pop[it.id] > 0).sort((a, b) => pop[b.id] - pop[a.id]);
 
3763
 
3764
  // ── ZILIZOTAFSIRIWA (movies/series za DJ β€” mradi tofauti) ──
3765
  async function fetchTranslatedList() { // movie-translated-all: orodha moja iliyounganishwa
3766
+ const card = (m, idPrefix) => ({
3767
+ id: idPrefix + m.id, kind: 'translated', title: m.title,
3768
+ poster: m.thumb_url || m.poster_url || null, imgFallbackOn: true,
3769
+ subtitle: normDj(m.dj) || (m.category === 'series' ? 'Series' : 'Movie'), isSeries: m.category === 'series',
3770
+ });
3771
  const r = await fetch(TRANSLATED_ALL, { headers: { apikey: SUPABASE_ANON_KEY } });
3772
  if (!r.ok) throw new Error(T('err_generic') + ' ' + r.status);
3773
  const d = await r.json();