diff --git a/package.json b/package.json index bf9810c4..543e9ade 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.20.0", + "version": "4.20.1", "description": "FrankerFaceZ is a Twitch enhancement suite.", "license": "Apache-2.0", "scripts": { diff --git a/src/experiments.json b/src/experiments.json index c65bfa4d..257f9b09 100644 --- a/src/experiments.json +++ b/src/experiments.json @@ -3,8 +3,8 @@ "name": "New API Stress Testing", "description": "Send duplicate requests to the new API server for load testing.", "groups": [ - {"value": true, "weight": 50}, - {"value": false, "weight": 50} + {"value": true, "weight": 25}, + {"value": false, "weight": 75} ] } } \ No newline at end of file diff --git a/src/modules/chat/badges.jsx b/src/modules/chat/badges.jsx index f93418e0..4e3c2ec7 100644 --- a/src/modules/chat/badges.jsx +++ b/src/modules/chat/badges.jsx @@ -358,12 +358,21 @@ export default class Badges extends Module { continue; let title = bd.title || global_badge.title; + const tier = bd.tier || global_badge.tier; + if ( d.data ) { if ( d.badge === 'subscriber' ) { - title = this.i18n.t('badges.subscriber.months', '{title} ({count,number} Month{count,en_plural})', { - title, - count: d.data - }); + if ( tier > 0 ) + title = this.i18n.t('badges.subscriber.tier-months', '{title}\n(Tier {tier}, {months,number} Month{months,en_plural})', { + title, + tier, + months: d.data + }); + else + title = this.i18n.t('badges.subscriber.months', '{title}\n({count,number} Month{count,en_plural})', { + title, + count: d.data + }); } else if ( d.badge === 'founder' ) { title = this.i18n.t('badges.founder.months', '{title}\n(Subscribed for {count,number} Month{count,en_plural})', { title, diff --git a/src/modules/chat/room.js b/src/modules/chat/room.js index f227a993..698162e0 100644 --- a/src/modules/chat/room.js +++ b/src/modules/chat/room.js @@ -401,6 +401,16 @@ export default class Room { const sid = data.setID, bs = b[sid] = b[sid] || {}; + if ( sid === 'subscriber' ) { + const id = parseInt(data.version, 10); + if ( ! isNaN(id) && isFinite(id) ) { + data.tier = (id - (id % 1000)) / 1000; + if ( data.tier < 0 ) + data.tier = 0; + } else + data.tier = 0; + } + bs[data.version] = data; this.badge_count++; } diff --git a/src/modules/metadata.jsx b/src/modules/metadata.jsx index 5cfde0fc..d36552f6 100644 --- a/src/modules/metadata.jsx +++ b/src/modules/metadata.jsx @@ -81,14 +81,17 @@ export default class Metadata extends Module { refresh() { return this.settings.get('metadata.uptime') > 0 }, setup(data) { - const socket = this.resolve('socket'), - created_at = data?.meta?.createdAt; + const socket = this.resolve('socket'); + let created = data?.channel?.live_since; + if ( ! created ) { + const created_at = data?.meta?.createdAt; + if ( ! created_at ) + return {}; - if ( ! created_at ) - return {}; + created = new Date(created_at); + } - const created = new Date(created_at), - now = Date.now() - socket._time_drift; + const now = Date.now() - socket._time_drift; return { created, @@ -381,7 +384,12 @@ export default class Metadata extends Module { } updateMetadata(keys) { - const bar = this.resolve('site.channel_bar'); + const channel = this.resolve('site.channel'); + if ( channel ) + for(const el of channel.InfoBar.instances) + channel.updateMetadata(el, keys); + + /*const bar = this.resolve('site.channel_bar'); if ( bar ) { for(const inst of bar.ChannelBar.instances) bar.updateMetadata(inst, keys); @@ -391,7 +399,7 @@ export default class Metadata extends Module { if ( legacy_bar ) { for(const inst of legacy_bar.ChannelBar.instances) legacy_bar.updateMetadata(inst, keys); - } + }*/ } async renderLegacy(key, data, container, timers, refresh_fn) { @@ -465,7 +473,7 @@ export default class Metadata extends Module { if ( def.popup && def.click ) { el = (
@@ -490,7 +498,7 @@ export default class Metadata extends Module { } else btn = popup = el = (