Skip to content

Commit 8036046

Browse files
authored
Merge pull request #317 from KenEucker/develop
Small fixes
2 parents f848c5d + 4601268 commit 8036046

7 files changed

Lines changed: 59 additions & 23 deletions

File tree

functions/common/methods.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2056,11 +2056,14 @@ export const collectQueueIssuesFromStorage = (
20562056
for (const key of unparsedKeys) {
20572057
const tagnumber = parseTagnumberFromQueueKey(key) ?? 0
20582058
const filename = key.split('/').pop() || key
2059+
// Unrecognized names cannot be converted by resize — only deleted.
20592060
issues.push({
20602061
category: 'non-webp',
20612062
tagnumber,
20622063
issue: `unrecognized queue file: ${filename}`,
20632064
url: key,
2065+
key,
2066+
deletable: true,
20642067
})
20652068
}
20662069

@@ -2145,6 +2148,7 @@ export const collectQueueIssuesFromStorage = (
21452148
player,
21462149
type: image.type,
21472150
url: image.url,
2151+
key: image.key,
21482152
issue: `queue file is ${image.extension}, not webp`,
21492153
})
21502154
continue
@@ -2166,6 +2170,7 @@ export const collectQueueIssuesFromStorage = (
21662170
player,
21672171
type: image.type,
21682172
url: image.url,
2173+
key: image.key,
21692174
issue: `missing sized variant${missing.length > 1 ? 's' : ''}: ${missing.join(', ')}`,
21702175
})
21712176
}
@@ -2233,7 +2238,8 @@ export const getQueueUploaderKey = (tag: Tag): string | undefined => {
22332238
}
22342239

22352240
export const isFixableQueueIssue = (issue: QueueIssue): boolean =>
2236-
issue.category === 'non-webp' || issue.category === 'missing-variants'
2241+
(issue.category === 'non-webp' || issue.category === 'missing-variants') &&
2242+
issue.deletable !== true
22372243

22382244
export const isDeletableQueueIssue = (issue: QueueIssue): boolean =>
22392245
issue.category === 'wrong-round' && issue.deletable === true && !!issue.key?.length

functions/queue-fix.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
*
3333
* ─── Issue categories (from collectQueueIssuesFromStorage) ───
3434
*
35-
* - non-webp: file in queue/ is not .webp (or unparsed name).
35+
* - non-webp: file in queue/ is not .webp (fixable via resize), or unrecognized name (deletable only).
3636
* - missing-variants: primary .webp exists but _medium/_small siblings missing in queue/.
3737
* - wrong-round: filename round ≠ expected (found=current or current+1, mystery=current+1). Deletable.
3838
* - duplicate-uploader: same player has files spanning rounds without a normal found+mystery pair.

src/router/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import About from '@/views/About.vue'
2-
import Admin from '@/views/Admin.vue'
32
import Approve from '@/views/Approve.vue'
4-
import Rejections from '@/views/Rejections.vue'
53
import BikeTags from '@/views/BikeTags.vue'
64
import Dashboard from '@/views/Dashboard.vue'
75
import Delete from '@/views/Delete.vue'
@@ -20,6 +18,8 @@ import Play from '@/views/Play.vue'
2018
import Player from '@/views/Player.vue'
2119
import Players from '@/views/Players.vue'
2220
import Profile from '@/views/Profile.vue'
21+
import QueueFix from '@/views/QueueFix.vue'
22+
import Rejections from '@/views/Rejections.vue'
2323
import Round from '@/views/Round.vue'
2424
import Worldwide from '@/views/Worldwide.vue'
2525
import { authGuard } from '@auth0/auth0-vue'
@@ -59,10 +59,10 @@ const protectedRoutes: Array<RouteRecordRaw> = isAuthenticationEnabled()
5959
component: GameSettings,
6060
},
6161
{
62-
path: '/admin',
63-
name: 'Admin',
62+
path: '/queue-fix',
63+
name: 'Queue Fix',
6464
beforeEnter: authGuard,
65-
component: Admin,
65+
component: QueueFix,
6666
},
6767
{
6868
path: '/delete',

src/views/BikeTags.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
</template>
1818

1919
<script setup name="BikeTagsView">
20-
import Searchable from '@/components/Searchable.vue'
2120
import BikeTag from '@/components/BikeTag.vue'
21+
import Searchable from '@/components/Searchable.vue'
2222
import { useBikeTagStore } from '@/store/index'
2323
2424
const store = useBikeTagStore()
@@ -59,7 +59,7 @@ const tagSearch = (tags, searchString) => {
5959
6060
const sortedResults = tags
6161
.filter((tag) => tagToScore.get(tag) > 0)
62-
.toSorted((a, b) => tagToScore.get(a) - tagToScore.get(b))
62+
.toSorted((a, b) => tagToScore.get(b) - tagToScore.get(a))
6363
return foundByNumber.concat(sortedResults)
6464
}
6565
</script>

src/views/Dashboard.vue

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,26 @@
8989
Game Settings
9090
</router-link>
9191

92-
<router-link v-if="isBikeTagAdmin" to="/admin" class="action-button">
92+
<router-link v-if="isBikeTagAdmin" to="/queue-fix" class="action-button">
9393
<span class="icon">
94-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
95-
<path d="M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" />
94+
<svg
95+
viewBox="0 0 24 24"
96+
xmlns="http://www.w3.org/2000/svg"
97+
fill="currentColor"
98+
aria-hidden="true"
99+
>
100+
<path d="M18 2H7a3 3 0 0 0-3 3v1h2V5a1 1 0 0 1 1-1h11a1 1 0 0 1 1 1v11h2V5a3 3 0 0 0-3-3Z" />
101+
102+
<path d="M16 5H5a3 3 0 0 0-3 3v1h2V8a1 1 0 0 1 1-1h11a1 1 0 0 1 1 1v11h2V8a3 3 0 0 0-3-3Z" />
103+
96104
<path
97-
d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9c.26.604.852.997 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"
105+
fill-rule="evenodd"
106+
d="M3 8h11a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3v-8a3 3 0 0 1 3-3Zm2.5 3a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Zm-3.5 8 3.5-3.5 2.5 2.5 2-2 5 5H3a1 1 0 0 1-1-1v-1Z"
107+
clip-rule="evenodd"
98108
/>
99109
</svg>
100110
</span>
101-
BikeTag Admin
111+
Queue Fix
102112
</router-link>
103113
</div>
104114
</div>

src/views/Player.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ const playerTagSearch = (tags, searchString) => {
151151
152152
const sortedResults = tags
153153
.filter((tag) => tagToScore.get(tag) > 0)
154-
.toSorted((a, b) => tagToScore.get(a) - tagToScore.get(b))
154+
.toSorted((a, b) => tagToScore.get(b) - tagToScore.get(a))
155155
return foundByNumber.concat(sortedResults)
156156
}
157157
Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
<img class="spinner" src="@/assets/images/SpinningBikeV1.svg" alt="Loading..." />
55
</loading>
66

7-
<div class="admin-page container">
8-
<img class="admin-icon" src="/images/biketag-ambassador.svg" alt="Admin Icon" />
9-
<h1>BikeTag Admin</h1>
7+
<div class="queue-fix-page container">
8+
<img class="queue-fix-icon" src="/images/biketag-ambassador.svg" alt="Queue Fix Icon" />
9+
<h1>Queue Fix</h1>
1010
<p>
1111
Scan the queue for image conversion problems, missing sized variants, wrong-round entries,
1212
orphaned found images that never made it to main, and duplicate uploader splits. Use Fix Queue
13-
Images to re-run webp conversion and variant generation for fixable issues. Wrong-round files
14-
can be deleted individually or in bulk. Orphaned found images can be moved into main/.
13+
Images (or Fix image on an issue) to re-run webp conversion and variant generation for fixable
14+
issues. Unrecognized and wrong-round files can be deleted. Orphaned found images can be moved
15+
into main/.
1516
</p>
1617

1718
<div class="actions">
@@ -173,6 +174,14 @@
173174
>
174175
Move blocked — player mismatch
175176
</span>
177+
<button
178+
v-else-if="isFixableIssue(issue)"
179+
type="button"
180+
class="issue-action issue-action--fix"
181+
@click="fixQueue"
182+
>
183+
Fix image
184+
</button>
176185
<button
177186
v-if="issue.deletable"
178187
type="button"
@@ -193,7 +202,7 @@
193202
</div>
194203
</template>
195204

196-
<script setup name="AdminView">
205+
<script setup name="QueueFixView">
197206
import { useBikeTagStore } from '@/store/index'
198207
import { getS3ImageSized } from '@/common/methods'
199208
import { computed, inject, onMounted, ref } from 'vue'
@@ -249,6 +258,13 @@ function filenameRoundFromKey(key) {
249258
return match ? Number(match[1]) : undefined
250259
}
251260
261+
function isFixableIssue(issue) {
262+
return (
263+
(issue.category === 'non-webp' || issue.category === 'missing-variants') &&
264+
issue.deletable !== true
265+
)
266+
}
267+
252268
function applyScanResult(result) {
253269
scanned.value = true
254270
issues.value = result.issues ?? []
@@ -424,7 +440,7 @@ onMounted(async () => {
424440
</script>
425441
426442
<style scoped lang="scss">
427-
.admin-page {
443+
.queue-fix-page {
428444
background-color: #fff;
429445
color: #000;
430446
padding: 2rem;
@@ -447,7 +463,7 @@ onMounted(async () => {
447463
margin-bottom: 2rem;
448464
}
449465
450-
.admin-icon {
466+
.queue-fix-icon {
451467
width: 72px;
452468
margin-bottom: 1rem;
453469
}
@@ -567,6 +583,10 @@ onMounted(async () => {
567583
background: #e8f5e9;
568584
}
569585
586+
&--fix {
587+
background: #fff8e1;
588+
}
589+
570590
&--blocked {
571591
display: inline-block;
572592
margin-top: 0.5rem;

0 commit comments

Comments
 (0)