1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
function shuffle(array) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
return array;
}
function G() {
var e;
return e = z().mark(function e(t, n) {
var r, i, a, s, l, u, c, d;
return z().wrap(function(e) {
for (;;) switch (e.prev = e.next) {
case 0:
return r = o.A.getApiClient(t),
i = (0, _.C)(r),
a = r.getCurrentUserId(),
e.prev = 3,
e.next = 6,
j.q.fetchQuery((0, L.I)(i, a, n));
case 6:
if (!(l = e.sent).CollectionType) {
e.next = 10;
break;
}
return q(), e.abrupt("return");
case 10:
if (!H.includes(l.Type)) {
e.next = 13;
break;
}
return q(), e.abrupt("return");
case 13:
return e.next = 15, (0, D.Q)(i).getThemeMedia({
userId: a,
itemId: l.Id,
inheritFromParent: !0
});
case 15:
u = e.sent,
c = u.data,
(d = m.currentSettings.enableThemeVideos() &&
null !== (s = c.ThemeVideosResult) &&
void 0 !== s &&
null !== (s = s.Items) &&
void 0 !== s &&
s.length ?
{ ...c.ThemeVideosResult, Items: shuffle(s) } :
c.ThemeSongsResult
).OwnerId !== M && B(d.Items, d.OwnerId),
e.next = 24;
break;
case 21:
e.prev = 21,
e.t0 = e.catch(3),
console.error("[ThemeMediaPlayer] failed to load theme media", e.t0);
case 24:
case "end":
return e.stop();
}
}, e, null, [
[3, 21]
]);
}), G = function() {
var t = this,
n = arguments;
return new Promise(function(r, i) {
var o = e.apply(t, n);
function a(e) {
U(o, r, i, a, s, "next", e);
}
function s(e) {
U(o, r, i, a, s, "throw", e);
}
a(void 0);
});
}, G.apply(this, arguments);
}
|