Skip to content

Commit

Permalink
Resolve #13: Reduce MBLD score multiplier from 1E8 to 1E7
Browse files Browse the repository at this point in the history
  • Loading branch information
big213 committed Apr 8, 2021
1 parent d82cc5b commit c811d69
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions backend/functions/src/schema/models/personalBest/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ export class PersonalBestService extends PaginatedService {

validatedArgs.movesCount = null;
// rightmost 7 rights are for time (), lower is better
// remaining digits are for the score (x -1*1E8), higher is better
// remaining digits are for the score (x -1*1E7), higher is better
score =
validatedArgs.timeElapsed +
-100000000 *
-10000000 *
((validatedArgs.attemptsTotal - validatedArgs.attemptsSucceeded) *
-1 +
validatedArgs.attemptsSucceeded * 1);
Expand Down
2 changes: 1 addition & 1 deletion frontend/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
},
{
property: 'og:image',
content: 'https://cubepb.com/_nuxt/img/cubepb-logo-2.71bfc74.png',
content: 'https://cubepb.com/_nuxt/img/cubepb-logo-2-b.2c3896b.png',
},
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
Expand Down
17 changes: 13 additions & 4 deletions frontend/pages/public-pbs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
v-for="(item, i) in events"
:key="i"
class="ma-2"
@click="applyPresetRoute(item)"
@click="applyEventPreset(item)"
>
<v-avatar left>
<span class="cubing-icon" :class="item.cubingIcon"></span>
Expand Down Expand Up @@ -141,22 +141,31 @@ export default {
this.loadPresets()
},
methods: {
applyPresetRoute(event) {
applyEventPreset(event) {
// get the original sortBy/sortDesc
const originalPageOptions = this.$route.query.pageOptions
? JSON.parse(atob(decodeURIComponent(this.$route.query.pageOptions)))
: null
// replace event.id filters with new ones
const excludeFilterKeys = ['event.id']
this.$router.push(
generateRoute(this.$route.path, {
...originalPageOptions,
filters: [
filters: (originalPageOptions.filters
? originalPageOptions.filters.filter(
(filterObject) =>
!excludeFilterKeys.includes(filterObject.field)
)
: []
).concat([
{
field: 'event.id',
operator: 'eq',
value: event.id,
},
],
]),
})
)
},
Expand Down

0 comments on commit c811d69

Please sign in to comment.