stremiok 2.3.4 → 2.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +1 -0
- package/config.xml +1 -1
- package/css/style.css +5 -0
- package/index.html +42 -40
- package/js/app.js +3 -3
- package/js/downloads.js +16 -16
- package/js/epg.js +2 -3
- package/js/hubpreview.js +1 -1
- package/js/i18n.js +108 -0
- package/js/iptv.js +13 -13
- package/js/jellyfin.js +19 -19
- package/js/lang/ar.js +1941 -0
- package/js/lang/de.js +1941 -0
- package/js/lang/es.js +1941 -0
- package/js/lang/fi.js +1941 -0
- package/js/lang/fr.js +1941 -0
- package/js/lang/he.js +1941 -0
- package/js/lang/hi.js +1941 -0
- package/js/lang/it.js +1941 -0
- package/js/lang/ja.js +1941 -0
- package/js/lang/ko.js +1941 -0
- package/js/lang/languages.js +21 -0
- package/js/lang/pl.js +1941 -0
- package/js/lang/pt-BR.js +1941 -0
- package/js/lang/ru.js +1941 -0
- package/js/lang/tr.js +1941 -0
- package/js/lang/zh-CN.js +1941 -0
- package/js/local.js +9 -9
- package/js/netfolders.js +13 -13
- package/js/player-audio.js +17 -17
- package/js/player-controls.js +100 -100
- package/js/player-core.js +59 -57
- package/js/player-lang.js +22 -22
- package/js/player-quality.js +15 -15
- package/js/player-store.js +13 -13
- package/js/player-subs.js +69 -69
- package/js/plex.js +11 -11
- package/js/stremio-account.js +8 -8
- package/js/stremio-sync.js +5 -5
- package/js/stremio.js +78 -76
- package/js/stvod.js +4 -4
- package/js/trakt.js +23 -23
- package/js/tvapps.js +4 -4
- package/js/util.js +38 -26
- package/js/view-core.js +93 -93
- package/js/view-detail.js +124 -126
- package/js/view-discover.js +27 -27
- package/js/view-guide.js +13 -13
- package/js/view-home.js +124 -118
- package/js/view-search.js +25 -25
- package/js/view-settings.js +658 -642
- package/js/xtvod.js +2 -2
- package/js/youtube.js +17 -17
- package/js/ytplay.js +11 -6
- package/package.json +1 -1
- package/tizenbrew.html +1 -1
package/js/view-core.js
CHANGED
|
@@ -36,8 +36,8 @@ var ViewParts = {};
|
|
|
36
36
|
var box = U.el('div', 'modal-box');
|
|
37
37
|
box.appendChild(U.el('div', 'modal-msg', message));
|
|
38
38
|
var row = U.el('div', 'modal-row');
|
|
39
|
-
var no = U.el('div', 'pill focusable modal-btn', opts.noLabel || 'Cancel');
|
|
40
|
-
var yes = U.el('div', 'pill focusable modal-btn' + (opts.plain ? '' : ' danger'), confirmLabel || 'Confirm');
|
|
39
|
+
var no = U.el('div', 'pill focusable modal-btn', opts.noLabel || U.t('Cancel'));
|
|
40
|
+
var yes = U.el('div', 'pill focusable modal-btn' + (opts.plain ? '' : ' danger'), confirmLabel || U.t('Confirm'));
|
|
41
41
|
no.__onselect = function () { closeModal(); if (opts.onNo) { opts.onNo(); } };
|
|
42
42
|
yes.__onselect = function () { closeModal(); onYes(); };
|
|
43
43
|
row.appendChild(no);
|
|
@@ -67,7 +67,7 @@ var ViewParts = {};
|
|
|
67
67
|
box.appendChild(qrSpot(text));
|
|
68
68
|
box.appendChild(U.el('div', 'qr-link', U.redactUrl ? U.redactUrl(text) : text));
|
|
69
69
|
(lines || []).forEach(function (l) { box.appendChild(U.el('div', 'qr-note', l)); });
|
|
70
|
-
var row = U.el('div', 'modal-row'), done = U.el('div', 'pill focusable modal-btn', 'Done');
|
|
70
|
+
var row = U.el('div', 'modal-row'), done = U.el('div', 'pill focusable modal-btn', U.t('Done'));
|
|
71
71
|
done.__onselect = function () { closeModal(); };
|
|
72
72
|
row.appendChild(done);
|
|
73
73
|
box.appendChild(row);
|
|
@@ -86,10 +86,10 @@ var ViewParts = {};
|
|
|
86
86
|
if (existing) { existing.parentNode.removeChild(existing); }
|
|
87
87
|
var overlay = U.el('div', 'modal-overlay'), box = U.el('div', 'modal-box qr-box');
|
|
88
88
|
box.appendChild(U.el('div', 'modal-msg', o.title));
|
|
89
|
-
var spot = U.el('div', 'qr-spot'), how = U.el('div', 'qr-note', 'Opening the page for your phone…'), link = U.el('div', 'qr-link', '');
|
|
89
|
+
var spot = U.el('div', 'qr-spot'), how = U.el('div', 'qr-note', U.t('Opening the page for your phone…')), link = U.el('div', 'qr-link', '');
|
|
90
90
|
box.appendChild(spot); box.appendChild(link); box.appendChild(how);
|
|
91
91
|
var row = U.el('div', 'modal-row');
|
|
92
|
-
var cancel = U.el('div', 'pill focusable modal-btn', 'Cancel'), type = U.el('div', 'pill focusable modal-btn', 'Type it');
|
|
92
|
+
var cancel = U.el('div', 'pill focusable modal-btn', U.t('Cancel')), type = U.el('div', 'pill focusable modal-btn', U.t('Type it'));
|
|
93
93
|
var token = null, timer = null, over = false;
|
|
94
94
|
function stop() {
|
|
95
95
|
over = true;
|
|
@@ -126,18 +126,18 @@ var ViewParts = {};
|
|
|
126
126
|
var bad = o.validate ? o.validate(text) : null;
|
|
127
127
|
if (bad) { U.toast(bad, 5000); return; }
|
|
128
128
|
o.onText(text);
|
|
129
|
-
}, function () { if (!over) { how.textContent = 'The phone page closed. Type it instead, or try again.'; token = null; } });
|
|
129
|
+
}, function () { if (!over) { how.textContent = U.t('The phone page closed. Type it instead, or try again.'); token = null; } });
|
|
130
130
|
}, ENTRY_POLL_MS);
|
|
131
131
|
}
|
|
132
|
-
if (typeof YTPlay === 'undefined' || !YTPlay.entryOpen) { how.textContent = 'Type it with the TV’s keyboard.'; return; }
|
|
132
|
+
if (typeof YTPlay === 'undefined' || !YTPlay.entryOpen) { how.textContent = U.t('Type it with the TV’s keyboard.'); return; }
|
|
133
133
|
YTPlay.ensureService().then(function () { return YTPlay.entryOpen(o.what); }).then(function (r) {
|
|
134
134
|
if (over) { if (r && r.token) { YTPlay.entryClose(r.token); } return; }
|
|
135
135
|
token = r.token;
|
|
136
136
|
spot.appendChild(qrSpotCanvas(r.url));
|
|
137
137
|
link.textContent = r.url;
|
|
138
|
-
how.textContent = 'Scan it with your phone (on the same Wi-Fi as the TV), then type or paste it there. Only for the next 5 minutes, and once. It travels unencrypted over your home network: use it only on a network you trust.';
|
|
138
|
+
how.textContent = U.t('Scan it with your phone (on the same Wi-Fi as the TV), then type or paste it there. Only for the next 5 minutes, and once. It travels unencrypted over your home network: use it only on a network you trust.');
|
|
139
139
|
poll();
|
|
140
|
-
}, function () { if (!over) { how.textContent = 'Your phone can’t reach the TV just now (no home network, or StremioK’s service isn’t running): type it instead.'; } });
|
|
140
|
+
}, function () { if (!over) { how.textContent = U.t('Your phone can’t reach the TV just now (no home network, or StremioK’s service isn’t running): type it instead.'); } });
|
|
141
141
|
}
|
|
142
142
|
function qrSpotCanvas(text) { var s = qrSpot(text); s.className = ''; return s; }
|
|
143
143
|
// A file given to the phone (an export: YTPlay.entryGive): a QR to the service's one-time page
|
|
@@ -149,10 +149,10 @@ var ViewParts = {};
|
|
|
149
149
|
if (existing) { existing.parentNode.removeChild(existing); }
|
|
150
150
|
var overlay = U.el('div', 'modal-overlay'), box = U.el('div', 'modal-box qr-box');
|
|
151
151
|
box.appendChild(U.el('div', 'modal-msg', title));
|
|
152
|
-
var spot = U.el('div', 'qr-spot'), how = U.el('div', 'qr-note', 'Opening the page for your phone…'), link = U.el('div', 'qr-link', '');
|
|
152
|
+
var spot = U.el('div', 'qr-spot'), how = U.el('div', 'qr-note', U.t('Opening the page for your phone…')), link = U.el('div', 'qr-link', '');
|
|
153
153
|
box.appendChild(spot); box.appendChild(link); box.appendChild(how);
|
|
154
154
|
if (note) { box.appendChild(U.el('div', 'qr-note', note)); }
|
|
155
|
-
var row = U.el('div', 'modal-row'), done = U.el('div', 'pill focusable modal-btn', 'Done');
|
|
155
|
+
var row = U.el('div', 'modal-row'), done = U.el('div', 'pill focusable modal-btn', U.t('Done'));
|
|
156
156
|
var token = null, timer = null, over = false;
|
|
157
157
|
done.__onselect = function () { closeModal(); };
|
|
158
158
|
row.appendChild(done); box.appendChild(row); overlay.appendChild(box);
|
|
@@ -165,21 +165,21 @@ var ViewParts = {};
|
|
|
165
165
|
if (over || !token) { return; }
|
|
166
166
|
YTPlay.entrySeen(token).then(function (seen) {
|
|
167
167
|
if (over) { return; }
|
|
168
|
-
if (seen) { how.textContent = 'Your phone has it: copy or download it there, then Done.'; }
|
|
168
|
+
if (seen) { how.textContent = U.t('Your phone has it: copy or download it there, then Done.'); }
|
|
169
169
|
poll();
|
|
170
|
-
}, function () { if (!over) { how.textContent = 'The phone page closed. Export again to open another.'; token = null; } });
|
|
170
|
+
}, function () { if (!over) { how.textContent = U.t('The phone page closed. Export again to open another.'); token = null; } });
|
|
171
171
|
}, GIVE_POLL_MS);
|
|
172
172
|
}
|
|
173
|
-
if (typeof YTPlay === 'undefined' || !YTPlay.entryGive) { how.textContent = 'It needs StremioK’s service on the TV (not in a desktop browser).'; return; }
|
|
173
|
+
if (typeof YTPlay === 'undefined' || !YTPlay.entryGive) { how.textContent = U.t('It needs StremioK’s service on the TV (not in a desktop browser).'); return; }
|
|
174
174
|
YTPlay.entryGive(text).then(function (r) {
|
|
175
175
|
if (over) { if (r && r.token) { YTPlay.entryClose(r.token); } return; }
|
|
176
176
|
if (!r || !r.url) { throw new Error('no page'); }
|
|
177
177
|
token = r.token;
|
|
178
178
|
spot.appendChild(qrSpotCanvas(r.url));
|
|
179
179
|
link.textContent = r.url;
|
|
180
|
-
how.textContent = 'Scan it with your phone (on the same Wi-Fi as the TV): the page shows the file to copy or download. For the next 5 minutes, unencrypted over your home network: only on a network you trust.';
|
|
180
|
+
how.textContent = U.t('Scan it with your phone (on the same Wi-Fi as the TV): the page shows the file to copy or download. For the next 5 minutes, unencrypted over your home network: only on a network you trust.');
|
|
181
181
|
poll();
|
|
182
|
-
}, function () { if (!over) { how.textContent = 'Your phone can’t reach the TV just now (no home network, or StremioK’s service isn’t running).'; } });
|
|
182
|
+
}, function () { if (!over) { how.textContent = U.t('Your phone can’t reach the TV just now (no home network, or StremioK’s service isn’t running).'); } });
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
// Show `overlay` (already in the page) as the modal: focus moves into it, and
|
|
@@ -212,11 +212,11 @@ var ViewParts = {};
|
|
|
212
212
|
}
|
|
213
213
|
function addYouTubeCatalog(meta) {
|
|
214
214
|
var src = youTubeList(meta.id), name = meta.name || meta.title || src;
|
|
215
|
-
if (YouTube.catalogFor(src)) { U.toast('“
|
|
216
|
-
confirm('Add “
|
|
217
|
-
if (!YouTube.add({ src: src, name: name })) { U.toast('Couldn\'t add it (40 catalogs at most)'); return; }
|
|
215
|
+
if (YouTube.catalogFor(src)) { U.toast(U.t('“{name}” is already one of your YouTube catalogs', { name: name })); return; }
|
|
216
|
+
confirm(U.t('Add “{name}” to your YouTube catalogs? It becomes a row on Home and a catalog in Discover (Settings › Content › YouTube).', { name: name }), U.t('Add'), function () {
|
|
217
|
+
if (!YouTube.add({ src: src, name: name })) { U.toast(U.t('Couldn\'t add it (40 catalogs at most)')); return; }
|
|
218
218
|
refreshAddonRows('local:youtube');
|
|
219
|
-
U.toast('Added “
|
|
219
|
+
U.toast(U.t('Added “{name}” to your YouTube catalogs', { name: name }), 3000);
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
222
|
|
|
@@ -227,21 +227,21 @@ var ViewParts = {};
|
|
|
227
227
|
var overlay = U.el('div', 'modal-overlay');
|
|
228
228
|
var box = U.el('div', 'modal-box actions-box'); // (as wide as its buttons)
|
|
229
229
|
|
|
230
|
-
box.appendChild(U.el('div', 'modal-msg', 'Update “'
|
|
230
|
+
box.appendChild(U.el('div', 'modal-msg', U.t('Update “{name}”', { name: name })));
|
|
231
231
|
|
|
232
232
|
var row = U.el('div', 'modal-row');
|
|
233
233
|
|
|
234
|
-
var cancel = U.el('div', 'pill focusable modal-btn', 'Cancel');
|
|
235
|
-
var refresh = U.el('div', 'pill focusable modal-btn', 'Refresh');
|
|
236
|
-
var remove = U.el('div', 'pill focusable modal-btn danger', 'Remove');
|
|
234
|
+
var cancel = U.el('div', 'pill focusable modal-btn', U.t('Cancel'));
|
|
235
|
+
var refresh = U.el('div', 'pill focusable modal-btn', U.t('Refresh'));
|
|
236
|
+
var remove = U.el('div', 'pill focusable modal-btn danger', U.t('Remove'));
|
|
237
237
|
// Turn off / on: kept in your list, not asked for anything while it's off (a backup)
|
|
238
238
|
var isOff = !!(Stremio.isAddonOff && Stremio.isAddonOff(url));
|
|
239
|
-
var onoff = U.el('div', 'pill focusable modal-btn', isOff ? 'Turn on' : 'Turn off');
|
|
239
|
+
var onoff = U.el('div', 'pill focusable modal-btn', isOff ? U.t('Turn on') : U.t('Turn off'));
|
|
240
240
|
onoff.__onselect = function () {
|
|
241
241
|
closeModal();
|
|
242
242
|
Stremio.setAddonOff(url, !isOff);
|
|
243
243
|
refreshAddonRows(); // (its rows come or go; nothing else is fetched)
|
|
244
|
-
U.toast(isOff ? '“
|
|
244
|
+
U.toast(isOff ? U.t('“{name}” is on', { name: name }) : U.t('“{name}” is off: not asked for anything until you turn it on', { name: name }), 4000);
|
|
245
245
|
renderSettings();
|
|
246
246
|
};
|
|
247
247
|
|
|
@@ -256,12 +256,12 @@ var ViewParts = {};
|
|
|
256
256
|
Stremio.refreshAddon(url).then(function () { // just this one; the others keep theirs
|
|
257
257
|
refreshAddonRows(url);
|
|
258
258
|
U.spinner(false);
|
|
259
|
-
U.toast('Addon refreshed');
|
|
259
|
+
U.toast(U.t('Addon refreshed'));
|
|
260
260
|
renderSettings();
|
|
261
261
|
}, function () {
|
|
262
262
|
U.spinner(false);
|
|
263
263
|
var why = Stremio.manifestProblem ? Stremio.manifestProblem(url) : '', said = Stremio.manifestDetail ? Stremio.manifestDetail(url) : '';
|
|
264
|
-
U.toast('Could not refresh addon' + (why ? ' (' + why + ')' : '') + (said ? ': ' + said : ''), said ? 8000 : 3000);
|
|
264
|
+
U.toast(U.t('Could not refresh addon') + (why ? ' (' + why + ')' : '') + (said ? ': ' + said : ''), said ? 8000 : 3000);
|
|
265
265
|
renderSettings(); // (its row shows the reason)
|
|
266
266
|
});
|
|
267
267
|
};
|
|
@@ -270,22 +270,22 @@ var ViewParts = {};
|
|
|
270
270
|
closeModal();
|
|
271
271
|
Stremio.removeAddon(url);
|
|
272
272
|
refreshAddonRows(); // its rows go; nothing else is fetched
|
|
273
|
-
U.toast('Removed');
|
|
273
|
+
U.toast(U.t('Removed'));
|
|
274
274
|
setTimeout(renderSettings, 300);
|
|
275
275
|
};
|
|
276
276
|
|
|
277
277
|
// Share: a QR of its link (to add it elsewhere); Configure: of its setup page (its
|
|
278
278
|
// manifest says it has one), to change its settings on the phone
|
|
279
279
|
var base = ('' + url).replace(/\/manifest\.json(\?.*)?$/, '');
|
|
280
|
-
var share = U.el('div', 'pill focusable modal-btn', 'Share');
|
|
280
|
+
var share = U.el('div', 'pill focusable modal-btn', U.t('Share'));
|
|
281
281
|
share.__onselect = function () {
|
|
282
|
-
qrModal('Share “'
|
|
282
|
+
qrModal(U.t('Share “{name}”', { name: name }), url, [U.t('Scan it to add this addon on another device. It carries the personal parts of its link (your tokens and settings): show it only to your own devices.')]);
|
|
283
283
|
};
|
|
284
284
|
var m = Stremio.savedManifest ? Stremio.savedManifest(url) : null, bh = (m && m.behaviorHints) || {};
|
|
285
|
-
var configure = (bh.configurable || bh.configurationRequired) ? U.el('div', 'pill focusable modal-btn', 'Configure') : null;
|
|
285
|
+
var configure = (bh.configurable || bh.configurationRequired) ? U.el('div', 'pill focusable modal-btn', U.t('Configure')) : null;
|
|
286
286
|
if (configure) {
|
|
287
287
|
configure.__onselect = function () {
|
|
288
|
-
qrModal('Configure “'
|
|
288
|
+
qrModal(U.t('Configure “{name}”', { name: name }), base + '/configure', [U.t('Scan it to change this addon’s settings on your phone. Then add the new link it gives you (Settings › Content › Addons): it replaces this one.')]);
|
|
289
289
|
};
|
|
290
290
|
}
|
|
291
291
|
row.appendChild(cancel);
|
|
@@ -307,61 +307,61 @@ var ViewParts = {};
|
|
|
307
307
|
|
|
308
308
|
var overlay = U.el('div', 'modal-overlay');
|
|
309
309
|
var box = U.el('div', 'modal-box actions-box'); // (as wide as its buttons)
|
|
310
|
-
box.appendChild(U.el('div', 'modal-msg', 'Update “'
|
|
310
|
+
box.appendChild(U.el('div', 'modal-msg', U.t('Update “{name}”', { name: label })));
|
|
311
311
|
|
|
312
312
|
var row = U.el('div', 'modal-row');
|
|
313
|
-
var cancel = U.el('div', 'pill focusable modal-btn', 'Cancel');
|
|
314
|
-
var rename = U.el('div', 'pill focusable modal-btn', 'Rename');
|
|
315
|
-
var onoff = U.el('div', 'pill focusable modal-btn', playlist.off ? 'Turn on' : 'Turn off');
|
|
316
|
-
var edit = U.el('div', 'pill focusable modal-btn', 'Edit link');
|
|
317
|
-
var guide = U.el('div', 'pill focusable modal-btn', 'Guide link');
|
|
313
|
+
var cancel = U.el('div', 'pill focusable modal-btn', U.t('Cancel'));
|
|
314
|
+
var rename = U.el('div', 'pill focusable modal-btn', U.t('Rename'));
|
|
315
|
+
var onoff = U.el('div', 'pill focusable modal-btn', playlist.off ? U.t('Turn on') : U.t('Turn off'));
|
|
316
|
+
var edit = U.el('div', 'pill focusable modal-btn', U.t('Edit link'));
|
|
317
|
+
var guide = U.el('div', 'pill focusable modal-btn', U.t('Guide link'));
|
|
318
318
|
var fmt = IPTV.xtreamFormat ? IPTV.xtreamFormat(playlist.id) : ''; // (an Xtream account: MPEG-TS or HLS)
|
|
319
|
-
var format = U.el('div', 'pill focusable modal-btn', 'Format: '
|
|
319
|
+
var format = U.el('div', 'pill focusable modal-btn', U.t('Format: {format}', { format: fmt === 'hls' ? 'HLS' : 'MPEG-TS' }));
|
|
320
320
|
format.__onselect = function () {
|
|
321
321
|
closeModal();
|
|
322
322
|
Stremio.iptvSetXtreamFormat(playlist.id, fmt === 'hls' ? 'ts' : 'hls');
|
|
323
323
|
refreshAddonRows('local:iptv');
|
|
324
|
-
U.toast('Its channels now play as '
|
|
324
|
+
U.toast(U.t('Its channels now play as {format} (reading the account again…)', { format: fmt === 'hls' ? 'MPEG-TS' : 'HLS' }), 4000);
|
|
325
325
|
renderSettings();
|
|
326
326
|
};
|
|
327
|
-
var groups = U.el('div', 'pill focusable modal-btn', 'Channel groups'); // (a Stalker portal: the genres to read)
|
|
327
|
+
var groups = U.el('div', 'pill focusable modal-btn', U.t('Channel groups')); // (a Stalker portal: the genres to read)
|
|
328
328
|
groups.__onselect = function () {
|
|
329
329
|
closeModal();
|
|
330
|
-
U.toast('Asking the portal for its groups…', 4000);
|
|
330
|
+
U.toast(U.t('Asking the portal for its groups…'), 4000);
|
|
331
331
|
IPTV.stalkerGroups(playlist.id).then(function (list) {
|
|
332
|
-
if (!list.length) { U.toast('The portal lists no groups', 4000); return; }
|
|
333
|
-
pickMany('Groups to read from “'
|
|
332
|
+
if (!list.length) { U.toast(U.t('The portal lists no groups'), 4000); return; }
|
|
333
|
+
pickMany(U.t('Groups to read from “{name}”', { name: label }), list.map(function (g) { return { key: g.id, label: g.title }; }), {
|
|
334
334
|
on: playlist.genres, none: true,
|
|
335
|
-
button: function (n) { return n ? 'Read
|
|
335
|
+
button: function (n) { return n ? U.tn(n, 'Read {n} group', 'Read {n} groups') : U.t('Read as Stalker channels says'); }
|
|
336
336
|
}, function (keys) {
|
|
337
337
|
IPTV.setStalkerGroups(playlist.id, keys);
|
|
338
338
|
refreshAddonRows('local:iptv');
|
|
339
|
-
U.toast('Reading the portal…', 4000);
|
|
339
|
+
U.toast(U.t('Reading the portal…'), 4000);
|
|
340
340
|
renderSettings();
|
|
341
341
|
Stremio.iptvReload(playlist.id).then(function () {
|
|
342
342
|
refreshAddonRows('local:iptv');
|
|
343
343
|
var st = Stremio.iptvStatus(playlist.id);
|
|
344
|
-
U.toast(st.error ? ('Reload failed: '
|
|
344
|
+
U.toast(st.error ? U.t('Reload failed: {why}', { why: st.error }) : U.t('Loaded {n} channels', { n: st.count }), 4000);
|
|
345
345
|
renderSettings();
|
|
346
346
|
});
|
|
347
347
|
});
|
|
348
348
|
}, function (e) { U.toast(U.problem(e), 5000); });
|
|
349
349
|
};
|
|
350
|
-
var reload = U.el('div', 'pill focusable modal-btn', 'Reload');
|
|
351
|
-
var remove = U.el('div', 'pill focusable modal-btn danger', 'Remove');
|
|
350
|
+
var reload = U.el('div', 'pill focusable modal-btn', U.t('Reload'));
|
|
351
|
+
var remove = U.el('div', 'pill focusable modal-btn danger', U.t('Remove'));
|
|
352
352
|
|
|
353
353
|
cancel.__onselect = function () { closeModal(); };
|
|
354
354
|
rename.__onselect = function () {
|
|
355
355
|
closeModal();
|
|
356
356
|
App.openEntry({
|
|
357
|
-
title: 'Rename IPTV playlist',
|
|
358
|
-
hint: 'Type a name (up to 60 characters), then Confirm. Empty uses the playlist’s own name, or its server’s. RETURN cancels.',
|
|
357
|
+
title: U.t('Rename IPTV playlist'),
|
|
358
|
+
hint: U.t('Type a name (up to 60 characters), then Confirm. Empty uses the playlist’s own name, or its server’s. RETURN cancels.'),
|
|
359
359
|
value: playlist.name || '', placeholder: label,
|
|
360
|
-
validate: function (v) { return ('' + v).trim().length > 60 ? 'Up to 60 characters' : null; },
|
|
360
|
+
validate: function (v) { return ('' + v).trim().length > 60 ? U.t('Up to 60 characters') : null; },
|
|
361
361
|
onConfirm: function (v) {
|
|
362
362
|
Stremio.iptvRenamePlaylist(playlist.id, v);
|
|
363
363
|
refreshAddonRows('local:iptv'); // (channels show the playlist they're from)
|
|
364
|
-
U.toast(('' + v).trim() ? 'Playlist renamed' : 'Playlist name cleared');
|
|
364
|
+
U.toast(('' + v).trim() ? U.t('Playlist renamed') : U.t('Playlist name cleared'));
|
|
365
365
|
App.back(); renderSettings();
|
|
366
366
|
}
|
|
367
367
|
});
|
|
@@ -370,20 +370,20 @@ var ViewParts = {};
|
|
|
370
370
|
closeModal();
|
|
371
371
|
Stremio.iptvSetPlaylistOff(playlist.id, !playlist.off);
|
|
372
372
|
refreshAddonRows('local:iptv');
|
|
373
|
-
U.toast(playlist.off ? 'Playlist on: its channels are back' : 'Playlist off: its channels are hidden (nothing is deleted)', 3000);
|
|
373
|
+
U.toast(playlist.off ? U.t('Playlist on: its channels are back') : U.t('Playlist off: its channels are hidden (nothing is deleted)'), 3000);
|
|
374
374
|
renderSettings();
|
|
375
375
|
};
|
|
376
376
|
edit.__onselect = function () {
|
|
377
377
|
closeModal();
|
|
378
378
|
App.openEntry({
|
|
379
|
-
title: 'Edit IPTV playlist', phone: 'playlist',
|
|
380
|
-
hint: 'Update the M3U/M3U8 playlist URL, then Confirm. RETURN cancels.',
|
|
379
|
+
title: U.t('Edit IPTV playlist'), phone: 'playlist',
|
|
380
|
+
hint: U.t('Update the M3U/M3U8 playlist URL, then Confirm. RETURN cancels.'),
|
|
381
381
|
value: playlist.url, placeholder: 'https://example.com/playlist.m3u',
|
|
382
382
|
validate: function (v) { return U.urlProblem(v) || null; }, // (U.parseUrl: http(s), a real host, no user:password@)
|
|
383
383
|
onConfirm: function (v) {
|
|
384
384
|
Stremio.iptvUpdatePlaylist(playlist.id, v);
|
|
385
385
|
refreshAddonRows('local:iptv'); // just the IPTV rows
|
|
386
|
-
U.toast('Playlist updated');
|
|
386
|
+
U.toast(U.t('Playlist updated'));
|
|
387
387
|
App.back(); renderSettings();
|
|
388
388
|
}
|
|
389
389
|
});
|
|
@@ -391,26 +391,26 @@ var ViewParts = {};
|
|
|
391
391
|
guide.__onselect = function () { // its TV guide: yours, or the playlist's own (empty)
|
|
392
392
|
closeModal();
|
|
393
393
|
App.openEntry({
|
|
394
|
-
title: 'TV guide link', phone: 'playlist',
|
|
395
|
-
hint: 'An XMLTV guide (.xml or .xml.gz), then Confirm. Empty uses the playlist’s own (the one it names, or an Xtream playlist’s). RETURN cancels.',
|
|
394
|
+
title: U.t('TV guide link'), phone: 'playlist',
|
|
395
|
+
hint: U.t('An XMLTV guide (.xml or .xml.gz), then Confirm. Empty uses the playlist’s own (the one it names, or an Xtream playlist’s). RETURN cancels.'),
|
|
396
396
|
value: playlist.guide || '', placeholder: 'https://example.com/guide.xml.gz',
|
|
397
397
|
validate: function (v) { return ('' + v).trim() ? (U.urlProblem(v) || null) : null; },
|
|
398
398
|
onConfirm: function (v) {
|
|
399
399
|
Stremio.iptvSetPlaylistGuide(playlist.id, v);
|
|
400
|
-
U.toast(('' + v).trim() ? 'Guide link set: reading it…' : 'Back to the playlist’s own guide', 3000);
|
|
400
|
+
U.toast(('' + v).trim() ? U.t('Guide link set: reading it…') : U.t('Back to the playlist’s own guide'), 3000);
|
|
401
401
|
App.back(); renderSettings();
|
|
402
402
|
}
|
|
403
403
|
});
|
|
404
404
|
};
|
|
405
405
|
reload.__onselect = function () {
|
|
406
406
|
closeModal();
|
|
407
|
-
U.toast('Reloading playlist…', 4000);
|
|
407
|
+
U.toast(U.t('Reloading playlist…'), 4000);
|
|
408
408
|
if (typeof XtVod !== 'undefined' && XtVod.reload) { XtVod.reload(playlist.id); } // (an Xtream account: its films and series too)
|
|
409
409
|
if (typeof StVod !== 'undefined' && StVod.reload) { StVod.reload(playlist.id); } // (a Stalker portal: the same)
|
|
410
410
|
Stremio.iptvReload(playlist.id).then(function () {
|
|
411
411
|
refreshAddonRows('local:iptv');
|
|
412
412
|
var st = Stremio.iptvStatus(playlist.id);
|
|
413
|
-
U.toast(st.error ? ('Reload failed: '
|
|
413
|
+
U.toast(st.error ? U.t('Reload failed: {why}', { why: st.error }) : U.t('Loaded {n} channels', { n: st.count }), 4000);
|
|
414
414
|
renderSettings();
|
|
415
415
|
});
|
|
416
416
|
};
|
|
@@ -418,7 +418,7 @@ var ViewParts = {};
|
|
|
418
418
|
closeModal();
|
|
419
419
|
Stremio.iptvRemovePlaylist(playlist.id);
|
|
420
420
|
refreshAddonRows('local:iptv');
|
|
421
|
-
U.toast('Playlist removed');
|
|
421
|
+
U.toast(U.t('Playlist removed'));
|
|
422
422
|
setTimeout(renderSettings, 300);
|
|
423
423
|
};
|
|
424
424
|
|
|
@@ -485,12 +485,12 @@ var ViewParts = {};
|
|
|
485
485
|
var go = U.el('div', 'pill focusable modal-btn');
|
|
486
486
|
function ticked() { return items.filter(function (it) { return on[it.key]; }).map(function (it) { return it.key; }); }
|
|
487
487
|
function drawGo() { go.textContent = opts.button(ticked().length); }
|
|
488
|
-
var all = U.el('div', 'pick-item focusable', can.length && can.every(function (it) { return on[it.key]; }) ? 'Select none' : 'Select all'); // (all ticked at first: an export's)
|
|
488
|
+
var all = U.el('div', 'pick-item focusable', can.length && can.every(function (it) { return on[it.key]; }) ? U.t('Select none') : U.t('Select all')); // (all ticked at first: an export's)
|
|
489
489
|
all.__onselect = function () {
|
|
490
490
|
var every = can.every(function (it) { return on[it.key]; });
|
|
491
491
|
can.forEach(function (it) { on[it.key] = !every; });
|
|
492
492
|
nodes.forEach(function (n) { n.__draw(); });
|
|
493
|
-
all.textContent = every ? 'Select all' : 'Select none';
|
|
493
|
+
all.textContent = every ? U.t('Select all') : U.t('Select none');
|
|
494
494
|
drawGo();
|
|
495
495
|
};
|
|
496
496
|
if (can.length > 1) { listEl.appendChild(all); }
|
|
@@ -498,11 +498,11 @@ var ViewParts = {};
|
|
|
498
498
|
var n = U.el('div', 'pick-item focusable');
|
|
499
499
|
n.__draw = function () {
|
|
500
500
|
n.textContent = (on[it.key] ? '✓ ' : '') + it.label +
|
|
501
|
-
(it.have ? ' (' + (opts.haveText || 'already added') + ')' : it.note ? ' (' + it.note + ')' : '');
|
|
501
|
+
(it.have ? ' (' + (opts.haveText || U.t('already added')) + ')' : it.note ? ' (' + it.note + ')' : '');
|
|
502
502
|
if (on[it.key]) { n.classList.add('sel'); } else { n.classList.remove('sel'); }
|
|
503
503
|
};
|
|
504
504
|
n.__onselect = function () {
|
|
505
|
-
if (it.have) { U.toast(opts.haveText ? 'That one is '
|
|
505
|
+
if (it.have) { U.toast(opts.haveText ? U.t('That one is {what}', { what: opts.haveText }) : U.t('You already have that one'), 2000); return; }
|
|
506
506
|
on[it.key] = !on[it.key]; n.__draw(); drawGo();
|
|
507
507
|
};
|
|
508
508
|
n.__draw();
|
|
@@ -513,12 +513,12 @@ var ViewParts = {};
|
|
|
513
513
|
var row = U.el('div', 'modal-row');
|
|
514
514
|
go.__onselect = function () {
|
|
515
515
|
var keys = ticked();
|
|
516
|
-
if (!keys.length && !opts.none) { U.toast('Nothing ticked: OK on one ticks it', 2500); return; }
|
|
516
|
+
if (!keys.length && !opts.none) { U.toast(U.t('Nothing ticked: OK on one ticks it'), 2500); return; }
|
|
517
517
|
closeModal();
|
|
518
518
|
onDone(keys);
|
|
519
519
|
};
|
|
520
520
|
drawGo();
|
|
521
|
-
var cancel = U.el('div', 'pill focusable modal-btn', 'Cancel');
|
|
521
|
+
var cancel = U.el('div', 'pill focusable modal-btn', U.t('Cancel'));
|
|
522
522
|
cancel.__onselect = function () { closeModal(); };
|
|
523
523
|
row.appendChild(go);
|
|
524
524
|
row.appendChild(cancel);
|
|
@@ -577,14 +577,14 @@ var ViewParts = {};
|
|
|
577
577
|
}
|
|
578
578
|
menuItems().forEach(function (m) {
|
|
579
579
|
if (m.tab) { item('tab-pill', m.key, m.tab.label, m.tab.icon, function () { App.goHome(m.key); }, tabbar); }
|
|
580
|
-
else if (m.key === 'discover') { item('tab-pill', 'discover', 'Discover', '🔭', function () { App.openDiscover(); }, tabbar); }
|
|
581
|
-
else if (m.key === 'search') { item('hchip', 'search', 'Search', '🔍', function () { App.openSearch(); }, tabbar); }
|
|
580
|
+
else if (m.key === 'discover') { item('tab-pill', 'discover', U.t('Discover'), '🔭', function () { App.openDiscover(); }, tabbar); }
|
|
581
|
+
else if (m.key === 'search') { item('hchip', 'search', U.t('Search'), '🔍', function () { App.openSearch(); }, tabbar); }
|
|
582
582
|
});
|
|
583
583
|
// The items in one strip that scrolls sideways when they don't all fit (Focus keeps the
|
|
584
584
|
// focused one in view); the StremioK name outside it, at the right.
|
|
585
585
|
var strip = U.el('div', 'menu-scroll');
|
|
586
586
|
strip.appendChild(tabbar);
|
|
587
|
-
item('hchip', 'settings', 'Settings', '⚙', function () { App.openSettings(); }, strip);
|
|
587
|
+
item('hchip', 'settings', U.t('Settings'), '⚙', function () { App.openSettings(); }, strip);
|
|
588
588
|
head.appendChild(strip);
|
|
589
589
|
setTimeout(function () { showActiveItem(strip); }, 0); // (once it's on screen)
|
|
590
590
|
var brand = U.el('div', 'brand');
|
|
@@ -760,17 +760,17 @@ var ViewParts = {};
|
|
|
760
760
|
U.spinner(false);
|
|
761
761
|
if (!hold.still()) { return; } // (left meanwhile)
|
|
762
762
|
var fav = IPTV.isFavorite(meta.id), t = Date.now() / 1000, at = 'play';
|
|
763
|
-
var items = [['play', '▶ Watch now'], ['fav', fav ? '★ Remove from favorites' : '★ Add to favorites']];
|
|
763
|
+
var items = [['play', U.t('▶ Watch now')], ['fav', fav ? U.t('★ Remove from favorites') : U.t('★ Add to favorites')]];
|
|
764
764
|
list.forEach(function (p, i) {
|
|
765
765
|
var on = p.start <= t && t < p.stop;
|
|
766
766
|
if (on) { at = 'p' + i; }
|
|
767
767
|
items.push(['p' + i, (on ? '● ' : '') + EPG.dayTime(p.start) + ' ' + p.title]);
|
|
768
768
|
});
|
|
769
|
-
pickList((meta.name || '') + (list.length ? ' · TV guide' : ''), items, at, function (v) {
|
|
769
|
+
pickList((meta.name || '') + (list.length ? ' · ' + U.t('TV guide') : ''), items, at, function (v) {
|
|
770
770
|
if (v === 'play') { card.__onselect(); return; }
|
|
771
771
|
if (v === 'fav') {
|
|
772
772
|
IPTV.setFavorite(meta.id, !fav);
|
|
773
|
-
U.toast(fav ? 'Removed from favorites' : 'Added to favorites: ★ Favorites, first on the IPTV tab', 3000);
|
|
773
|
+
U.toast(fav ? U.t('Removed from favorites') : U.t('Added to favorites: ★ Favorites, first on the IPTV tab'), 3000);
|
|
774
774
|
refreshAddonRows('local:iptv');
|
|
775
775
|
return;
|
|
776
776
|
}
|
|
@@ -819,21 +819,21 @@ var ViewParts = {};
|
|
|
819
819
|
return Stremio.getMeta(type, meta.id).then(null, function () { return null; }).then(function (full) {
|
|
820
820
|
var m = Object.assign({ id: meta.id, type: type }, meta, full || {});
|
|
821
821
|
var eps = (type === 'series') ? (m.videos || []) : null;
|
|
822
|
-
var opts = [['details', 'Details']];
|
|
822
|
+
var opts = [['details', U.t('Details')]];
|
|
823
823
|
if (type === 'movie' || eps.length) {
|
|
824
|
-
opts.push(['np', inNowPlaying(type, m.id) ? 'Remove from Continue Watching' : 'Add to Continue Watching']);
|
|
824
|
+
opts.push(['np', inNowPlaying(type, m.id) ? U.t('Remove from Continue Watching') : U.t('Add to Continue Watching')]);
|
|
825
825
|
}
|
|
826
826
|
var watched = (type === 'movie') ? Player.isWatched('movie', m.id) : (eps.length > 0 && eps.every(episodeWatched));
|
|
827
827
|
if (type === 'movie' || eps.length) {
|
|
828
|
-
opts.push(['watched', watched ? 'Mark unwatched' : (type === 'series' ? 'Mark whole series watched' : 'Mark watched')]);
|
|
828
|
+
opts.push(['watched', watched ? U.t('Mark unwatched') : (type === 'series' ? U.t('Mark whole series watched') : U.t('Mark watched'))]);
|
|
829
829
|
}
|
|
830
830
|
// Your Stremio account's Library (connected): in it, or not
|
|
831
831
|
var lib = typeof StremioSync !== 'undefined' && StremioSync.isConnected() && (type === 'movie' || type === 'series');
|
|
832
|
-
if (lib) { opts.push(['lib', StremioSync.inLibrary(type, m.id) ? 'Remove from Stremio Library' : 'Add to Stremio Library']); }
|
|
832
|
+
if (lib) { opts.push(['lib', StremioSync.inLibrary(type, m.id) ? U.t('Remove from Stremio Library') : U.t('Add to Stremio Library')]); }
|
|
833
833
|
// Rate on Trakt (connected, a title with an IMDb id): yours shown once rated
|
|
834
834
|
var canRate = typeof Trakt !== 'undefined' && Trakt.isConnected() && Trakt.rate && /^tt\d+$/.test(m.id);
|
|
835
835
|
var mine = canRate ? Trakt.myRating(type, m.id) : null;
|
|
836
|
-
if (canRate) { opts.push(['rate', mine ? 'Your rating:
|
|
836
|
+
if (canRate) { opts.push(['rate', mine ? U.t('Your rating: {n} · change', { n: mine }) : U.t('Rate on Trakt')]); }
|
|
837
837
|
return { name: m.name || m.title || '', items: opts, run: function (v) {
|
|
838
838
|
if (v === 'details') { App.openDetail(type, m.id, meta); }
|
|
839
839
|
else if (v === 'np') { toggleNowPlaying(type, m); }
|
|
@@ -846,14 +846,14 @@ var ViewParts = {};
|
|
|
846
846
|
|
|
847
847
|
// 1 to 10, as Trakt words them; Remove rating when it has yours. kind: 'movie' | 'series' |
|
|
848
848
|
// 'season' (id 'tt…:N').
|
|
849
|
-
var TRAKT_RATINGS = ['Weak Sauce', 'Terrible', 'Bad', 'Poor', 'Meh', 'Fair', 'Good', 'Great', 'Superb', 'Totally Ninja!'];
|
|
849
|
+
var TRAKT_RATINGS = [U.t('Weak Sauce'), U.t('Terrible'), U.t('Bad'), U.t('Poor'), U.t('Meh'), U.t('Fair'), U.t('Good'), U.t('Great'), U.t('Superb'), U.t('Totally Ninja!')];
|
|
850
850
|
function rateOnTrakt(kind, id, name) {
|
|
851
851
|
var mine = Trakt.myRating(kind, id), opts = [];
|
|
852
852
|
for (var n = 10; n >= 1; n--) { opts.push(['' + n, n + ' · ' + TRAKT_RATINGS[n - 1]]); }
|
|
853
|
-
if (mine) { opts.push(['0', 'Remove rating']); }
|
|
854
|
-
pickList('Rate “
|
|
853
|
+
if (mine) { opts.push(['0', U.t('Remove rating')]); }
|
|
854
|
+
pickList(U.t('Rate “{name}” on Trakt', { name: name }), opts, mine ? '' + mine : null, function (v) {
|
|
855
855
|
Trakt.rate(kind, id, +v);
|
|
856
|
-
U.toast(+v ? 'Rated
|
|
856
|
+
U.toast(+v ? U.t('Rated {n} on Trakt', { n: v }) : U.t('Rating removed on Trakt'));
|
|
857
857
|
});
|
|
858
858
|
}
|
|
859
859
|
V.rateOnTrakt = rateOnTrakt;
|
|
@@ -870,7 +870,7 @@ var ViewParts = {};
|
|
|
870
870
|
}
|
|
871
871
|
watchedTicks(m.id, on);
|
|
872
872
|
markHomeDirty();
|
|
873
|
-
U.toast(on ? 'Marked watched' : 'Marked unwatched');
|
|
873
|
+
U.toast(on ? U.t('Marked watched') : U.t('Marked unwatched'));
|
|
874
874
|
}
|
|
875
875
|
// Every card of this title on screen, in every row (Home, Discover, Search): its ✓.
|
|
876
876
|
function watchedTicks(id, on) {
|
|
@@ -927,27 +927,27 @@ var ViewParts = {};
|
|
|
927
927
|
if (e._trakt) { if (Trakt.dismiss) { Trakt.dismiss(e.type, e.id); } } else if (!e._stremio) { Player.removeProgress(e.type, e.id); }
|
|
928
928
|
if (typeof StremioSync !== 'undefined' && StremioSync.dismiss) { StremioSync.dismiss(e.type, e.id); }
|
|
929
929
|
});
|
|
930
|
-
U.toast('Removed from Continue Watching');
|
|
930
|
+
U.toast(U.t('Removed from Continue Watching'));
|
|
931
931
|
} else if (type === 'movie') {
|
|
932
932
|
Player.addToContinue({ id: m.id, type: 'movie', name: m.name || m.title, poster: m.poster, background: m.background, parent: m.id });
|
|
933
|
-
U.toast('Added to Continue Watching');
|
|
933
|
+
U.toast(U.t('Added to Continue Watching'));
|
|
934
934
|
} else {
|
|
935
935
|
var v = nextUp(m).v;
|
|
936
936
|
Player.addToContinue({ id: v.id, type: 'series', name: (m.name || '') + ' ' + epCode(v), poster: m.poster, background: m.background, parent: m.id });
|
|
937
|
-
U.toast('Added to Continue Watching');
|
|
937
|
+
U.toast(U.t('Added to Continue Watching'));
|
|
938
938
|
}
|
|
939
939
|
markHomeDirty();
|
|
940
940
|
}
|
|
941
941
|
// The button's label, for a title page's meta (checked by the same id toggleNowPlaying
|
|
942
942
|
// adds and removes by: the id the title's details came with, which can differ from the
|
|
943
943
|
// one it was opened by, e.g. a TMDB id in Discover for an IMDb one).
|
|
944
|
-
function nowPlayingLabel(type, id) { return inNowPlaying(type, id) ? '✓ In Continue Watching' : '+ Add to Continue Watching'; }
|
|
944
|
+
function nowPlayingLabel(type, id) { return inNowPlaying(type, id) ? U.t('✓ In Continue Watching') : U.t('+ Add to Continue Watching'); }
|
|
945
945
|
// Your Stremio account's Library (Settings › Integrations › Stremio account): a title in it or not.
|
|
946
|
-
function libraryLabel(type, id) { return StremioSync.inLibrary(type, id) ? '✓ In Stremio Library' : '+ Stremio Library'; }
|
|
946
|
+
function libraryLabel(type, id) { return StremioSync.inLibrary(type, id) ? U.t('✓ In Stremio Library') : U.t('+ Stremio Library'); }
|
|
947
947
|
function toggleLibrary(type, m) {
|
|
948
948
|
var on = !StremioSync.inLibrary(type, m.id);
|
|
949
949
|
StremioSync.setInLibrary(type, { id: m.id, name: m.name || m.title || '', poster: m.poster || '' }, on);
|
|
950
|
-
U.toast(on ? 'Added to your Stremio Library' : 'Removed from your Stremio Library');
|
|
950
|
+
U.toast(on ? U.t('Added to your Stremio Library') : U.t('Removed from your Stremio Library'));
|
|
951
951
|
}
|
|
952
952
|
function libraryOn() { return typeof StremioSync !== 'undefined' && StremioSync.isConnected(); }
|
|
953
953
|
|
|
@@ -959,7 +959,7 @@ var ViewParts = {};
|
|
|
959
959
|
if (!_holdHint) {
|
|
960
960
|
var app = U.byId('app');
|
|
961
961
|
if (!app) { return; }
|
|
962
|
-
_holdHint = U.el('div', 'hidden', 'Hold OK for more');
|
|
962
|
+
_holdHint = U.el('div', 'hidden', U.t('Hold OK for more'));
|
|
963
963
|
_holdHint.id = 'hold-hint';
|
|
964
964
|
app.appendChild(_holdHint);
|
|
965
965
|
}
|