stremiok 2.3.8 → 2.4.1
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 +21 -0
- package/README.md +6 -2
- package/config.xml +1 -1
- package/css/style.css +14 -0
- package/index.html +46 -43
- package/js/app.js +16 -1
- package/js/hubpreview.js +8 -1
- package/js/i18n.js +3 -2
- package/js/iptv.js +12 -5
- package/js/lang/ar.js +101 -1
- package/js/lang/ca.js +101 -1
- package/js/lang/de.js +101 -1
- package/js/lang/es.js +101 -1
- package/js/lang/fi.js +101 -1
- package/js/lang/fr.js +101 -1
- package/js/lang/he.js +101 -1
- package/js/lang/hi.js +101 -1
- package/js/lang/it.js +101 -1
- package/js/lang/ja.js +101 -1
- package/js/lang/ko.js +101 -1
- package/js/lang/pl.js +101 -1
- package/js/lang/pt-BR.js +101 -1
- package/js/lang/ru.js +101 -1
- package/js/lang/tr.js +101 -1
- package/js/lang/zh-CN.js +101 -1
- package/js/nuvio-import.js +152 -0
- package/js/nuvio-sync.js +269 -0
- package/js/player-core.js +2 -1
- package/js/player-store.js +5 -1
- package/js/profiles.js +181 -0
- package/js/stremio.js +4 -1
- package/js/util.js +19 -3
- package/js/view-core.js +89 -10
- package/js/view-detail.js +11 -10
- package/js/view-home.js +13 -2
- package/js/view-search.js +15 -1
- package/js/view-settings.js +402 -4
- package/js/views.js +1 -1
- package/package.json +1 -1
- package/tizenbrew.html +1 -1
package/js/view-settings.js
CHANGED
|
@@ -478,11 +478,302 @@
|
|
|
478
478
|
else if (_settingsSection === 'appearance') { settingsAppearance(wrap); }
|
|
479
479
|
else if (_settingsSection === 'home') { settingsHome(wrap); }
|
|
480
480
|
else if (_settingsSection === 'formats') { settingsFormats(wrap); }
|
|
481
|
+
else if (_settingsSection === 'profiles') { settingsProfiles(wrap); }
|
|
481
482
|
else { settingsMenu(wrap); }
|
|
482
483
|
var ver = appVersion();
|
|
483
484
|
if (ver) { s.appendChild(U.el('div', 'settings-version', 'StremioK ' + ver)); }
|
|
484
485
|
}
|
|
485
486
|
|
|
487
|
+
// ----- Settings › Profiles (js/profiles.js) -----
|
|
488
|
+
// Each profile: Switch to it, Rename, Color, Delete. + Add a profile: its name, then a copy of
|
|
489
|
+
// this one (addons, settings, media server sign-ins; not its history or accounts) or empty.
|
|
490
|
+
// Ask who's watching when StremioK opens (two or more).
|
|
491
|
+
var PROFILE_COLOR_NAMES = { indigo: U.t('Indigo'), teal: U.t('Teal'), orange: U.t('Orange'), pink: U.t('Pink'), green: U.t('Green'), red: U.t('Red'), purple: U.t('Purple'), amber: U.t('Amber') };
|
|
492
|
+
var PROFILE_STORAGE_MAX = 4194304; // (bytes of the settings storage used: no new profile past this, the 2017 TV keeps about 5 MB)
|
|
493
|
+
function storageUsed() {
|
|
494
|
+
var n = 0;
|
|
495
|
+
try { for (var i = 0; i < window.localStorage.length; i++) { var k = window.localStorage.key(i); n += (k.length + (window.localStorage.getItem(k) || '').length) * 2; } } catch (e) {}
|
|
496
|
+
return n;
|
|
497
|
+
}
|
|
498
|
+
function settingsProfiles(wrap) {
|
|
499
|
+
wrap.appendChild(U.el('h2', null, U.t('Profiles')));
|
|
500
|
+
var list = Profiles.list(), now = Profiles.active(), focus = null;
|
|
501
|
+
if (!list.length) { list = [{ id: '', name: U.t('Profile {n}', { n: 1 }), color: 'indigo', slot: '' }]; now = list[0]; }
|
|
502
|
+
list.forEach(function (p) {
|
|
503
|
+
var mine = now && p.id === now.id, r = U.el('div', 'addon-item focusable cfg-row pf-setting');
|
|
504
|
+
var nm = U.el('div', 'a-name');
|
|
505
|
+
nm.appendChild(V.profileBadge(p, 'small'));
|
|
506
|
+
nm.appendChild(document.createTextNode(' ' + p.name + (mine ? ' · ' + U.t('in use') : '')));
|
|
507
|
+
r.appendChild(nm);
|
|
508
|
+
r.__onselect = function () {
|
|
509
|
+
var opts = [];
|
|
510
|
+
if (!mine) { opts.push(['switch', U.t('Switch to it')]); }
|
|
511
|
+
opts.push(['rename', U.t('Rename')], ['color', U.t('Color')]);
|
|
512
|
+
if (!mine && list.length > 1) { opts.push(['delete', U.t('Delete')]); }
|
|
513
|
+
pickList(p.name, opts, null, function (v) {
|
|
514
|
+
_focusChild = 'pf:' + p.id;
|
|
515
|
+
if (v === 'switch') { V.switchProfile(p.id); }
|
|
516
|
+
else if (v === 'rename') { profileName(U.t('Rename “{name}”', { name: p.name }), p.name, function (name) { profileEnsure(); Profiles.rename(p.id || Profiles.active().id, name); renderSettings(); }); }
|
|
517
|
+
else if (v === 'color') {
|
|
518
|
+
pickList(U.t('Color'), Profiles.COLORS.map(function (c) { return [c, PROFILE_COLOR_NAMES[c] || c, null, V.PROFILE_COLORS[c]]; }), p.color, function (c) { profileEnsure(); Profiles.recolor(p.id || Profiles.active().id, c); renderSettings(); });
|
|
519
|
+
} else if (v === 'delete') {
|
|
520
|
+
confirm(U.t('Delete “{name}”? Its addons, settings, progress, watched marks and sign-ins go with it; the rest of the TV’s doesn’t.', { name: p.name }), U.t('Delete'), function () {
|
|
521
|
+
Profiles.remove(p.id, U.bigStore && U.bigStore.removeExact);
|
|
522
|
+
U.toast(U.t('“{name}” deleted', { name: p.name }));
|
|
523
|
+
renderSettings();
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
};
|
|
528
|
+
if (_focusChild === 'pf:' + p.id) { focus = r; }
|
|
529
|
+
wrap.appendChild(r);
|
|
530
|
+
});
|
|
531
|
+
if (list.length < Profiles.MAX) {
|
|
532
|
+
var add = U.el('div', 'addon-item focusable cfg-row');
|
|
533
|
+
add.appendChild(U.el('div', 'a-name', U.t('+ Add a profile')));
|
|
534
|
+
add.appendChild(U.el('div', 'a-url', U.t('Its name, then a copy of this profile’s addons and settings, or none')));
|
|
535
|
+
add.__onselect = function () {
|
|
536
|
+
if (storageUsed() > PROFILE_STORAGE_MAX) { U.toast(U.t('The TV’s storage is nearly full: no room for another profile (Settings › Diagnostics › Storage).'), 6000); return; }
|
|
537
|
+
profileName(U.t('New profile'), '', function (name) {
|
|
538
|
+
var starts = [['copy', U.t('A copy of this profile’s addons and settings')], ['empty', U.t('Nothing: its own from the start')]];
|
|
539
|
+
if (typeof StremioAccount !== 'undefined' && typeof StremioSync !== 'undefined') { starts.push(['stremio', U.t('A Stremio account: its addons, Continue Watching and watched marks')]); }
|
|
540
|
+
if (typeof NuvioImport !== 'undefined' && typeof NuvioSync !== 'undefined') { starts.push(['nuvio', U.t('A Nuvio account’s profile: kept in step with it')]); }
|
|
541
|
+
pickList(U.t('“{name}” starts with', { name: name }), starts, 'copy', function (how) {
|
|
542
|
+
if (how === 'stremio') { profileFromStremio(name); return; }
|
|
543
|
+
if (how === 'nuvio') { nuvioConnect(name); return; }
|
|
544
|
+
var p = Profiles.add(name, null, U.t('Profile {n}', { n: 1 }));
|
|
545
|
+
if (!p) { U.toast(U.t('Up to {n} profiles', { n: Profiles.MAX }), 4000); return; }
|
|
546
|
+
if (how === 'copy') { Profiles.copyInto(p.slot, Profiles.slot()); }
|
|
547
|
+
markHomeDirty();
|
|
548
|
+
_focusChild = 'pf:' + p.id;
|
|
549
|
+
renderSettings();
|
|
550
|
+
confirm(U.t('“{name}” added. Switch to it now?', { name: p.name }), U.t('Switch to it'), function () { V.switchProfile(p.id); }, { plain: true, noLabel: U.t('Not now'), focusYes: true });
|
|
551
|
+
});
|
|
552
|
+
});
|
|
553
|
+
};
|
|
554
|
+
wrap.appendChild(add);
|
|
555
|
+
} else {
|
|
556
|
+
wrap.appendChild(U.el('div', 'hint', U.t('Up to {n} profiles', { n: Profiles.MAX })));
|
|
557
|
+
}
|
|
558
|
+
if (list.length < Profiles.MAX && typeof NuvioImport !== 'undefined') {
|
|
559
|
+
var nv = U.el('div', 'addon-item focusable cfg-row');
|
|
560
|
+
nv.appendChild(U.el('div', 'a-name', U.t('⇩ Import profiles from Nuvio')));
|
|
561
|
+
nv.appendChild(U.el('div', 'a-url', U.t('Sign in on your phone, pick its profiles: each with its addons, watched marks and recent progress. Once; Nuvio’s account isn’t changed')));
|
|
562
|
+
nv.__onselect = nuvioImport;
|
|
563
|
+
wrap.appendChild(nv);
|
|
564
|
+
}
|
|
565
|
+
if (Profiles.count() > 1) { // When StremioK opens: ask, the last profile used, or one always
|
|
566
|
+
var startList = [['ask', U.t('Ask who’s watching')], ['last', U.t('The last profile used')]].concat(list.map(function (p) { return [p.id, U.t('Always “{name}”', { name: p.name })]; }));
|
|
567
|
+
var ask = U.el('div', 'addon-item focusable cfg-row'), choice = Profiles.startChoice();
|
|
568
|
+
ask.appendChild(U.el('div', 'a-name', U.t('When StremioK opens:') + ' ' + labelFor(startList, choice)));
|
|
569
|
+
ask.appendChild(U.el('div', 'a-url', choice === 'ask' ? U.t('Each time it opens, before anything else') : (choice === 'last' ? U.t('It opens in the last profile used; switch from the top menu') : U.t('It opens in that profile, whichever was used last; switch from the top menu'))));
|
|
570
|
+
ask.__onselect = function () {
|
|
571
|
+
pickList(U.t('When StremioK opens'), startList, choice, function (v) { Profiles.setStart(v); _focusChild = 'pf:ask'; renderSettings(); });
|
|
572
|
+
};
|
|
573
|
+
if (_focusChild === 'pf:ask') { focus = ask; }
|
|
574
|
+
wrap.appendChild(ask);
|
|
575
|
+
}
|
|
576
|
+
wrap.appendChild(U.el('div', 'hint', U.t('Each profile keeps its own addons and their order, settings, progress, watched marks, Continue Watching, Trakt, Stremio account and media server sign-ins. Playlists, USB drives, network folders, plugins, API keys and the streaming server are the TV’s, for every profile.')));
|
|
577
|
+
if (focus) { _focusChild = null; Focus.setScope(scr('settings'), focus); } else { focusSettings(); }
|
|
578
|
+
}
|
|
579
|
+
// A new profile from a Stremio account (one account, one profile: a Stremio account has no
|
|
580
|
+
// profiles of its own): signed in on your phone, its addons read; the profile made with them
|
|
581
|
+
// and the account kept connected for it (its sign-in under the profile's own keys), so when
|
|
582
|
+
// it's in use its Continue Watching, watched marks and Library sync in (js/stremio-sync.js).
|
|
583
|
+
function profileFromStremio(name) {
|
|
584
|
+
stremioSignIn(U.t('New profile from a Stremio account'), function (key, body, gone, fail) {
|
|
585
|
+
U.clear(body);
|
|
586
|
+
body.appendChild(U.el('div', 'tc-line', U.t('Reading your addons…')));
|
|
587
|
+
var user = StremioAccount.call('getUser', { type: 'GetUser', authKey: key }).then(function (u) { return u && typeof u.email === 'string' ? U.drawable(u.email).slice(0, 120) : ''; }, function () { return ''; });
|
|
588
|
+
return Promise.all([StremioAccount.addons(key), user]).then(function (r) {
|
|
589
|
+
if (gone()) { StremioAccount.signOut(key); return; }
|
|
590
|
+
var p = Profiles.add(name, null, U.t('Profile {n}', { n: 1 }));
|
|
591
|
+
if (!p) { StremioAccount.signOut(key); fail(new Error(U.t('Up to {n} profiles', { n: Profiles.MAX }))); return; }
|
|
592
|
+
var urls = [], origin = {};
|
|
593
|
+
r[0].forEach(function (a) { var u = (Stremio.normalizeAddonUrl && Stremio.normalizeAddonUrl(a.url)) || a.url; if (urls.indexOf(u) === -1) { urls.push(u); origin[u] = 'stremio'; } });
|
|
594
|
+
function put(k, v) { try { window.localStorage.setItem(Profiles.keyFor(p.slot, 'stremiok.' + k), JSON.stringify(v)); } catch (e) {} }
|
|
595
|
+
if (urls.length) { put('addons', urls); put('addonorigin', origin); }
|
|
596
|
+
put('stremio', { key: key, user: r[1], at: Date.now() });
|
|
597
|
+
closeModal();
|
|
598
|
+
markHomeDirty();
|
|
599
|
+
_focusChild = 'pf:' + p.id;
|
|
600
|
+
renderSettings();
|
|
601
|
+
confirm(U.t('“{name}” added, with {n} addons from {user}. Switch to it now?', { name: p.name, n: urls.length, user: r[1] || 'Stremio' }), U.t('Switch to it'), function () { V.switchProfile(p.id); }, { plain: true, noLabel: U.t('Not now'), focusYes: true });
|
|
602
|
+
});
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
// Profiles from a Nuvio account (js/nuvio-import.js): Nuvio's TV sign-in (a code and a QR code
|
|
606
|
+
// of its page, approved on your phone), its profiles read and the session signed out at once;
|
|
607
|
+
// the ones you tick (as many as there's room for) made StremioK profiles, with their addons,
|
|
608
|
+
// watched marks and recent progress (its titles' names and posters from this profile's addons).
|
|
609
|
+
// Nuvio's sign-in box (js/nuvio-import.js): a code and a QR code of Nuvio's page, approved on
|
|
610
|
+
// your phone; then signedIn(cfg, session, body, gone, fail) (gone(): the box closed meanwhile).
|
|
611
|
+
function nuvioSignIn(title, note, signedIn) {
|
|
612
|
+
var existing = document.querySelector('.modal-overlay');
|
|
613
|
+
if (existing) { existing.parentNode.removeChild(existing); }
|
|
614
|
+
var overlay = U.el('div', 'modal-overlay'), box = U.el('div', 'modal-box'), body = U.el('div', 'trakt-connect');
|
|
615
|
+
box.appendChild(U.el('div', 'modal-msg', title));
|
|
616
|
+
body.appendChild(U.el('div', 'tc-line', U.t('Asking Nuvio for a code…')));
|
|
617
|
+
box.appendChild(body);
|
|
618
|
+
var row = U.el('div', 'modal-row'), cancel = U.el('div', 'pill focusable modal-btn', U.t('Cancel'));
|
|
619
|
+
cancel.__onselect = function () { closeModal(); };
|
|
620
|
+
row.appendChild(cancel); box.appendChild(row); overlay.appendChild(box); document.body.appendChild(overlay);
|
|
621
|
+
showModal(overlay, cancel);
|
|
622
|
+
var gone = false, cfg = null;
|
|
623
|
+
onModalClose(function () { gone = true; });
|
|
624
|
+
function stopped() { return gone; }
|
|
625
|
+
function fail(e) { if (gone) { return; } U.clear(body); body.appendChild(U.el('div', 'tc-line', U.t('It failed: {why}', { why: (e && e.message) || U.t('unknown') }))); }
|
|
626
|
+
NuvioImport.discover().then(function (c) { cfg = c; return NuvioImport.start(c); }).then(function (sess) {
|
|
627
|
+
if (gone) { return; }
|
|
628
|
+
U.clear(body);
|
|
629
|
+
var qrSpot = body.appendChild(U.el('div', 'tc-qr-spot'));
|
|
630
|
+
var goTo = body.appendChild(U.el('div', 'tc-line', U.t('On your phone or computer, go to:')));
|
|
631
|
+
(typeof qrcode !== 'undefined' ? Promise.resolve() : U.loadScript('js/qrcode.js')).then(function () {
|
|
632
|
+
var qr = U.qrCanvas(sess.link, 6);
|
|
633
|
+
if (!qr || !qrSpot.parentNode) { return; }
|
|
634
|
+
qr.className = 'tc-qr';
|
|
635
|
+
qrSpot.appendChild(U.el('div', 'tc-line', U.t('Scan with your phone:')));
|
|
636
|
+
qrSpot.appendChild(qr);
|
|
637
|
+
goTo.textContent = U.t('or go to');
|
|
638
|
+
}, function () {});
|
|
639
|
+
body.appendChild(U.el('div', 'tc-url', sess.link));
|
|
640
|
+
body.appendChild(U.el('div', 'tc-line', U.t('Code:')));
|
|
641
|
+
body.appendChild(U.el('div', 'tc-code', sess.code));
|
|
642
|
+
body.appendChild(U.el('div', 'tc-line small', note));
|
|
643
|
+
return NuvioImport.wait(cfg, sess, stopped).then(function (tok) {
|
|
644
|
+
if (gone) { NuvioImport.signOut(cfg, tok.access); return; }
|
|
645
|
+
U.clear(body);
|
|
646
|
+
body.appendChild(U.el('div', 'tc-line', U.t('Reading your profiles…')));
|
|
647
|
+
return signedIn(cfg, tok, body, stopped, fail);
|
|
648
|
+
});
|
|
649
|
+
}).then(null, function (e) { if (!e || e.message !== 'stopped') { fail(e); } });
|
|
650
|
+
}
|
|
651
|
+
function nuvioImport() {
|
|
652
|
+
nuvioSignIn(U.t('Import profiles from Nuvio'), U.t('Sign in to Nuvio there and approve (Nuvio calls it signing in a TV). StremioK reads your profiles once, then signs out. Waiting…'), function (cfg, tok, body, gone) {
|
|
653
|
+
return NuvioImport.readAll(cfg, tok.access).then(function (list) {
|
|
654
|
+
if (gone()) { return; }
|
|
655
|
+
closeModal();
|
|
656
|
+
nuvioPick(list);
|
|
657
|
+
});
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
// Kept in sync (js/nuvio-sync.js): the Nuvio profile this one follows, picked; then for a new
|
|
661
|
+
// profile (name) made from it, or for the one in use (no name).
|
|
662
|
+
function nuvioConnect(name) {
|
|
663
|
+
nuvioSignIn(name ? U.t('New profile from a Nuvio account') : U.t('Nuvio account'), U.t('Sign in to Nuvio there and approve (Nuvio calls it signing in a TV). The profile you pick then stays in step with this one. Waiting…'), function (cfg, tok, body, gone, fail) {
|
|
664
|
+
return NuvioImport.readAll(cfg, tok.access, true).then(null, function (e) { NuvioImport.signOut(cfg, tok.access); throw e; }).then(function (list) {
|
|
665
|
+
if (gone()) { NuvioImport.signOut(cfg, tok.access); return; }
|
|
666
|
+
if (!list.length) { NuvioImport.signOut(cfg, tok.access); fail(new Error(U.t('That Nuvio account has no profiles'))); return; }
|
|
667
|
+
closeModal();
|
|
668
|
+
function chosen(n) {
|
|
669
|
+
if (!name) {
|
|
670
|
+
NuvioSync.connect(cfg, tok, n).then(function () { markHomeDirty(); renderSettings(); });
|
|
671
|
+
U.toast(U.t('Connected to Nuvio’s “{name}”: syncing…', { name: n.name }), 4000);
|
|
672
|
+
renderSettings();
|
|
673
|
+
offerPlugins(n.plugins, null);
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
U.spinner(true, U.t('Importing…'));
|
|
677
|
+
nuvioMake(n, name).then(function (p) {
|
|
678
|
+
U.spinner(false);
|
|
679
|
+
if (!p) { NuvioImport.signOut(cfg, tok.access); U.toast(U.t('Up to {n} profiles', { n: Profiles.MAX }), 4000); return; }
|
|
680
|
+
NuvioSync.connectFor(p.slot, cfg, tok, n);
|
|
681
|
+
markHomeDirty();
|
|
682
|
+
_focusChild = 'pf:' + p.id;
|
|
683
|
+
renderSettings();
|
|
684
|
+
offerPlugins(n.plugins, function () {
|
|
685
|
+
confirm(U.t('“{name}” added, kept in step with Nuvio’s “{nuvio}”. Switch to it now?', { name: p.name, nuvio: n.name }), U.t('Switch to it'), function () { V.switchProfile(p.id); }, { plain: true, noLabel: U.t('Not now'), focusYes: true });
|
|
686
|
+
});
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
if (list.length === 1) { chosen(list[0]); return; }
|
|
690
|
+
var picked = false;
|
|
691
|
+
pickList(U.t('Which Nuvio profile?'), list.map(function (n, i) { return ['' + i, n.name + (n.locked ? ' · ' + U.t('PIN-locked in Nuvio') : '')]; }), null, function (i) { picked = true; chosen(list[+i]); });
|
|
692
|
+
onModalClose(function () { setTimeout(function () { if (!picked) { NuvioImport.signOut(cfg, tok.access); } }, 0); }); // (none picked: signed out)
|
|
693
|
+
});
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
// Nuvio's plugin repositories (a profile's), offered to add to Nuvio plugins (the TV's, every
|
|
697
|
+
// profile's: Settings › Content › Nuvio plugins), those already there left out; then().
|
|
698
|
+
function offerPlugins(repos, then) {
|
|
699
|
+
var have = typeof Plugins !== 'undefined' && Plugins.repos ? Plugins.repos().map(function (r) { return r.url; }) : null;
|
|
700
|
+
var fresh = have && Plugins.supported && Plugins.supported() ? (repos || []).filter(function (r) { var u = Plugins.manifestUrl ? Plugins.manifestUrl(r.url) : r.url; return u && have.indexOf(u) === -1; }) : [];
|
|
701
|
+
if (!fresh.length) { if (then) { then(); } return; }
|
|
702
|
+
var adding = false;
|
|
703
|
+
pickMany(U.t('Its Nuvio plugins: add them too? (for every profile on this TV)'), fresh.map(function (r, i) { return { key: '' + i, label: (r.name || U.t('Repository')) + ' · ' + shortHost(r.url) }; }),
|
|
704
|
+
{ on: fresh.map(function (r, i) { return '' + i; }), button: function (n) { return U.tn(n, 'Add {n} repository', 'Add {n} repositories'); } }, function (keys) {
|
|
705
|
+
adding = true;
|
|
706
|
+
U.spinner(true, U.t('Adding…'));
|
|
707
|
+
keys.reduce(function (chain, k) { return chain.then(function () { return Plugins.addRepo(fresh[+k].url).then(null, function () {}); }); }, Promise.resolve()).then(function () {
|
|
708
|
+
U.spinner(false);
|
|
709
|
+
U.toast(U.t('Added to Settings › Content › Nuvio plugins (turn them on there)'), 5000);
|
|
710
|
+
if (then) { then(); }
|
|
711
|
+
});
|
|
712
|
+
});
|
|
713
|
+
// (closed without adding: then() all the same; Add closes it first, so its turn is let pass)
|
|
714
|
+
if (then) { onModalClose(function () { setTimeout(function () { if (!adding) { then(); } }, 0); }); }
|
|
715
|
+
}
|
|
716
|
+
function nuvioPick(list) {
|
|
717
|
+
if (!list.length) { U.toast(U.t('That Nuvio account has no profiles'), 5000); return; }
|
|
718
|
+
var room = Profiles.MAX - Math.max(1, Profiles.count());
|
|
719
|
+
var items = list.map(function (p, i) {
|
|
720
|
+
return { key: '' + i, label: p.name + ' · ' + U.tn(p.addons.length, '{n} addon', '{n} addons') + ', ' + U.tn(Object.keys(p.watched).length, '{n} watched', '{n} watched'),
|
|
721
|
+
note: p.locked ? U.t('PIN-locked in Nuvio') : '' };
|
|
722
|
+
});
|
|
723
|
+
pickMany(U.tn(room, 'Nuvio’s profiles: tick up to {n}', 'Nuvio’s profiles: tick up to {n}'), items, { button: function (n) { return U.tn(n, 'Import {n} profile', 'Import {n} profiles'); } }, function (keys) {
|
|
724
|
+
keys = keys.slice(0, room);
|
|
725
|
+
U.spinner(true, U.t('Importing…'));
|
|
726
|
+
var made = [];
|
|
727
|
+
keys.reduce(function (chain, k) { return chain.then(function () { return nuvioMake(list[+k]).then(function (p) { if (p) { made.push(p); } }); }); }, Promise.resolve()).then(function () {
|
|
728
|
+
U.spinner(false);
|
|
729
|
+
markHomeDirty();
|
|
730
|
+
renderSettings();
|
|
731
|
+
if (!made.length) { U.toast(U.t('Nothing imported'), 4000); return; }
|
|
732
|
+
var repos = [];
|
|
733
|
+
keys.forEach(function (k) { (list[+k].plugins || []).forEach(function (r) { if (!repos.some(function (x) { return x.url === r.url; })) { repos.push(r); } }); });
|
|
734
|
+
offerPlugins(repos, function () {
|
|
735
|
+
if (made.length === 1) {
|
|
736
|
+
confirm(U.t('“{name}” added. Switch to it now?', { name: made[0].name }), U.t('Switch to it'), function () { V.switchProfile(made[0].id); }, { plain: true, noLabel: U.t('Not now'), focusYes: true });
|
|
737
|
+
} else { U.toast(U.tn(made.length, 'Imported {n} profile', 'Imported {n} profiles'), 4000); }
|
|
738
|
+
});
|
|
739
|
+
});
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
function nuvioMake(n, name) {
|
|
743
|
+
var p = Profiles.add(name || n.name, NuvioImport.nearestColor(n.color, V.PROFILE_COLORS), U.t('Profile {n}', { n: 1 }));
|
|
744
|
+
if (!p) { return Promise.resolve(null); }
|
|
745
|
+
function put(k, v) { try { window.localStorage.setItem(Profiles.keyFor(p.slot, 'stremiok.' + k), JSON.stringify(v)); } catch (e) {} }
|
|
746
|
+
var urls = [];
|
|
747
|
+
n.addons.forEach(function (u) { var x = (Stremio.normalizeAddonUrl && Stremio.normalizeAddonUrl(u)) || ''; if (x && urls.indexOf(x) === -1) { urls.push(x); } });
|
|
748
|
+
if (urls.length) { var origin = {}; urls.forEach(function (u) { origin[u] = 'nuvio'; }); put('addons', urls); put('addonorigin', origin); }
|
|
749
|
+
if (Object.keys(n.watched).length) { put('watched', n.watched); }
|
|
750
|
+
// (its progress: each title's name and poster looked up, the most recent first; one that
|
|
751
|
+
// can't be found isn't brought)
|
|
752
|
+
var recent = n.progress.slice().sort(function (a, b) { return b.updated - a.updated; });
|
|
753
|
+
return Promise.all(recent.map(function (x) {
|
|
754
|
+
return Promise.resolve(Stremio.getMeta(x.type, x.parent)).then(function (m) { return m && m.name ? { x: x, m: m } : null; }, function () { return null; });
|
|
755
|
+
})).then(function (found) {
|
|
756
|
+
var all = {};
|
|
757
|
+
found.forEach(function (f) {
|
|
758
|
+
if (!f) { return; }
|
|
759
|
+
var x = f.x, ep = x.type === 'series';
|
|
760
|
+
all[x.type + ':' + x.id] = { id: x.id, type: x.type, name: ep ? f.m.name + ' S' + x.season + 'E' + x.episode : f.m.name, poster: f.m.poster, background: f.m.background,
|
|
761
|
+
parent: ep ? x.parent : undefined, position: x.position, duration: x.duration, updated: x.updated || Date.now() };
|
|
762
|
+
});
|
|
763
|
+
if (Object.keys(all).length) { put('progress', all); }
|
|
764
|
+
return p;
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
// The list kept from the first change on (the profile StremioK has always run as, the first).
|
|
768
|
+
function profileEnsure() { Profiles.ensure(U.t('Profile {n}', { n: 1 })); }
|
|
769
|
+
function profileName(title, value, then) {
|
|
770
|
+
App.openEntry({
|
|
771
|
+
title: title, hint: U.t('Its name, as the profiles list shows it. RETURN cancels.'), value: value || '', placeholder: U.t('name'),
|
|
772
|
+
validate: function (v) { return ('' + v).trim() ? null : U.t('A name, please'); },
|
|
773
|
+
onConfirm: function (v) { App.back(); then(('' + v).trim().slice(0, 24)); }
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
|
|
486
777
|
// The app version, from the ?v= cache-buster build.sh stamps on every script tag
|
|
487
778
|
// (kept in sync with package.json / config.xml; works on TizenBrew and desktop too).
|
|
488
779
|
function appVersion() {
|
|
@@ -521,6 +812,7 @@
|
|
|
521
812
|
wrap.appendChild(sectionRow(U.t('Appearance'), U.t('Look, background, accent color, zoom, posters, spoilers'), 'appearance'));
|
|
522
813
|
wrap.appendChild(sectionRow(U.t('Home'), U.t('The tab it opens on, the top menu, Home feeds, Search results'), 'home'));
|
|
523
814
|
wrap.appendChild(sectionRow(U.t('Diagnostics'), U.t('Logs, storage, installed apps; how StremioK was installed'), 'diagnostics'));
|
|
815
|
+
if (typeof Profiles !== 'undefined') { wrap.appendChild(sectionRow(U.t('Profiles'), U.t('Who watches: each profile its own addons, settings, progress and accounts'), 'profiles')); }
|
|
524
816
|
if (typeof YTPlay !== 'undefined' && YTPlay.installMode && YTPlay.installMode() === 'tizenbrew') { wrap.appendChild(U.el('div', 'hint', TIZENBREW_NOTE)); }
|
|
525
817
|
focusBack(wrap);
|
|
526
818
|
}
|
|
@@ -666,6 +958,16 @@
|
|
|
666
958
|
acct.__onselect = stremioImport;
|
|
667
959
|
wrap.appendChild(acct);
|
|
668
960
|
}
|
|
961
|
+
if (typeof NuvioImport !== 'undefined') {
|
|
962
|
+
var nacct = U.el('div', 'addon-item focusable add-row');
|
|
963
|
+
var nn = U.el('div', 'a-name', U.t('Import addons from Nuvio'));
|
|
964
|
+
nn.appendChild(originBadge('nuvio'));
|
|
965
|
+
nacct.appendChild(nn);
|
|
966
|
+
nacct.appendChild(U.el('div', 'a-url', typeof NuvioSync !== 'undefined' && NuvioSync.isConnected() && !NuvioSync.connectStatus().reconnect ? U.t('From the Nuvio account connected in Integrations: tick the addons to add')
|
|
967
|
+
: U.t('Sign in on your phone with a QR code, then tick the addons to add (StremioK signs out straight after)')));
|
|
968
|
+
nacct.__onselect = nuvioAddonsImport;
|
|
969
|
+
wrap.appendChild(nacct);
|
|
970
|
+
}
|
|
669
971
|
if (typeof YTPlay !== 'undefined' && YTPlay.aiomAddons && YTPlay.installMode() !== 'browser') {
|
|
670
972
|
var am = aiomSaved();
|
|
671
973
|
var aio = U.el('div', 'addon-item focusable');
|
|
@@ -713,6 +1015,48 @@
|
|
|
713
1015
|
});
|
|
714
1016
|
});
|
|
715
1017
|
}
|
|
1018
|
+
// Import addons from Nuvio: the connected account's (its kept session; the profile it follows
|
|
1019
|
+
// first), else Nuvio's sign-in, read and signed out at once; a profile picked (if several),
|
|
1020
|
+
// then its addons to tick, as Stremio's.
|
|
1021
|
+
function nuvioAddonsImport() {
|
|
1022
|
+
function chooseFrom(list, first) {
|
|
1023
|
+
list = list.filter(function (p) { return p.addons.length; });
|
|
1024
|
+
if (!list.length) { U.toast(U.t('That Nuvio account has no addons StremioK can use'), 5000); return; }
|
|
1025
|
+
if (list.length === 1) { nuvioAddonPick(list[0]); return; }
|
|
1026
|
+
pickList(U.t('Which Nuvio profile?'), list.map(function (p, i) { return ['' + i, p.name + ' · ' + U.tn(p.addons.length, '{n} addon', '{n} addons')]; }),
|
|
1027
|
+
first != null ? '' + Math.max(0, list.map(function (p) { return p.index; }).indexOf(first)) : null, function (i) { nuvioAddonPick(list[+i]); });
|
|
1028
|
+
}
|
|
1029
|
+
if (typeof NuvioSync !== 'undefined' && NuvioSync.isConnected() && !NuvioSync.connectStatus().reconnect) {
|
|
1030
|
+
U.spinner(true);
|
|
1031
|
+
NuvioSync.session().then(function (s) { return NuvioImport.readAddons(s.cfg, s.token, true).then(function (list) { U.spinner(false); chooseFrom(list, s.profile); }); }).then(null, function (e) {
|
|
1032
|
+
U.spinner(false);
|
|
1033
|
+
U.toast(U.t('Couldn’t import: {why}', { why: (e && e.message) || U.t('unknown') }), 5000);
|
|
1034
|
+
});
|
|
1035
|
+
return;
|
|
1036
|
+
}
|
|
1037
|
+
nuvioSignIn(U.t('Import addons from Nuvio'), U.t('Sign in to Nuvio there and approve (Nuvio calls it signing in a TV). StremioK reads your addons once, then signs out. Waiting…'), function (cfg, tok, body, gone) {
|
|
1038
|
+
return NuvioImport.readAddons(cfg, tok.access).then(function (list) {
|
|
1039
|
+
if (gone()) { return; }
|
|
1040
|
+
closeModal();
|
|
1041
|
+
chooseFrom(list, null);
|
|
1042
|
+
});
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1045
|
+
function nuvioAddonPick(p) {
|
|
1046
|
+
var mine = Stremio.getAddonUrls();
|
|
1047
|
+
var items = p.addons.map(function (x, i) {
|
|
1048
|
+
var u = (Stremio.normalizeAddonUrl && Stremio.normalizeAddonUrl(x.url)) || x.url;
|
|
1049
|
+
return { key: '' + i, label: (x.name || shortHost(x.url)) + ' · ' + shortHost(x.url), have: mine.indexOf(x.url) !== -1 || mine.indexOf(u) !== -1 };
|
|
1050
|
+
});
|
|
1051
|
+
pickMany(U.t('Nuvio’s “{name}” addons: tick the ones to add', { name: p.name }), items, { button: function (n) { return U.tn(n, 'Import {n} addon', 'Import {n} addons'); } }, function (keys) {
|
|
1052
|
+
var n = 0, last = null;
|
|
1053
|
+
keys.forEach(function (k) { var added = Stremio.addAddon(p.addons[+k].url); if (added) { n++; last = added; if (Stremio.setAddonOrigin) { Stremio.setAddonOrigin(added, 'nuvio'); } } });
|
|
1054
|
+
clearCatalogCache();
|
|
1055
|
+
refreshAddonRows(last);
|
|
1056
|
+
U.toast(U.tn(n, 'Imported {n} addon', 'Imported {n} addons'), 3000);
|
|
1057
|
+
renderSettings();
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
716
1060
|
function importPick(list) {
|
|
717
1061
|
if (!list.length) { U.toast(U.t('Your Stremio account has no addons StremioK can use'), 5000); return; }
|
|
718
1062
|
var mine = Stremio.getAddonUrls();
|
|
@@ -788,7 +1132,7 @@
|
|
|
788
1132
|
// refuses is forgotten (the address stays) and asked for again.
|
|
789
1133
|
var AIOM_KEY = 'stremiok.aiomanager';
|
|
790
1134
|
// Where an addon came from (Stremio.addonOrigin): a letter badge, and the words for it.
|
|
791
|
-
var ORIGIN_BADGE = { stremio: ['S', 'src-s', U.t('From Stremio')], aiomanager: ['A', 'src-a', U.t('From AIOManager')], config: ['C', 'src-c', U.t('From a configuration file')] };
|
|
1135
|
+
var ORIGIN_BADGE = { stremio: ['S', 'src-s', U.t('From Stremio')], aiomanager: ['A', 'src-a', U.t('From AIOManager')], config: ['C', 'src-c', U.t('From a configuration file')], nuvio: ['N', 'src-n', U.t('From Nuvio')] };
|
|
792
1136
|
function originBadge(kind) { var b = ORIGIN_BADGE[kind]; return b ? U.el('span', 'src-badge ' + b[1], b[0]) : null; }
|
|
793
1137
|
function aiomSaved() {
|
|
794
1138
|
var x = U.store.get(AIOM_KEY, {}) || {};
|
|
@@ -929,9 +1273,26 @@
|
|
|
929
1273
|
// A configuration file's text: what it has listed, none ticked, to tick and import. here():
|
|
930
1274
|
// the entry screen still showing (back to Settings from it). Imported settings: StremioK
|
|
931
1275
|
// starts again with them.
|
|
932
|
-
function importText(text, here) {
|
|
1276
|
+
function importText(text, here, intoThis) {
|
|
933
1277
|
var parsed = Stremio.parseSetupList(text);
|
|
934
1278
|
if (!parsed.items.length) { U.toast(U.t('No supported entries found in that file') + (parsed.ignored ? ' ' + U.t('({n} ignored)', { n: parsed.ignored }) : ''), 4500); return; }
|
|
1279
|
+
// (into this profile, or a new one: made, the file kept for it, and StremioK started in it,
|
|
1280
|
+
// where it's listed to tick: js/profiles.js)
|
|
1281
|
+
if (!intoThis && typeof Profiles !== 'undefined' && Profiles.list().length < Profiles.MAX && Profiles.list().length !== Profiles.MAX) {
|
|
1282
|
+
var fromName = parsed.profile && parsed.profile.name;
|
|
1283
|
+
pickList(U.t('Import it into'), [['this', U.t('This profile')], ['new', fromName ? U.t('A new profile: “{name}”', { name: fromName }) : U.t('A new profile')]], 'this', function (v) {
|
|
1284
|
+
if (v === 'this') { importText(text, here, true); return; }
|
|
1285
|
+
function make(name) {
|
|
1286
|
+
var p = Profiles.add(name, parsed.profile && parsed.profile.color, U.t('Profile {n}', { n: 1 }));
|
|
1287
|
+
if (!p) { U.toast(U.t('Up to {n} profiles', { n: Profiles.MAX }), 4000); return; }
|
|
1288
|
+
try { window.localStorage.setItem(Profiles.keyFor(p.slot, 'stremiok.importpending'), JSON.stringify(('' + text).slice(0, 1572864))); } catch (e) {}
|
|
1289
|
+
if (here()) { App.back(); }
|
|
1290
|
+
V.switchProfile(p.id);
|
|
1291
|
+
}
|
|
1292
|
+
if (fromName) { make(fromName); } else { profileName(U.t('New profile'), '', make); }
|
|
1293
|
+
});
|
|
1294
|
+
return;
|
|
1295
|
+
}
|
|
935
1296
|
if (here()) { App.back(); renderSettings(); }
|
|
936
1297
|
pickMany(U.t('In that file: tick what to import'), parsed.items.map(function (it, i) { return { key: '' + i, label: it.label, have: it.have, note: it.note }; }),
|
|
937
1298
|
{ button: function (n) { return U.t('Import {n}', { n: n }); } }, function (keys) {
|
|
@@ -1088,7 +1449,7 @@
|
|
|
1088
1449
|
if (!st.url) { return U.t('Not read yet'); }
|
|
1089
1450
|
parts.push(U.tn(st.count || 0, '{n} channel', '{n} channels', { n: thousands(st.count || 0) }) + (st.groups ? ' ' + U.tn(st.groups, 'in {n} group', 'in {n} groups') : ''));
|
|
1090
1451
|
if (st.fetchedAt) { var d = new Date(st.fetchedAt); parts.push(U.t('downloaded {when}', { when: U.dayLabel(st.fetchedAt) + ' ' + two(d.getHours()) + ':' + two(d.getMinutes()) })); }
|
|
1091
|
-
if (st.dropped) { parts.push(U.t('{n} more left out (a playlist keeps its first
|
|
1452
|
+
if (st.dropped) { parts.push(U.t('{n} more left out (a playlist keeps its first {max}: Largest playlist, below)', { n: thousands(st.dropped), max: thousands(IPTV.maxChannels()) })); }
|
|
1092
1453
|
if (p.genres) { parts.push(U.tn(p.genres.length, '{n} group chosen', '{n} groups chosen')); }
|
|
1093
1454
|
if (st.cut) { parts.push(st.cut > 0 ? U.t('stopped short of {n}: OK on it, then Channel groups, reads only what you want', { n: thousands(st.cut) }) : U.t('stopped short: OK on it, then Channel groups, reads only what you want')); }
|
|
1094
1455
|
if (st.uncached) { parts.push(U.t('too large to save on the TV: downloaded each launch')); }
|
|
@@ -1111,7 +1472,7 @@
|
|
|
1111
1472
|
function playlistProblem(p) {
|
|
1112
1473
|
var st = Stremio.iptvStatus(p.id);
|
|
1113
1474
|
if (p.off || !st.error) { return ''; }
|
|
1114
|
-
return '⚠ ' + (st.stale ? U.t('Couldn’t refresh it (showing the saved copy):') + ' ' : '') + st.error;
|
|
1475
|
+
return '⚠ ' + (st.stale ? U.t('Couldn’t refresh it (showing the saved copy):') + ' ' : '') + st.error + (/^Too large/.test(st.error) ? ' — ' + U.t('see Largest playlist, below') : '');
|
|
1115
1476
|
}
|
|
1116
1477
|
// + Add Xtream account: its server, username and password, a page each (a whole Xtream link
|
|
1117
1478
|
// in the server's fills the rest); checked with the server, then added (Stremio.iptvAddXtream).
|
|
@@ -1331,6 +1692,23 @@
|
|
|
1331
1692
|
wrap.appendChild(subPickRow(U.t('Auto-refresh'), IPTV_EVERY, 'every',
|
|
1332
1693
|
{ get: function () { return { every: String(Stremio.iptvRefreshEvery()) }; }, set: function (c) { Stremio.iptvSetRefreshEvery(+c.every); } }));
|
|
1333
1694
|
}
|
|
1695
|
+
// Largest playlist: what one may be (MB) and keep (channels); raised, the playlists it
|
|
1696
|
+
// cut short or refused are read again.
|
|
1697
|
+
var IPTV_SIZES = IPTV.SIZES.map(function (n) {
|
|
1698
|
+
var v = { mb: n, n: thousands(n * 1500) };
|
|
1699
|
+
return [String(n), n === 20 ? U.t('{mb} MB, up to {n} channels (default)', v) : U.t('{mb} MB, up to {n} channels', v)];
|
|
1700
|
+
});
|
|
1701
|
+
wrap.appendChild(subPickRow(U.t('Largest playlist'), IPTV_SIZES, 'size', {
|
|
1702
|
+
warning: U.t('Above 20 MB, an older TV may run out of memory and close StremioK; a big playlist takes longer to read, and may be too large to save on the TV'),
|
|
1703
|
+
get: function () { return { size: String(IPTV.sizeMb()) }; },
|
|
1704
|
+
set: function (c) {
|
|
1705
|
+
var was = IPTV.sizeMb();
|
|
1706
|
+
IPTV.setSizeMb(+c.size);
|
|
1707
|
+
if (IPTV.sizeMb() <= was) { return; }
|
|
1708
|
+
playlists.filter(function (p) { var st = Stremio.iptvStatus(p.id); return !p.off && !IPTV.isStalker(p) && (st.dropped || /^Too large/.test(st.error || '')); })
|
|
1709
|
+
.forEach(function (p) { Stremio.iptvReload(p.id).then(function () { refreshAddonRows('local:iptv'); }); });
|
|
1710
|
+
}
|
|
1711
|
+
}));
|
|
1334
1712
|
wrap.appendChild(subPickRow(U.t('Stalker channels'), [['pages', U.t('First 100 pages (about 1,400 channels)')], ['all', U.t('Whole portal (up to 30,000 channels)')]], 'stalker', {
|
|
1335
1713
|
warning: U.t('Whole portal can take many minutes on every Reload and Auto-refresh, the IPTV rows wait for a first read, and a portal may slow down, cut off or block a MAC address that asks so much'),
|
|
1336
1714
|
get: function () { return { stalker: IPTV.stalkerAll() ? 'all' : 'pages' }; },
|
|
@@ -1574,6 +1952,7 @@
|
|
|
1574
1952
|
|
|
1575
1953
|
// Your Stremio account, kept in step (js/stremio-sync.js)
|
|
1576
1954
|
if (typeof StremioSync !== 'undefined' && typeof StremioAccount !== 'undefined') {
|
|
1955
|
+
if (typeof NuvioSync !== 'undefined') { wrap.appendChild(U.el('h2', null, U.t('Nuvio account'))); wrap.appendChild(nuvioAccountRow()); }
|
|
1577
1956
|
wrap.appendChild(U.el('h2', null, U.t('Stremio account')));
|
|
1578
1957
|
wrap.appendChild(stremioAccountRow());
|
|
1579
1958
|
wrap.appendChild(U.el('div', 'hint', U.t('Connect your Stremio account (sign in on your phone): its Continue Watching, watched marks and Library then sync with StremioK, both ways.')));
|
|
@@ -1665,6 +2044,24 @@
|
|
|
1665
2044
|
|
|
1666
2045
|
// Your Stremio account: connected (who, when it last synced, OK for Sync now / Disconnect), or
|
|
1667
2046
|
// not (OK to connect: Stremio's sign-in code, as the addon import).
|
|
2047
|
+
// This profile kept in step with a Nuvio account's profile (js/nuvio-sync.js).
|
|
2048
|
+
function nuvioAccountRow() {
|
|
2049
|
+
var st = NuvioSync.connectStatus(), r = U.el('div', 'addon-item focusable cfg-row');
|
|
2050
|
+
function two(x) { return (x < 10 ? '0' : '') + x; }
|
|
2051
|
+
var d = st.lastSync ? new Date(st.lastSync) : null;
|
|
2052
|
+
r.appendChild(U.el('div', 'a-name', U.t('Nuvio account') + (st.connected && st.name ? ': ' + st.name : '')));
|
|
2053
|
+
r.appendChild(U.el('div', 'a-url', st.connected && st.reconnect ? U.t('Its sign-in no longer works — press OK to connect again')
|
|
2054
|
+
: st.connected ? (d ? U.t('Last synced {when}', { when: (U.dayLabel ? U.dayLabel(st.lastSync) + ' ' : '') + two(d.getHours()) + ':' + two(d.getMinutes()) }) : U.t('Not synced yet')) + (st.err ? ' · ⚠ ' + st.err : '') + ' · ' + U.t('OK for options')
|
|
2055
|
+
: U.t('Not connected — press OK to connect (where you stopped, watched marks and Library, both ways)')));
|
|
2056
|
+
r.__onselect = function () {
|
|
2057
|
+
if (!st.connected || st.reconnect) { if (st.reconnect) { NuvioSync.disconnect(); } nuvioConnect(null); return; }
|
|
2058
|
+
pickList(U.t('Nuvio account'), [['now', U.t('Sync now')], ['off', U.t('Disconnect')]], null, function (v) {
|
|
2059
|
+
if (v === 'now') { U.toast(U.t('Syncing with Nuvio…')); NuvioSync.sync().then(function () { markHomeDirty(); renderSettings(); }); }
|
|
2060
|
+
else if (v === 'off') { confirm(U.t('Disconnect from Nuvio? Nothing here is removed.'), U.t('Disconnect'), function () { NuvioSync.disconnect(); U.toast(U.t('Disconnected from Nuvio')); renderSettings(); }); }
|
|
2061
|
+
});
|
|
2062
|
+
};
|
|
2063
|
+
return r;
|
|
2064
|
+
}
|
|
1668
2065
|
function stremioAccountRow() {
|
|
1669
2066
|
var st = StremioSync.connectStatus(), r = U.el('div', 'addon-item focusable cfg-row');
|
|
1670
2067
|
function two(x) { return (x < 10 ? '0' : '') + x; }
|
|
@@ -3014,5 +3411,6 @@
|
|
|
3014
3411
|
V.backInSettings = backInSettings;
|
|
3015
3412
|
V.renderEntry = renderEntry;
|
|
3016
3413
|
V.renderSettings = renderSettings;
|
|
3414
|
+
V.importText = function (text) { ++_importGen; importText(text, function () { return false; }, true); }; // (a file imported as a new profile, once it's in use: js/app.js)
|
|
3017
3415
|
V.settingsRoot = settingsRoot;
|
|
3018
3416
|
})(ViewParts);
|
package/js/views.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
var Views = (function (V) {
|
|
6
6
|
'use strict';
|
|
7
7
|
return {
|
|
8
|
-
renderHome: V.renderHome, renderDetail: V.renderDetail, applyAppearance: V.applyAppearance,
|
|
8
|
+
renderHome: V.renderHome, renderDetail: V.renderDetail, applyAppearance: V.applyAppearance, profilePicker: V.profilePicker, switchProfile: V.switchProfile, importText: V.importText,
|
|
9
9
|
renderPerson: V.renderPerson, detailSnapshot: V.detailSnapshot, restoreDetail: V.restoreDetail, lightSnapshot: V.lightSnapshot, renderSettings: V.renderSettings,
|
|
10
10
|
settingsRoot: V.settingsRoot, backInSettings: V.backInSettings, guideBackOn: V.guideBackOn,
|
|
11
11
|
// a screen left: its downloads still running (a title page's details, Discover's
|
package/package.json
CHANGED
package/tizenbrew.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// from there: it opens this version's own copy (npm/stremiok@<version>/index.html), whose
|
|
11
11
|
// files all come from that address. build.sh stamps the ?v= below.
|
|
12
12
|
(function () {
|
|
13
|
-
var v = '?v=2.
|
|
13
|
+
var v = '?v=2.4.1'.slice(3), l = location, rest = (l.search || '') + (l.hash || '');
|
|
14
14
|
var m = /^(\/module\/npm%2F[^\/%@]+)\//i.exec(l.pathname || '');
|
|
15
15
|
l.replace(m ? m[1] + '%40' + v + '/index.html' + rest : 'index.html' + rest);
|
|
16
16
|
})();
|