1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-16 18:06:55 +00:00
* Changed: Refactor player code to be shared between the embed/popout player and the main player.
* Changed: Place metadata above the player controls in embed/popout player to better handle very narrow players.
* Changed: Support clicking Stream Uptime metadata in the embed/popout player to copy a link to the past broadcast at the current time.
* Fixed: The player being an incorrect height in portrait mode in some cases.
* Fixed: Schedule data disappearing when FFZ boots while viewing the Schedule page due to how we send layout update events.
This commit is contained in:
SirStendec 2021-02-26 15:35:26 -05:00
parent ab4f72c345
commit 0d433c3ebd
13 changed files with 1788 additions and 2864 deletions

View file

@ -77,7 +77,6 @@ export default class TwitchData extends Module {
this.site = this.parent;
this.inject('site.apollo');
this.inject('site.web_munch');
this._waiting_stream_ids = new Map;
this._waiting_stream_logins = new Map;
@ -133,14 +132,20 @@ export default class TwitchData extends Module {
return session && session.locale || 'en-US'
}
get searchClient() {
async searchClient() {
if ( this._search )
return this._search;
const apollo = this.apollo.client,
core = this.site.getCore();
core = this.site.getCore(),
web_munch = this.resolve('web_munch');
const SearchClient = this.web_munch.getModule('algolia-search');
if ( ! web_munch )
return null;
await web_munch.enable();
const SearchClient = await this.web_munch.findModule('algolia-search');
if ( ! SearchClient || ! apollo || ! core )
return null;
@ -914,12 +919,14 @@ export default class TwitchData extends Module {
if ( ! locale )
locale = this.locale;
const client = await this.searchClient();
locale = getAlgoliaLanguage(locale);
let nodes;
if ( category ) {
const data = await this.searchClient.queryForType(
const data = await client.queryForType(
'stream_tag', query, generateUUID(), {
hitsPerPage: 100,
faceFilters: [
@ -935,7 +942,7 @@ export default class TwitchData extends Module {
nodes = get('streamTags.hits', data);
} else {
const data = await this.searchClient.queryForType(
const data = await client.queryForType(
'tag', query, generateUUID(), {
hitsPerPage: 100,
facetFilters: [