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/jellyfin.js
CHANGED
|
@@ -117,7 +117,7 @@ var Jellyfin = (function () {
|
|
|
117
117
|
}
|
|
118
118
|
function addressProblem(v) {
|
|
119
119
|
var s = normAddress(v), p = /^https?:\/\//i.test(s) ? U.parseUrl(s) : null;
|
|
120
|
-
return p && p.host ? null : 'An address like http://192.168.0.50:8096';
|
|
120
|
+
return p && p.host ? null : U.t('An address like http://192.168.0.50:8096');
|
|
121
121
|
}
|
|
122
122
|
// What answers there: a Jellyfin (10.9 or newer) or Emby (4.7 or newer) server, its kind, name
|
|
123
123
|
// and version. Asked at the address, then under /emby (an Emby that answers only there).
|
|
@@ -125,20 +125,20 @@ var Jellyfin = (function () {
|
|
|
125
125
|
var url = normAddress(address);
|
|
126
126
|
function info() { return U.getJSON(url + '/System/Info/Public', 10000, 65536).then(null, function (e) { return U.getJSON(url + '/emby/System/Info/Public', 10000, 65536).then(null, function () { throw e; }); }); }
|
|
127
127
|
return info().then(function (r) {
|
|
128
|
-
if (!r || typeof r !== 'object' || !r.Id || !r.Version) { throw new Error('That address doesn’t answer as a Jellyfin or Emby server.'); }
|
|
128
|
+
if (!r || typeof r !== 'object' || !r.Id || !r.Version) { throw new Error(U.t('That address doesn’t answer as a Jellyfin or Emby server.')); }
|
|
129
129
|
// (Jellyfin always names itself, "Jellyfin Server"; Emby usually sends no ProductName at
|
|
130
130
|
// all: one that doesn't say Jellyfin is Emby when it says so or its version is Emby's, 4.x)
|
|
131
131
|
var v = ('' + r.Version).split('.').map(function (x) { return parseInt(x, 10) || 0; }), pn = '' + (r.ProductName || '');
|
|
132
132
|
var kind = /jellyfin/i.test(pn) ? 'jellyfin' : (/emby/i.test(pn) || v[0] < 10) ? 'emby' : 'jellyfin';
|
|
133
|
-
if (kind === 'jellyfin' && !(v[0] > 10 || (v[0] === 10 && v[1] >= 9))) { throw new Error('Jellyfin
|
|
134
|
-
if (kind === 'emby' && !(v[0] > 4 || (v[0] === 4 && v[1] >= 7))) { throw new Error('Emby
|
|
133
|
+
if (kind === 'jellyfin' && !(v[0] > 10 || (v[0] === 10 && v[1] >= 9))) { throw new Error(U.t('Jellyfin {v} is too old: 10.9 or newer is needed.', { v: r.Version })); }
|
|
134
|
+
if (kind === 'emby' && !(v[0] > 4 || (v[0] === 4 && v[1] >= 7))) { throw new Error(U.t('Emby {v} is too old: 4.7 or newer is needed.', { v: r.Version })); }
|
|
135
135
|
return { url: url, kind: kind, serverId: '' + r.Id, name: ('' + (r.ServerName || KINDS[kind].name)).replace(/\s+/g, ' ').trim().slice(0, 60) || KINDS[kind].name, version: ('' + r.Version).slice(0, 20) };
|
|
136
|
-
}, function (e) { throw new Error('No answer from '
|
|
136
|
+
}, function (e) { throw new Error(U.t('No answer from {link} ({why}).', { link: url, why: U.problem(e) })); });
|
|
137
137
|
}
|
|
138
138
|
function kindName(s) { return K(s).name; }
|
|
139
139
|
// Signed in: kept (the same server and user again: in its place, its id kept).
|
|
140
140
|
function added(info, r) {
|
|
141
|
-
if (!r || !r.AccessToken || !r.User || !r.User.Id) { throw new Error(
|
|
141
|
+
if (!r || !r.AccessToken || !r.User || !r.User.Id) { throw new Error(U.t('{server} didn’t sign in.', { server: kindName(info) })); }
|
|
142
142
|
var list = allServers(), old = list.filter(function (s) { return s.serverId === info.serverId && s.userId === '' + r.User.Id; })[0];
|
|
143
143
|
var srv = { id: old ? old.id : 's' + rand(8), url: info.url, kind: kindOf(info), serverId: info.serverId, name: info.name, version: info.version,
|
|
144
144
|
user: ('' + (r.User.Name || '')).slice(0, 60), userId: '' + r.User.Id, token: '' + r.AccessToken, at: Date.now() };
|
|
@@ -158,7 +158,7 @@ var Jellyfin = (function () {
|
|
|
158
158
|
return U.getJSON(api(info) + '/Users/AuthenticateByName', 15000, 1048576, null, headers(info, '', true), JSON.stringify({ Username: '' + user, Pw: '' + pass })).then(function (r) {
|
|
159
159
|
return withLibs(added(info, r));
|
|
160
160
|
}, function (e) {
|
|
161
|
-
throw new Error(/HTTP 401/.test(e && e.message) ? 'Wrong user name or password.' : 'Couldn’t sign in ('
|
|
161
|
+
throw new Error(/HTTP 401/.test(e && e.message) ? U.t('Wrong user name or password.') : U.t('Couldn’t sign in ({why}).', { why: U.problem(e) }));
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
// Quick Connect: a code for you to enter in Jellyfin, then asked every QC_EVERY whether it
|
|
@@ -168,10 +168,10 @@ var Jellyfin = (function () {
|
|
|
168
168
|
function fail(msg) { if (!stopped) { stopped = true; cb.onError(msg); } }
|
|
169
169
|
U.getJSON(info.url + '/QuickConnect/Enabled', 10000, 4096, null, headers(info, ''), null, true).then(function (on) {
|
|
170
170
|
if (stopped) { return; }
|
|
171
|
-
if (on !== true) { fail('Quick Connect is off on this server: turn it on in Jellyfin (Dashboard › General), or sign in with a password.'); return; }
|
|
171
|
+
if (on !== true) { fail(U.t('Quick Connect is off on this server: turn it on in Jellyfin (Dashboard › General), or sign in with a password.')); return; }
|
|
172
172
|
return U.getJSON(info.url + '/QuickConnect/Initiate', 10000, 65536, null, headers(info, '', true), '').then(function (r) {
|
|
173
173
|
if (stopped) { return; }
|
|
174
|
-
if (!r || !r.Secret || !r.Code) { fail('Jellyfin didn’t give a code.'); return; }
|
|
174
|
+
if (!r || !r.Secret || !r.Code) { fail(U.t('Jellyfin didn’t give a code.')); return; }
|
|
175
175
|
cb.onCode('' + r.Code);
|
|
176
176
|
function signedIn() {
|
|
177
177
|
U.getJSON(info.url + '/Users/AuthenticateWithQuickConnect', 15000, 1048576, null, headers(info, '', true), JSON.stringify({ Secret: r.Secret })).then(function (a) {
|
|
@@ -181,24 +181,24 @@ var Jellyfin = (function () {
|
|
|
181
181
|
stopped = true;
|
|
182
182
|
cb.onSuccess(srv);
|
|
183
183
|
});
|
|
184
|
-
}).then(null, function (e) { fail('Couldn’t sign in ('
|
|
184
|
+
}).then(null, function (e) { fail(U.t('Couldn’t sign in ({why}).', { why: U.problem(e) })); });
|
|
185
185
|
}
|
|
186
186
|
function poll() {
|
|
187
187
|
timer = setTimeout(function () {
|
|
188
188
|
if (stopped) { return; }
|
|
189
|
-
if (Date.now() > until) { fail('The code expired: try again.'); return; }
|
|
189
|
+
if (Date.now() > until) { fail(U.t('The code expired: try again.')); return; }
|
|
190
190
|
U.getJSON(info.url + '/QuickConnect/Connect?secret=' + enc(r.Secret), 10000, 65536, null, headers(info, ''), null, true).then(function (s) {
|
|
191
191
|
if (stopped) { return; }
|
|
192
192
|
if (s && s.Authenticated) { signedIn(); } else { poll(); }
|
|
193
193
|
}, function (e) {
|
|
194
194
|
if (stopped) { return; }
|
|
195
|
-
if (/HTTP 404/.test(e && e.message)) { fail('The code expired: try again.'); } else { poll(); }
|
|
195
|
+
if (/HTTP 404/.test(e && e.message)) { fail(U.t('The code expired: try again.')); } else { poll(); }
|
|
196
196
|
});
|
|
197
197
|
}, QC_EVERY);
|
|
198
198
|
}
|
|
199
199
|
poll();
|
|
200
200
|
});
|
|
201
|
-
}).then(null, function (e) { fail('Couldn’t start Quick Connect ('
|
|
201
|
+
}).then(null, function (e) { fail(U.t('Couldn’t start Quick Connect ({why}).', { why: U.problem(e) })); });
|
|
202
202
|
return function () { stopped = true; clearTimeout(timer); };
|
|
203
203
|
}
|
|
204
204
|
// Sign out and remove: its sign-in ended on the server too (if it answers).
|
|
@@ -242,7 +242,7 @@ var Jellyfin = (function () {
|
|
|
242
242
|
_libsAsked[srv.id] = true; // (once a launch, unless asked)
|
|
243
243
|
return get(srv, K(srv).views(uid(srv))).then(function (r) {
|
|
244
244
|
var list = U.listOf(r && r.Items, 50, function (x) { return x.Id && (x.CollectionType === 'movies' || x.CollectionType === 'tvshows'); }).map(function (x) {
|
|
245
|
-
return { id: '' + x.Id, name: ('' + (x.Name || '')).replace(/\s+/g, ' ').trim().slice(0, 60) || (x.CollectionType === 'movies' ? 'Movies' : 'Shows'), type: x.CollectionType === 'movies' ? 'movie' : 'series' };
|
|
245
|
+
return { id: '' + x.Id, name: ('' + (x.Name || '')).replace(/\s+/g, ' ').trim().slice(0, 60) || (x.CollectionType === 'movies' ? U.t('Movies') : U.t('Shows')), type: x.CollectionType === 'movies' ? 'movie' : 'series' };
|
|
246
246
|
});
|
|
247
247
|
if (!server(srv.id)) { return; } // (removed meanwhile)
|
|
248
248
|
var all = libsAll(), keep = {}, before = JSON.stringify(all[srv.id] && all[srv.id].list);
|
|
@@ -264,8 +264,8 @@ var Jellyfin = (function () {
|
|
|
264
264
|
servers(kind).forEach(function (srv) {
|
|
265
265
|
var libs = libsOf(srv), on = many ? ' · ' + srv.name : ''; // (Home adds “Jellyfin” / “Emby”)
|
|
266
266
|
if (!libs.length) { return; } // (its libraries not read yet, or none)
|
|
267
|
-
if (libs.some(function (l) { return l.type === 'movie'; })) { out.push({ type: 'movie', id: 'jf.' + srv.id + '.resume', name: 'Continue watching' + on, extra: [] }); }
|
|
268
|
-
if (libs.some(function (l) { return l.type === 'series'; })) { out.push({ type: 'series', id: 'jf.' + srv.id + '.nextup', name: 'Next up' + on, extra: [] }); }
|
|
267
|
+
if (libs.some(function (l) { return l.type === 'movie'; })) { out.push({ type: 'movie', id: 'jf.' + srv.id + '.resume', name: U.t('Continue watching') + on, extra: [] }); }
|
|
268
|
+
if (libs.some(function (l) { return l.type === 'series'; })) { out.push({ type: 'series', id: 'jf.' + srv.id + '.nextup', name: U.t('Next up') + on, extra: [] }); }
|
|
269
269
|
libs.forEach(function (lib) {
|
|
270
270
|
out.push({ type: lib.type, id: 'jf.' + srv.id + '.' + lib.id, name: lib.name + (many ? ' · ' + srv.name : ''), extra: [{ name: 'search' }, { name: 'skip' }] });
|
|
271
271
|
});
|
|
@@ -387,12 +387,12 @@ var Jellyfin = (function () {
|
|
|
387
387
|
if (Array.isArray(it.Genres) && it.Genres.length) { m.genres = it.Genres.slice(0, 12).map(String); }
|
|
388
388
|
if (names(it.People, 'Actor').length) { m.cast = names(it.People, 'Actor'); }
|
|
389
389
|
if (names(it.People, 'Director').length) { m.director = names(it.People, 'Director'); }
|
|
390
|
-
if (+it.RunTimeTicks > 0) { m.runtime = Math.round(it.RunTimeTicks / TICKS / 60)
|
|
390
|
+
if (+it.RunTimeTicks > 0) { m.runtime = U.t('{n} min', { n: Math.round(it.RunTimeTicks / TICKS / 60) }); }
|
|
391
391
|
if (m.releaseInfo) { m.year = m.releaseInfo; }
|
|
392
392
|
if (t === 'movie') { return m; }
|
|
393
393
|
return episodes(srv, it.Id).then(function (eps) {
|
|
394
394
|
m.videos = eps.map(function (e) {
|
|
395
|
-
var v = { id: showId + ':' + e.season + ':' + e.episode, season: e.season, episode: e.episode, title: ('' + (e.it.Name || '')).trim() || 'Episode '
|
|
395
|
+
var v = { id: showId + ':' + e.season + ':' + e.episode, season: e.season, episode: e.episode, title: ('' + (e.it.Name || '')).trim() || U.t('Episode {n}', { n: e.episode }) };
|
|
396
396
|
if (e.it.Overview) { v.overview = ('' + e.it.Overview).slice(0, 1000); }
|
|
397
397
|
if (e.it.ImageTags && e.it.ImageTags.Primary) { v.thumbnail = img(srv, e.it.Id, 'Primary', e.it.ImageTags.Primary, 'maxWidth=640'); }
|
|
398
398
|
var rel = Date.parse(e.it.PremiereDate || '');
|
|
@@ -815,7 +815,7 @@ var Jellyfin = (function () {
|
|
|
815
815
|
var ch = jf.ch || {}, more = [];
|
|
816
816
|
out = out || { intro: [], recap: [], credits: [], preview: [], from: {} };
|
|
817
817
|
['intro', 'recap', 'credits', 'preview'].forEach(function (k) {
|
|
818
|
-
if (!out[k].length && U.listOf(ch[k], 10).length) { out[k] = U.listOf(ch[k], 10); out.from[k] =
|
|
818
|
+
if (!out[k].length && U.listOf(ch[k], 10).length) { out[k] = U.listOf(ch[k], 10); out.from[k] = U.t('{server}’s chapters', { server: name }); more.push(k); }
|
|
819
819
|
});
|
|
820
820
|
if (asked) { asked.push(name + ': ' + (has.length ? has.join(', ') : why) + (more.length ? '; its chapters: ' + more.join(', ') : '')); }
|
|
821
821
|
return has.length || more.length ? out : null;
|