stremiok 2.3.2 → 2.3.3
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 +18 -0
- package/README.md +10 -9
- package/config.xml +1 -1
- package/css/modern.css +1 -0
- package/css/style.css +5 -2
- package/index.html +39 -38
- package/js/jellyfin.js +59 -13
- package/js/local.js +99 -31
- package/js/netfolders.js +157 -0
- package/js/player-audio.js +25 -1
- package/js/player-controls.js +3 -2
- package/js/player-core.js +62 -15
- package/js/view-detail.js +4 -4
- package/js/view-home.js +18 -17
- package/js/view-settings.js +117 -3
- package/js/ytplay.js +1 -1
- package/package.json +1 -1
- package/service/index.js +353 -12
- package/tizenbrew.html +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
What changed in each version of StremioK, newest first. How everything works is in the
|
|
4
4
|
[user guide](docs/USER-GUIDE.md).
|
|
5
5
|
|
|
6
|
+
## 2.3.3 — 2026-11-08
|
|
7
|
+
- **After a lot of debugging & troubleshooting: TizenBrew has no TV player** (#17): the TV gives
|
|
8
|
+
its own player only to installed apps, so under TizenBrew a file with several audio tracks only
|
|
9
|
+
plays its first one. The audio menu, Settings › Playback › Audio and the installation guide now
|
|
10
|
+
say so; Diagnostics names the player in use.
|
|
11
|
+
- **Network folders (WebDAV)** (Settings › Content › Network folders): a folder a NAS, Nextcloud
|
|
12
|
+
or a computer running rclone shares, in the Local tab beside USB drives: browsed, matched,
|
|
13
|
+
indexed, its videos sources (*On your network folder*), with their subtitle files.
|
|
14
|
+
- **A network folder's sign-in** is kept on the TV and sent only to that folder.
|
|
15
|
+
- **Large Jellyfin catalogs:** when a server's list of titles doesn't come (too big or slow), a
|
|
16
|
+
title is searched for by name and taken only with the same IMDb or TMDB id; a film or episode
|
|
17
|
+
listed without its files gets them from the server.
|
|
18
|
+
- **A live channel's choppy sound** is repaired on raw MPEG-TS channels too (an Xtream account's
|
|
19
|
+
default), not only HLS ones; and it's your choice (Red): *straight from the server* or
|
|
20
|
+
*repacked by StremioK's service*, kept for that channel.
|
|
21
|
+
- **Fixed:** a cast or crew card cut off the role under a two-line name; under TizenBrew, a closed
|
|
22
|
+
player's video stayed loaded and could play behind the menus.
|
|
23
|
+
|
|
6
24
|
## 2.3.2 — 2026-11-07
|
|
7
25
|
- **TizenBrew runs one version at a time:** a TV could keep an old version, or a mix of two, for
|
|
8
26
|
hours after a release (2.3.0 with 2.3.1 listed, #17). TizenBrew now opens a start page that
|
package/README.md
CHANGED
|
@@ -29,13 +29,13 @@ video through Samsung's AVPlay API.
|
|
|
29
29
|
Tomatoes, Metacritic… with your own API keys), seasons and episodes with their own pages,
|
|
30
30
|
*Cast & more*, *More like this* and collections.
|
|
31
31
|
- **The player:** resume where you stopped, skip intros, recaps and credits, next episode,
|
|
32
|
-
subtitles (addons', the file's own, and your own files
|
|
32
|
+
subtitles (addons', the file's own, and your own files) with your choice of look, audio
|
|
33
33
|
tracks remembered, switching source mid-playback, private viewing.
|
|
34
34
|
- **IPTV and radio** from your M3U playlists, Xtream accounts and Stalker portals (with their
|
|
35
35
|
films and series), with CH+ / CH−.
|
|
36
36
|
- **YouTube:** live channels, trailers, and your own YouTube channels, playlists and searches,
|
|
37
37
|
with SponsorBlock, DeArrow, chapters and captions.
|
|
38
|
-
- **Local:** the videos on a USB drive, matched to their titles.
|
|
38
|
+
- **Local:** the videos on a USB drive or a network folder (WebDAV), matched to their titles.
|
|
39
39
|
- **Jellyfin, Emby and Plex:** your server's libraries on Home, its files as sources.
|
|
40
40
|
- **Torrents**, through Stremio's streaming server or a TorrServer you run on your network.
|
|
41
41
|
- **Made for the remote:** D-pad navigation throughout; ▶ Play on a movie, episode or channel plays
|
|
@@ -46,8 +46,9 @@ video through Samsung's AVPlay API.
|
|
|
46
46
|
|
|
47
47
|
Three ways, all covered step by step in the **[installation guide](docs/INSTALL.md)**:
|
|
48
48
|
|
|
49
|
-
- **TizenBrew** (Tizen 3.0 to 6.0): add the NPM module `stremiok`. No certificate needed
|
|
50
|
-
|
|
49
|
+
- **TizenBrew** (Tizen 3.0 to 6.0): add the NPM module `stremiok`. No certificate needed, but
|
|
50
|
+
[Web Player is limited](docs/INSTALL.md#tizenbrew-has-no-tv-player) (ie: no audio switching), and
|
|
51
|
+
storage shared with other modules.
|
|
51
52
|
- **Apps2Samsung:** installs a [release](https://github.com/Kepler75/StremioK/releases)'s
|
|
52
53
|
`.wgt`, signing it with your own Samsung certificate. No Tizen Studio needed.
|
|
53
54
|
- **Tizen Studio:** build the `.wgt` from this repository and sideload it.
|
|
@@ -63,7 +64,8 @@ Three ways, all covered step by step in the **[installation guide](docs/INSTALL.
|
|
|
63
64
|
3. **Trakt**, optional: connect your account to share watched marks and Continue Watching.
|
|
64
65
|
4. **IPTV**, optional: your M3U playlist links, an Xtream account (its server, username and
|
|
65
66
|
password) or a Stalker portal (its address and MAC address).
|
|
66
|
-
5. **A USB drive**, optional: plug
|
|
67
|
+
5. **A USB drive or network folder**, optional: plug a drive in, or add a WebDAV folder; the
|
|
68
|
+
Local tab appears.
|
|
67
69
|
|
|
68
70
|
[Getting started](docs/USER-GUIDE.md#getting-started) in the user guide walks through each.
|
|
69
71
|
|
|
@@ -94,8 +96,8 @@ responsibility.
|
|
|
94
96
|
|
|
95
97
|
- AVPlay behavior varies by TV generation, codec and HLS provider.
|
|
96
98
|
- Torrents play only through a streaming server you run on your network.
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
+
- Under TizenBrew there's no TV player (only the `.wgt` has it): one audio track per file, no
|
|
100
|
+
built-in subtitle tracks, no PlayReady or Widevine channels; opening apps depends on TizenBrew.
|
|
99
101
|
- No StremioK account and no profiles: settings, addons and progress stay on the TV. The
|
|
100
102
|
only sync is optional: Trakt (watched marks, Continue Watching, ratings).
|
|
101
103
|
- Subtitles use an HTML overlay; gzipped (`.gz`) subtitle files aren't decoded.
|
|
@@ -105,8 +107,7 @@ responsibility.
|
|
|
105
107
|
opens a one-time page StremioK serves on your home network. It's plain HTTP (unencrypted),
|
|
106
108
|
so use it only on a network you trust, since addon and playlist links often carry tokens.
|
|
107
109
|
- "Where to watch" sources open the app on its home screen, or on the title only where an
|
|
108
|
-
addon you added gives the app's own link and the app takes it.
|
|
109
|
-
depends on what TizenBrew allows its modules; the `.wgt` has the permission.
|
|
110
|
+
addon you added gives the app's own link and the app takes it.
|
|
110
111
|
- YouTube channels and trailers depend on the bundled service and on YouTube's
|
|
111
112
|
undocumented behavior, so YouTube changes may need resolver updates.
|
|
112
113
|
|
package/config.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets"
|
|
3
|
-
id="http://stremiok.tizen/StremioKTizen" version="2.3.
|
|
3
|
+
id="http://stremiok.tizen/StremioKTizen" version="2.3.3" viewmodes="maximized">
|
|
4
4
|
<tizen:application id="StremioK01.StremioK" package="StremioK01" required_version="3.0"/>
|
|
5
5
|
<content src="index.html"/>
|
|
6
6
|
<feature name="http://tizen.org/feature/screen.size.all"/>
|
package/css/modern.css
CHANGED
|
@@ -85,6 +85,7 @@ body.look-modern #screen-home .row-title { margin: 0 0 4px 90px; } /* (Home: i
|
|
|
85
85
|
body.look-modern #screen-home .row-scroller { padding: 26px 90px; }
|
|
86
86
|
body.look-modern .card { border: 0; border-radius: 16px; background: rgba(255,255,255,0.07); margin-right: 26px; }
|
|
87
87
|
body.look-modern .card .cap { padding: 20px 12px 8px 12px; font-size: 18px; line-height: 22px; max-height: 72px; background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.9)); } /* (two lines fit, a landscape poster's too) */
|
|
88
|
+
body.look-modern .card.person-card .cap { max-height: none; padding-top: 16px; } /* (a person's: as tall as name and role need; style.css) */
|
|
88
89
|
body.look-modern .card.focusable.focused { border: 0; box-shadow: 0 0 0 4px #fff; -webkit-transform: scale(1.06); transform: scale(1.06); }
|
|
89
90
|
body.look-modern .card.focusable.moving { border: 0; box-shadow: 0 0 0 4px #f59e0b; }
|
|
90
91
|
body.look-modern.fx-full .card { -webkit-transition: -webkit-transform 0.16s ease-out, box-shadow 0.16s ease-out; transition: transform 0.16s ease-out, box-shadow 0.16s ease-out; }
|
package/css/style.css
CHANGED
|
@@ -442,8 +442,11 @@ html, body {
|
|
|
442
442
|
.more-panel { top: 440px; left: 0; right: 0; bottom: 0; }
|
|
443
443
|
.more-rows { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; }
|
|
444
444
|
.card.person-card { width: 150px; height: 225px; }
|
|
445
|
-
|
|
446
|
-
|
|
445
|
+
/* A person's caption: the name in up to two lines, the role in one ("…" past it), the caption as
|
|
446
|
+
tall as they need (a fixed height cut the role off under a two-line name). */
|
|
447
|
+
.card.person-card .cap { max-height: none; padding-top: 18px; }
|
|
448
|
+
.card .cap .cap-name { font-weight: bold; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
|
|
449
|
+
.card .cap .cap-sub { font-size: 15px; color: #c7cbd4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
447
450
|
.person-photo { position: absolute; top: 116px; right: 80px; width: 220px; height: 330px; border-radius: 12px; background-size: cover; background-position: center top; }
|
|
448
451
|
|
|
449
452
|
/* --- Episode ratings grid --- */
|
package/index.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=1920, height=1080, user-scalable=no">
|
|
6
6
|
<title>StremioK</title>
|
|
7
|
-
<link rel="stylesheet" href="css/style.css?v=2.3.
|
|
8
|
-
<link rel="stylesheet" href="css/modern.css?v=2.3.
|
|
7
|
+
<link rel="stylesheet" href="css/style.css?v=2.3.3">
|
|
8
|
+
<link rel="stylesheet" href="css/modern.css?v=2.3.3">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<!-- CSS-applied sentinel (kept off-screen); app.js waits for its width before rendering -->
|
|
@@ -54,41 +54,42 @@
|
|
|
54
54
|
|
|
55
55
|
<!-- Load order matters: polyfills -> util -> iptv -> data -> input -> tvapps -> player parts -> player -> ytplay -> view parts -> views -> app -->
|
|
56
56
|
<!-- ?v= busts the TV webview cache on every release (keep in sync with package.json) -->
|
|
57
|
-
<script src="js/polyfills.js?v=2.3.
|
|
58
|
-
<script src="js/util.js?v=2.3.
|
|
59
|
-
<script src="js/iptv.js?v=2.3.
|
|
60
|
-
<script src="js/xtvod.js?v=2.3.
|
|
61
|
-
<script src="js/stvod.js?v=2.3.
|
|
62
|
-
<script src="js/jellyfin.js?v=2.3.
|
|
63
|
-
<script src="js/plex.js?v=2.3.
|
|
64
|
-
<script src="js/epg.js?v=2.3.
|
|
65
|
-
<script src="js/youtube.js?v=2.3.
|
|
66
|
-
<script src="js/stremio.js?v=2.3.
|
|
67
|
-
<script src="js/trakt.js?v=2.3.
|
|
68
|
-
<script src="js/keys.js?v=2.3.
|
|
69
|
-
<script src="js/focus.js?v=2.3.
|
|
70
|
-
<script src="js/tvapps.js?v=2.3.
|
|
71
|
-
<script src="js/player-core.js?v=2.3.
|
|
72
|
-
<script src="js/player-store.js?v=2.3.
|
|
73
|
-
<script src="js/player-lang.js?v=2.3.
|
|
74
|
-
<script src="js/player-quality.js?v=2.3.
|
|
75
|
-
<script src="js/player-subs.js?v=2.3.
|
|
76
|
-
<script src="js/player-audio.js?v=2.3.
|
|
77
|
-
<script src="js/player-controls.js?v=2.3.
|
|
78
|
-
<script src="js/player.js?v=2.3.
|
|
79
|
-
<script src="js/ytplay.js?v=2.3.
|
|
80
|
-
<script src="js/
|
|
81
|
-
<script src="js/
|
|
82
|
-
<script src="js/
|
|
83
|
-
<script src="js/
|
|
84
|
-
<script src="js/view-
|
|
85
|
-
<script src="js/view-
|
|
86
|
-
<script src="js/view-
|
|
87
|
-
<script src="js/view-
|
|
88
|
-
<script src="js/view-
|
|
89
|
-
<script src="js/view-
|
|
90
|
-
<script src="js/
|
|
91
|
-
<script src="js/
|
|
92
|
-
<script src="js/
|
|
57
|
+
<script src="js/polyfills.js?v=2.3.3"></script>
|
|
58
|
+
<script src="js/util.js?v=2.3.3"></script>
|
|
59
|
+
<script src="js/iptv.js?v=2.3.3"></script>
|
|
60
|
+
<script src="js/xtvod.js?v=2.3.3"></script>
|
|
61
|
+
<script src="js/stvod.js?v=2.3.3"></script>
|
|
62
|
+
<script src="js/jellyfin.js?v=2.3.3"></script>
|
|
63
|
+
<script src="js/plex.js?v=2.3.3"></script>
|
|
64
|
+
<script src="js/epg.js?v=2.3.3"></script>
|
|
65
|
+
<script src="js/youtube.js?v=2.3.3"></script>
|
|
66
|
+
<script src="js/stremio.js?v=2.3.3"></script>
|
|
67
|
+
<script src="js/trakt.js?v=2.3.3"></script>
|
|
68
|
+
<script src="js/keys.js?v=2.3.3"></script>
|
|
69
|
+
<script src="js/focus.js?v=2.3.3"></script>
|
|
70
|
+
<script src="js/tvapps.js?v=2.3.3"></script>
|
|
71
|
+
<script src="js/player-core.js?v=2.3.3"></script>
|
|
72
|
+
<script src="js/player-store.js?v=2.3.3"></script>
|
|
73
|
+
<script src="js/player-lang.js?v=2.3.3"></script>
|
|
74
|
+
<script src="js/player-quality.js?v=2.3.3"></script>
|
|
75
|
+
<script src="js/player-subs.js?v=2.3.3"></script>
|
|
76
|
+
<script src="js/player-audio.js?v=2.3.3"></script>
|
|
77
|
+
<script src="js/player-controls.js?v=2.3.3"></script>
|
|
78
|
+
<script src="js/player.js?v=2.3.3"></script>
|
|
79
|
+
<script src="js/ytplay.js?v=2.3.3"></script>
|
|
80
|
+
<script src="js/netfolders.js?v=2.3.3"></script>
|
|
81
|
+
<script src="js/local.js?v=2.3.3"></script>
|
|
82
|
+
<script src="js/downloads.js?v=2.3.3"></script>
|
|
83
|
+
<script src="js/stremio-account.js?v=2.3.3"></script>
|
|
84
|
+
<script src="js/view-core.js?v=2.3.3"></script>
|
|
85
|
+
<script src="js/view-home.js?v=2.3.3"></script>
|
|
86
|
+
<script src="js/view-guide.js?v=2.3.3"></script>
|
|
87
|
+
<script src="js/view-detail.js?v=2.3.3"></script>
|
|
88
|
+
<script src="js/view-search.js?v=2.3.3"></script>
|
|
89
|
+
<script src="js/view-settings.js?v=2.3.3"></script>
|
|
90
|
+
<script src="js/view-discover.js?v=2.3.3"></script>
|
|
91
|
+
<script src="js/views.js?v=2.3.3"></script>
|
|
92
|
+
<script src="js/app.js?v=2.3.3"></script>
|
|
93
|
+
<script src="js/hubpreview.js?v=2.3.3"></script>
|
|
93
94
|
</body>
|
|
94
95
|
</html>
|
package/js/jellyfin.js
CHANGED
|
@@ -23,7 +23,7 @@ var Jellyfin = (function () {
|
|
|
23
23
|
'use strict';
|
|
24
24
|
|
|
25
25
|
var KEY = 'stremiok.jellyfin.servers', DEV_KEY = 'stremiok.jellyfin.device', LIBS_KEY = 'stremiok.jellyfin.libs';
|
|
26
|
-
var PAGE = 100, INDEX_FRESH_MS = 30 * 60000, INDEX_RETRY_MS = 60000, LIBS_FRESH_MS = 86400000;
|
|
26
|
+
var PAGE = 100, INDEX_FRESH_MS = 30 * 60000, INDEX_RETRY_MS = 60000, INDEX_SLOW_MS = 30 * 60000, LIBS_FRESH_MS = 86400000;
|
|
27
27
|
var QC_EVERY = 3000, QC_FOR = 10 * 60000, REPORT_EVERY = 60000, TICKS = 10000000;
|
|
28
28
|
var _changeFns = [];
|
|
29
29
|
function onChange(fn) { _changeFns.push(fn); }
|
|
@@ -283,7 +283,7 @@ var Jellyfin = (function () {
|
|
|
283
283
|
kind = KINDS[kind] ? kind : 'jellyfin';
|
|
284
284
|
if (!_addons[kind]) {
|
|
285
285
|
_addons[kind] = { __local: true, __sources: true, url: 'local:' + kind, base: 'local:' + kind,
|
|
286
|
-
__impl: { catalog: catalog, meta: meta, streams: function (type, id) { return streams(type, id, kind); } },
|
|
286
|
+
__impl: { catalog: catalog, meta: meta, streams: function (type, id, m) { return streams(type, id, kind, m); } },
|
|
287
287
|
manifest: { id: 'org.stremiok.' + kind, name: KINDS[kind].name, version: '1.0.0', types: ['movie', 'series'], resources: RESOURCES, catalogs: [] } };
|
|
288
288
|
}
|
|
289
289
|
fillCatalogs(kind);
|
|
@@ -426,7 +426,10 @@ var Jellyfin = (function () {
|
|
|
426
426
|
}, function (e) {
|
|
427
427
|
U.log('jellyfin', '“' + srv.name + '” (' + kindName(srv) + '): its titles couldn’t be read (' + U.problem(e) + ')');
|
|
428
428
|
var old = _index[srv.id], map = (old && old.map) || { __ids: {}, __tm: {}, __played: [], __err: true }; // (__err: never read)
|
|
429
|
-
|
|
429
|
+
// (asked again in a minute; one that timed out — a list too big or slow for one answer, as a server
|
|
430
|
+
// presenting a whole catalog has — after 30 minutes, titles looked up one at a time meanwhile: idsFor)
|
|
431
|
+
var slow = /Timed out/i.test((e && e.message) || '');
|
|
432
|
+
if (old && old.p === p) { _index[srv.id] = { at: Date.now() - INDEX_FRESH_MS + (slow ? INDEX_SLOW_MS : INDEX_RETRY_MS), map: map }; }
|
|
430
433
|
return map;
|
|
431
434
|
});
|
|
432
435
|
_index[srv.id] = { at: x ? x.at : 0, map: x ? x.map : null, p: p };
|
|
@@ -441,7 +444,48 @@ var Jellyfin = (function () {
|
|
|
441
444
|
if (map.__tm && map.__tm[id]) { l.push('tmdb:' + map.__tm[id]); }
|
|
442
445
|
return l;
|
|
443
446
|
}
|
|
444
|
-
|
|
447
|
+
// A title the server's list can't give (never read: too big or slow for one answer, as a server
|
|
448
|
+
// presenting a whole catalog is): searched for by its name, taken only when its IMDb or TMDB id
|
|
449
|
+
// is the one asked for. Kept FOUND_MS (a failed search: asked again next time).
|
|
450
|
+
var FOUND_MS = 30 * 60000, _found = U.lru(300);
|
|
451
|
+
function lookup(srv, type, key, name) {
|
|
452
|
+
name = ('' + (name || '')).replace(/\s+/g, ' ').trim().slice(0, 100);
|
|
453
|
+
if (!name) { return Promise.resolve([]); }
|
|
454
|
+
var k = srv.id + '|' + type + '|' + key, had = _found.get(k);
|
|
455
|
+
if (had && had.p && Date.now() - had.at < FOUND_MS) { return had.p; }
|
|
456
|
+
var p = get(srv, K(srv).items(uid(srv)) + 'recursive=true&includeItemTypes=' + (type === 'movie' ? 'Movie' : 'Series') + '&searchTerm=' + enc(name) +
|
|
457
|
+
'&fields=ProviderIds&enableImages=false&enableUserData=false&limit=40').then(function (r) {
|
|
458
|
+
return U.listOf(r && r.Items, 40, function (it) { return it && it.Id && (imdbOf(it) === key || (!!tmdbOf(it) && 'tmdb:' + tmdbOf(it) === key)); }).map(function (it) { return '' + it.Id; });
|
|
459
|
+
}, function (e) {
|
|
460
|
+
_found.set(k, null);
|
|
461
|
+
U.log('jellyfin', '“' + srv.name + '”: “' + name + '” couldn’t be looked up (' + U.problem(e) + ')');
|
|
462
|
+
return [];
|
|
463
|
+
});
|
|
464
|
+
_found.set(k, { at: Date.now(), p: p });
|
|
465
|
+
return p;
|
|
466
|
+
}
|
|
467
|
+
// The server's items for a title: from its list, as before; with no list yet, or none to be
|
|
468
|
+
// had, looked up by name meanwhile (lookup), the list's answer used when that finds none.
|
|
469
|
+
function idsFor(srv, type, key, name) {
|
|
470
|
+
var x = _index[srv.id];
|
|
471
|
+
var fromList = index(srv).then(function (map) { return map[type + '|' + key] || []; });
|
|
472
|
+
if (x && x.map && !x.map.__err) { return fromList; }
|
|
473
|
+
return lookup(srv, type, key, name).then(function (ids) { return ids.length ? ids : fromList; });
|
|
474
|
+
}
|
|
475
|
+
// A film or episode listed without its files (a server presenting remote ones gives them only
|
|
476
|
+
// when asked to play it: PlaybackInfo): asked for them then.
|
|
477
|
+
function withFiles(srv, it) {
|
|
478
|
+
if (!it || !it.Id || (it.MediaSources && it.MediaSources.length)) { return Promise.resolve(it); }
|
|
479
|
+
return U.getJSON(api(srv) + '/Items/' + enc(it.Id) + '/PlaybackInfo?userId=' + uid(srv), waitMs(), 8 * 1048576, null, headers(srv, srv.token, true), '{}').then(function (r) {
|
|
480
|
+
var l = U.listOf(r && r.MediaSources, 200, function (ms) { return ms && ms.Id; });
|
|
481
|
+
return l.length ? Object.assign({}, it, { MediaSources: l }) : it;
|
|
482
|
+
}, function (e) {
|
|
483
|
+
U.log('jellyfin', '“' + srv.name + '”: the files of “' + (it.Name || it.Id) + '” couldn’t be read (' + U.problem(e) + ')');
|
|
484
|
+
return it;
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
function filesOf(srv, it) { return withFiles(srv, it).then(function (x) { return sourcesOf(srv, x); }); }
|
|
488
|
+
function copies(type, id, kind, meta) {
|
|
445
489
|
var key = '', season = null, episode = null;
|
|
446
490
|
if (type === 'movie') { key = /^(tt\d+|tmdb:\d+)$/.test('' + id) ? '' + id : ''; }
|
|
447
491
|
else if (type === 'series') {
|
|
@@ -449,10 +493,11 @@ var Jellyfin = (function () {
|
|
|
449
493
|
if (mm) { key = mm[1]; season = +mm[2]; episode = +mm[3]; }
|
|
450
494
|
}
|
|
451
495
|
if (!key) { return Promise.resolve([]); }
|
|
496
|
+
var name = meta && typeof meta.name === 'string' ? meta.name : '';
|
|
452
497
|
return Promise.all(servers(kind).map(function (srv) {
|
|
453
|
-
return
|
|
454
|
-
return Promise.all(
|
|
455
|
-
return type === 'movie' ? item(srv, iid).then(function (it) { return
|
|
498
|
+
return idsFor(srv, type, key, name).then(function (ids) {
|
|
499
|
+
return Promise.all(ids.slice(0, 3).map(function (iid) {
|
|
500
|
+
return type === 'movie' ? item(srv, iid).then(function (it) { return filesOf(srv, it); }, none) : episodeSources(srv, iid, season, episode);
|
|
456
501
|
}));
|
|
457
502
|
}).then(flat, none);
|
|
458
503
|
})).then(flat);
|
|
@@ -763,24 +808,25 @@ var Jellyfin = (function () {
|
|
|
763
808
|
}
|
|
764
809
|
function sourcesOf(srv, it) {
|
|
765
810
|
if (!it || !it.Id) { return []; }
|
|
766
|
-
return U.listOf(it.MediaSources,
|
|
811
|
+
return U.listOf(it.MediaSources, 16, function (ms) { return ms.Id; }).map(function (ms) { return source(srv, it, ms); });
|
|
767
812
|
}
|
|
768
813
|
function episodeSources(srv, sid, season, episode) {
|
|
769
814
|
return episodes(srv, sid).then(function (eps) {
|
|
770
815
|
var e = eps.filter(function (x) { return x.season === season && x.episode === episode; })[0];
|
|
771
|
-
return e ?
|
|
772
|
-
}, none);
|
|
816
|
+
return e ? filesOf(srv, e.it) : [];
|
|
817
|
+
}).then(null, none);
|
|
773
818
|
}
|
|
774
819
|
// A title's sources: its own (jfm / jfs ids), or the servers' copies (of that kind: each
|
|
775
820
|
// kind's addon asks for its own) of a title from your addons.
|
|
776
|
-
|
|
821
|
+
// meta: the title's details (its name: lookup).
|
|
822
|
+
function streams(type, id, kind, meta) {
|
|
777
823
|
var x = parseId(id);
|
|
778
824
|
if (x) {
|
|
779
825
|
if (!x.srv) { return Promise.resolve([]); }
|
|
780
|
-
if (x.kind === 'm') { return item(x.srv, x.item).then(function (it) { return
|
|
826
|
+
if (x.kind === 'm') { return item(x.srv, x.item).then(function (it) { return filesOf(x.srv, it); }).then(null, none); }
|
|
781
827
|
return x.season != null ? episodeSources(x.srv, x.item, x.season, x.episode) : Promise.resolve([]);
|
|
782
828
|
}
|
|
783
|
-
return copies(type, id, kind);
|
|
829
|
+
return copies(type, id, kind, meta);
|
|
784
830
|
}
|
|
785
831
|
function isJellyfinId(id) { return /^jf[ms]\./.test('' + id); }
|
|
786
832
|
function nameOfId(id) { var x = parseId(id); return x && x.srv ? kindName(x.srv) : 'Jellyfin'; }
|