mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-02 16:08:31 +00:00
More bugfixes. Actually implement the API test experiment.
This commit is contained in:
parent
99f9974dea
commit
1b2ff27530
10 changed files with 57 additions and 13 deletions
|
@ -1,3 +1,9 @@
|
|||
<div class="list-header">4.0.0-beta2.13<span>@64fec6b80d1f6a60c263</span> <time datetime="2018-04-12">(2018-04-12)</time></div>
|
||||
<ul class="chat-menu-content menu-side-padding">
|
||||
<li>Fixed: Issue sorting settings on Edge and Safari.</li>
|
||||
<li>Fixed: Issue processing metadata on game pages when broadcasters aren't defined.</li>
|
||||
</ul>
|
||||
|
||||
<div class="list-header">4.0.0-beta2.13<span>@64fec6b80d1f6a60c263</span> <time datetime="2018-04-11">(2018-04-11)</time></div>
|
||||
<ul class="chat-menu-content menu-side-padding">
|
||||
<li>Changed: Only use the ES2015 classes transform for the Edge build as their JS engine seems to get everything else correct.</li>
|
||||
|
|
|
@ -100,7 +100,7 @@ class FrankerFaceZ extends Module {
|
|||
FrankerFaceZ.Logger = Logger;
|
||||
|
||||
const VER = FrankerFaceZ.version_info = {
|
||||
major: 4, minor: 0, revision: 0, extra: '-beta2.13',
|
||||
major: 4, minor: 0, revision: 0, extra: '-beta2.14',
|
||||
build: __webpack_hash__,
|
||||
toString: () =>
|
||||
`${VER.major}.${VER.minor}.${VER.revision}${VER.extra || ''}${DEBUG ? '-dev' : ''}`
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// Badge Handling
|
||||
// ============================================================================
|
||||
|
||||
import {API_SERVER, IS_WEBKIT, WEBKIT_CSS as WEBKIT} from 'utilities/constants';
|
||||
import {NEW_API, API_SERVER, IS_WEBKIT, WEBKIT_CSS as WEBKIT} from 'utilities/constants';
|
||||
|
||||
import {createElement, ManagedStyle} from 'utilities/dom';
|
||||
import {has} from 'utilities/object';
|
||||
|
@ -140,6 +140,7 @@ export default class Badges extends Module {
|
|||
this.inject('settings');
|
||||
this.inject('socket');
|
||||
this.inject('tooltips');
|
||||
this.inject('experiments');
|
||||
|
||||
this.style = new ManagedStyle('badges');
|
||||
this.badges = {};
|
||||
|
@ -496,6 +497,12 @@ export default class Badges extends Module {
|
|||
|
||||
async loadGlobalBadges(tries = 0) {
|
||||
let response, data;
|
||||
|
||||
if ( this.experiments.getAssignment('api_load') )
|
||||
try {
|
||||
fetch(`${NEW_API}/v1/badges`).catch(() => {});
|
||||
} catch(err) { /* do nothing */ }
|
||||
|
||||
try {
|
||||
response = await fetch(`${API_SERVER}/v1/badges`);
|
||||
} catch(err) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
import Module from 'utilities/module';
|
||||
import {ManagedStyle} from 'utilities/dom';
|
||||
import {has, timeout, SourcedSet} from 'utilities/object';
|
||||
import {CLIENT_ID, API_SERVER, IS_OSX} from 'utilities/constants';
|
||||
import {CLIENT_ID, NEW_API, API_SERVER, IS_OSX} from 'utilities/constants';
|
||||
|
||||
const MOD_KEY = IS_OSX ? 'metaKey' : 'ctrlKey';
|
||||
|
||||
|
@ -60,6 +60,7 @@ export default class Emotes extends Module {
|
|||
|
||||
this.inject('socket');
|
||||
this.inject('settings');
|
||||
this.inject('experiments');
|
||||
|
||||
this.twitch_inventory_sets = new Set(EXTRA_INVENTORY);
|
||||
this.__twitch_emote_to_set = new Map;
|
||||
|
@ -133,9 +134,13 @@ export default class Emotes extends Module {
|
|||
providers = emote_sets._sources;
|
||||
|
||||
if ( providers && providers.has('featured') )
|
||||
for(const item of providers.get('featured'))
|
||||
if ( ! new_sets.includes(item) )
|
||||
for(const item of providers.get('featured')) {
|
||||
const idx = new_sets.indexOf(item);
|
||||
if ( idx === -1 )
|
||||
room.removeSet('featured', item);
|
||||
else
|
||||
new_sets.splice(idx, 1);
|
||||
}
|
||||
|
||||
for(const set_id of new_sets) {
|
||||
room.addSet('featured', set_id);
|
||||
|
@ -424,6 +429,12 @@ export default class Emotes extends Module {
|
|||
|
||||
async loadGlobalSets(tries = 0) {
|
||||
let response, data;
|
||||
|
||||
if ( this.experiments.getAssignment('api_load') )
|
||||
try {
|
||||
fetch(`${NEW_API}/v1/set/global`).catch(() => {});
|
||||
} catch(err) { /* do nothing */ }
|
||||
|
||||
try {
|
||||
response = await fetch(`${API_SERVER}/v1/set/global`)
|
||||
} catch(err) {
|
||||
|
@ -461,6 +472,12 @@ export default class Emotes extends Module {
|
|||
|
||||
async loadSet(set_id, suppress_log = false, tries = 0) {
|
||||
let response, data;
|
||||
|
||||
if ( this.experiments.getAssignment('api_load') )
|
||||
try {
|
||||
fetch(`${NEW_API}/v1/set/${set_id}`).catch(() => {});
|
||||
} catch(err) { /* do nothing */ }
|
||||
|
||||
try {
|
||||
response = await fetch(`${API_SERVER}/v1/set/${set_id}`)
|
||||
} catch(err) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import {timeout, has} from 'utilities/object';
|
|||
|
||||
import Badges from './badges';
|
||||
import Emotes from './emotes';
|
||||
//import Emoji from './emoji';
|
||||
|
||||
import Room from './room';
|
||||
import User from './user';
|
||||
|
@ -27,9 +28,11 @@ export default class Chat extends Module {
|
|||
this.inject('i18n');
|
||||
this.inject('tooltips');
|
||||
this.inject('socket');
|
||||
this.inject('experiments');
|
||||
|
||||
this.inject(Badges);
|
||||
this.inject(Emotes);
|
||||
//this.inject(Emoji);
|
||||
|
||||
this._link_info = {};
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import User from './user';
|
||||
|
||||
import {API_SERVER, WEBKIT_CSS as WEBKIT} from 'utilities/constants';
|
||||
import {NEW_API, API_SERVER, WEBKIT_CSS as WEBKIT} from 'utilities/constants';
|
||||
|
||||
import {ManagedStyle} from 'utilities/dom';
|
||||
import {has, SourcedSet} from 'utilities/object';
|
||||
|
@ -175,6 +175,11 @@ export default class Room {
|
|||
if ( this.destroyed )
|
||||
return;
|
||||
|
||||
if ( this.manager.experiments.getAssignment('api_load') )
|
||||
try {
|
||||
fetch(`${NEW_API}/v1/rooms/${this.id ? `id/${this.id}` : this.login}`).catch(() => {});
|
||||
} catch(err) { /* do nothing */ }
|
||||
|
||||
let response, data;
|
||||
try {
|
||||
response = await fetch(`${API_SERVER}/v1/room/${this.id ? `id/${this.id}` : this.login}`);
|
||||
|
|
|
@ -375,7 +375,7 @@ export default class MainMenu extends Module {
|
|||
if ( a.sort < b.sort ) return -1;
|
||||
if ( a.sort > b.sort ) return 1;
|
||||
|
||||
return a.key.localeCompare(b.key);
|
||||
return a.key && a.key.localeCompare(b.key);
|
||||
});
|
||||
|
||||
this.log.info(`Built Tree in ${(performance.now() - started).toFixed(5)}ms with ${Object.keys(tree).length} structure nodes and ${this._settings_count} settings nodes.`);
|
||||
|
|
|
@ -198,14 +198,17 @@ export default class Directory extends SiteModule {
|
|||
if (!edges) return res;
|
||||
|
||||
for (let i = 0; i < edges.length; i++) {
|
||||
const edge = edges[i];
|
||||
const node = edge.node;
|
||||
const edge = edges[i],
|
||||
node = edge.node || edge;
|
||||
|
||||
const s = node.viewersCount = new Number(node.viewersCount || 0);
|
||||
s.profileImageURL = node.broadcaster.profileImageURL;
|
||||
s.createdAt = node.createdAt;
|
||||
s.login = node.broadcaster.login;
|
||||
s.displayName = node.broadcaster.displayName;
|
||||
|
||||
if ( node.broadcaster ) {
|
||||
s.profileImageURL = node.broadcaster.profileImageURL;
|
||||
s.login = node.broadcaster.login;
|
||||
s.displayName = node.broadcaster.displayName;
|
||||
}
|
||||
|
||||
if (gamePage || (!node.game || node.game && !blockedGames.includes(node.game.name))) newStreams.push(edge);
|
||||
}
|
||||
|
|
|
@ -13,7 +13,9 @@ const BAD_ERRORS = [
|
|||
'timeout',
|
||||
'unable to load',
|
||||
'error internal',
|
||||
'Internal Server Error'
|
||||
'Internal Server Error',
|
||||
'http://',
|
||||
'https://'
|
||||
];
|
||||
|
||||
function skip_error(err) {
|
||||
|
|
|
@ -5,6 +5,7 @@ export const SERVER = DEBUG ? '//localhost:8000' : 'https://cdn.frankerfacez.com
|
|||
|
||||
export const CLIENT_ID = 'a3bc9znoz6vi8ozsoca0inlcr4fcvkl';
|
||||
export const API_SERVER = '//api.frankerfacez.com';
|
||||
export const NEW_API = '//api-test.frankerfacez.com';
|
||||
|
||||
export const SENTRY_ID = 'https://18f42c65339d4164b3fdebfc8c8bc99b@sentry.io/1186960';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue