mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-28 07:31:21 +00:00
fix(usage): prefer explicit video billing mode over image_count
Reuse shared getDisplayBillingMode so user usage rows with billing_mode=video are not mislabeled as image when image_count is non-zero.
This commit is contained in:
1 parent
bdeb13021a
commit
b7863650ec
3 files changed
+33
-5
No files matched your search
@@ -231,7 +231,7 @@ import Icon from '@/components/icons/Icon.vue'
|
||||
import UserErrorRequestsTable from '@/components/user/UserErrorRequestsTable.vue'
|
||||
import { getPersistedPageSize } from '@/composables/usePersistedPageSize'
|
||||
import { formatReasoningEffort } from '@/utils/format'
|
||||
import { BILLING_MODE_IMAGE, getBillingModeLabel } from '@/utils/billingMode'
|
||||
import { getBillingModeLabel, getDisplayBillingMode as resolveDisplayBillingMode } from '@/utils/billingMode'
|
||||
import { resolveUsageRequestType, requestTypeToLegacyStream } from '@/utils/usageRequestType'
|
||||
import type {
|
||||
ApiKey,
|
||||
@@ -605,10 +605,7 @@ const getRequestTypeExportText = (log: UsageLog): string => {
|
||||
|
||||
const getDisplayBillingMode = (
|
||||
row: Pick<UsageLog, 'billing_mode' | 'image_count'> | null | undefined
|
||||
): string | null | undefined => {
|
||||
if ((row?.image_count ?? 0) > 0) return BILLING_MODE_IMAGE
|
||||
return row?.billing_mode
|
||||
}
|
||||
): string | null | undefined => resolveDisplayBillingMode(row)
|
||||
|
||||
const escapeCSVValue = (value: unknown): string => {
|
||||
if (value == null) return ''
|
||||
|
||||
Reference in new issue
Block a user