Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

fix(ui): 资源链接缺少大小时不在提示里显示 undefined

longmeidao53273f408d4b
diff --git a/frontend/src/react/wants/want-magnets.tsx b/frontend/src/react/wants/want-magnets.tsx
index aeab81ce1..531c17d11 100644
--- a/frontend/src/react/wants/want-magnets.tsx
+++ b/frontend/src/react/wants/want-magnets.tsx
@@ -137,7 +137,7 @@ export function WantMagnets({ want, readOnly, downloads, provider, toast, onSour
</div>
<div data-resource-facts="" className="flex flex-wrap gap-x-2 gap-y-1 text-caption-1-regular text-text-secondary">
<ResourceFact icon={RiLink}>{candidate.source}</ResourceFact>
- <ResourceFact icon={RiHardDrive2Line} title={`来源大小:${candidate.size}`}>{resourceSize(candidate.size)}</ResourceFact>
+ <ResourceFact icon={RiHardDrive2Line} title={candidate.size ? `来源大小:${candidate.size}` : undefined}>{resourceSize(candidate.size)}</ResourceFact>
{candidate.files ? <ResourceFact icon={RiFileList2Line}>{candidate.files.replaceAll('個', '个')}</ResourceFact> : null}
<ResourceFact icon={RiCalendarLine} title={candidate.source === 'JavDB 评论' ? '评论日期' : '收录日期'}>{candidate.date ? candidate.date.slice(0, 10) : '日期未知'}</ResourceFact>
{candidate.attributes.filter(value => value !== '高清').map((value) => <ResourceFact key={value} icon={RiPriceTag3Line}>{value}</ResourceFact>)}
diff --git a/frontend/test/react/want-magnets.test.tsx b/frontend/test/react/want-magnets.test.tsx
index 4982b28da..d2770987c 100644
--- a/frontend/test/react/want-magnets.test.tsx
+++ b/frontend/test/react/want-magnets.test.tsx
@@ -101,6 +101,11 @@ it('待找清单查询多个来源,不采用快速添加的单来源持久缓
expect(host.textContent).toContain('sukebei');
});
+it('来源没给大小时整行照常展示,提示里不出现缺值', async () => {
+ const { host } = await open([{ ...candidate, size: undefined as unknown as string }]);
+ expect(host.querySelector('[data-resource-facts]')?.textContent).toContain('大小未知');
+ expect([...host.querySelectorAll('[title]')].map(node => node.getAttribute('title')).join('|')).not.toContain('undefined');
+});
it('ED2K 类型使用文字,字节容量按馆藏口径展示', async () => {
const { host } = await open([{ ...candidate, protocol: 'ed2k', size: '27,311,519,717 B' }]);
expect(host.textContent).toContain('ED2K');
diff --git a/web/dist/peach-app.js b/web/dist/peach-app.js
index 0688a36c3..30807117f 100644
--- a/web/dist/peach-app.js
+++ b/web/dist/peach-app.js
@@ -2,7 +2,7 @@
(function() {
try {
var e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, t = new e.Error().stack;
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "d936f90f-02d6-46b8-985e-c11c02eb3d9c", e._sentryDebugIdIdentifier = "sentry-dbid-d936f90f-02d6-46b8-985e-c11c02eb3d9c");
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "ed1d9ae5-3561-4465-81b0-fa7e1a9354fc", e._sentryDebugIdIdentifier = "sentry-dbid-ed1d9ae5-3561-4465-81b0-fa7e1a9354fc");
} catch {}
})();
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), s = (e, n) => {
@@ -75727,7 +75727,7 @@ function p4({ want: e, readOnly: t, downloads: n, provider: r, toast: i, onSourc
}),
/* @__PURE__ */ (0, I.jsx)(f4, {
icon: XB,
- title: `来源大小:${e.size}`,
+ title: e.size ? `来源大小:${e.size}` : void 0,
children: MMe(e.size)
}),
e.files ? /* @__PURE__ */ (0, I.jsx)(f4, {
@@ -83410,4 +83410,4 @@ if (!$9) throw Error("主界面宿主缺失");
vRe($9);
export { nR as $2ec61d1d4f780267$export$a8a3e93435678ff9, uR as $3a442827418ebe87$export$eb2fcfdbd7ba97d4, Dz as $542a13ca2fa5b484$export$5b6b19405a83ff9d, MD as $72abaeab4d80592f$export$78efe591171d7d45, yB as $76d00c5a4edb230a$export$76ccd210b9029917, gB as $76d00c5a4edb230a$export$816b5d811295e6bc, SB as $76d00c5a4edb230a$export$b59bdbef9ce70de2, wB as $76d00c5a4edb230a$export$f6f0c3fe4ec306ea, hB as $76d00c5a4edb230a$export$f850895b287ef28e, uhe as $b4f18e3395fe64d7$export$3d96ec278d3efce4, lhe as $b4f18e3395fe64d7$export$3e41faf802a29e71, ohe as $b4f18e3395fe64d7$export$b2539bed5023c21c, OB as $b4f18e3395fe64d7$export$e51a686c67fdaa2d, phe as $bd263d78e9bf3c56$export$f5c9f3c2c4054eec, yE as $ea3928288112382f$export$439d29a4e110a164, Bz as $f2ff30fde7b014be$export$3ddf2d174ce01153, qz as $fe21c36db05242bb$export$a98f0dcb43a68a25, Jz as $fe21c36db05242bb$export$d7b12c4107be0d61, Ghe as $l, tM as ACCENTS, fke as AMANE_BRIDGE_CHECK_URL, Z$ as AMANE_BRIDGE_KEY, pke as AMANE_BRIDGE_REBUILD_URL, ar as ApiError, oW as ArtSlot, h2 as BATCH_DELETE_TEXT, J as Button, PL as ButtonLink, iV as Bx, O$ as CLEANUP_ENTRY, D$ as CLEANUP_ENTRY_GRID, Jf as CLEANUP_HASH_REDIRECTS, Kf as CLEANUP_TOOLS, gn as CLOUD_LOCATIONS, Z1 as CLOUD_PROXY_HELP, Wr as COLUMN_SORT, l1 as CONFIGURATION_KEY, uX as CONFIGURATION_URL, mke as COOKIE_TEXT_LIMIT, X$ as COVER_JOB_KEY, qi as CREDENTIAL_STATE, K$ as CUSTOM_SOURCES_KEY, G$ as CUSTOM_SOURCES_URL, XV as Checkbox, YV as CheckboxGlyph, BV as ChevronSortDown, aW as Chip, mW as CloudDownloadDialog, GH as CollapseChevron, WH as CollapseRegion, x$ as CollectionSummary, KCe as DEFAULT_CATEGORY, lr as DEFAULT_SORT, JQ as DIAGNOSTICS_KEY, Gwe as DIRECTORY_TEMPLATE_ERROR, M0 as DISCOVERY_SORTS, cW as DOWNLOADS_KEY, sW as DOWNLOADS_URL, AY as DUPLICATES_KEY, dY as DataTableFooter, sY as DataTableFrame, uY as DataTableSort, hU as Disclosure, Lve as DownloadsPanel, Rhe as E3, qCe as ENTITY_REVIEW_KINDS, Y1 as ENTRY_LINKS_HELP, X1 as ENTRY_LINKS_HINT, Jhe as Ea, hge as EmptyFocusButton, SV as EmptyState, pU as ErrorText, X_e as ExternalLink, zr as FEEDS_KEY, vX as FEED_SCHEDULE_KEY, T$ as FIELDSET_FOOT, yPe as FLOW_LABEL_X, Y3 as FLOW_VIEWBOX, Lr as FOLLOW_CHECK_KEY, Ir as FOLLOW_CREDENTIALS_KEY, M8 as FOLLOW_INITIAL_RANGE_OPTIONS, Fr as FOLLOW_MANAGE_KEY, QZ as FOLLOW_MANAGE_NAV, Rr as FOLLOW_RESOLVE_KEY, _X as FOLLOW_SCHEDULE_KEY, $_e as Fact, Q_e as FactList, mU as FieldLabel, R$ as Fieldset, L$ as FieldsetTitle, spe as FilterGlass, DL as FilterGlassRows, EL as FilterIconButton, OL as FilterPill, Y_e as Footer, tV as Gg, kL as GlassPill, cV as HN, fU as Help, pV as HintText, dPe as IDLE_POLL_MS, FCe as IDLE_REPAIR, SL as IconButton, XQ as IndexSearch, vV as Input, _V as InputBase, yM as JAV_LAYOUTS, P0 as JAV_RECOMMENDATION_GRID, UX as JUNK_KEY, jW as JavHeader, kCe as KEEP_LABELS, Vr as LAYOUTS, J1 as LIBRARY_FOLDER_HELP, lH as LIBRARY_PROCESSING_KEY, nX as LINKS_KEY, rX as LINK_CHECK_KEY, _we as LINK_KINDS, iX as LINK_PRUNE_KEY, er as LOC, fV as Label, V$ as LibraryProcessingCard, zV as LibraryShortcuts, TH as LinkButton, zH as LoadingDots, zhe as M6, Swe as MEDIA_PROCESSING_KEY, bX as MEDIA_PROCESSING_URL, FY as MEDIA_REPAIR_KEY, PY as MEDIA_REPAIR_URL, _r as MEDIA_SOURCES_KEY, hs as MEDIA_SOURCE_ICONS, mn as MEDIA_SOURCE_OPTIONS, WV as MENU_ITEM, GV as MENU_ITEM_INTERACTIVE, UV as MENU_POPOVER_SURFACE, kH as MenuDialog, EK as MixCard, yV as ModalFrame, Cx as MotionConfigContext, dV as NR, xV as Note, uge as OA, CX as ORGANIZE_KEY, f2 as ORGANIZE_PARAMETER_HINT, d2 as ORGANIZE_SCOPE_HINT, u2 as ORGANIZE_TEXT, EX as ORPHAN_RECORDS_KEY, m2 as ORPHAN_RECORDS_TEXT, $B as OV, zB as P7, BX as PERFORMER_DELETE_KEY, Kve as PHASES, dX as PICK_FOLDER_URL, A$ as PLAIN_STAT_STRIP, U$ as PLAYLISTS_KEY, gAe as POLICY_COLUMNS, vAe as POLICY_COVER_NOTE, _Ae as POLICY_MATRIX, q1 as POLICY_SUMMARY, lY as Pagination, B$ as PathLine, ZI as PillTabList, POe as PlainStat, VH as Progress, BY as QUALITY_GOALS_KEY, M$ as REPAIR_CARD_TEXT, IY as REPAIR_LIBRARIES_KEY, jX as RESOURCE_APPLY_KEY, AX as RESOURCE_SCAN_KEY, p2 as RESOURCE_SYNC_TEXT, BOe as RESULT_PANEL, VOe as RESULT_SECTION, GCe as REVIEW_CATEGORIES, HX as REVIEW_COUNTS_KEY, JCe as REVIEW_DECISION_LABELS, UY as REVIEW_KEY, WY as REVIEW_LABELS, KY as REVIEW_QUEUES, qY as REVIEW_QUEUE_LABELS, ZG as RetryNote, cge as Rf, K_e as Rows, uke as SCRAPING_CHECK_URL, J$ as SCRAPING_COVER_URL, Y$ as SCRAPING_KEY, lke as SCRAPING_SETTINGS_URL, FU as SEGMENT, PU as SEGMENTED_TRACK, gX as SETTINGS_KEY, fX as SETTINGS_URL, ur as SORT_DEFAULT_DIR, cr as SORT_OPTIONS, _n as SOURCE_LABELS, b3 as STATS_KEY, MOe as STAT_STRIP, NOe as STAT_STRIP_SIX, G_e as Section, HOe as SectionHeading, J_e as SectionSkeleton, NU as SegmentedRadioGroup, mve as SegmentedTabList, WG as Segments, cY as Select, nW as Select$1, p1 as SelectField, rW as SelectItem, vY as SelectionActions, Mj as SelectionDock, yY as SelectionPopover, KH as SettingsCard, M_e as SettingsRow, qH as SettingsSectionLabel, rve as SiteLabel, CG as SortDirectionIcon, KG as SortKeys, jQ as SourceAvatar, yU as SourceLabel, gU as SourceMark, q_e as Stack, FOe as StatCard, z$ as StatusLabel, Q2 as Switch, oL as TASKS_KEY, ePe as TASTE_REFRESH_KEY, tPe as TASTE_WINDOWS, yX as THUMBNAIL_JOBS_KEY, GX as TRASH_KEY, Vfe as TRIGGER_LABELS, QJ as Table, bY as TableColumnControls, xY as TableColumnResizer, CY as TableSelectionHeader, g$ as TagManager, Z_e as TaskCenterLink, HH as TaskProgress, hV as TextField, mV as TextFieldContext, ZB as Un, gW as WANTS_KEY, p4 as WantMagnets, Ug as WithPromise, UB as Wt, XB as Xc, uV as Xf, WB as Xt, VB as _8, o as __commonJSMin, s as __exportAll, l as __toESM, sge as aB, wi as addAlias, Ci as addSource, vW as addWant, fS as animate, V as apiGet, H as apiSend, pM as appSettingsStore, uTe as applyConfirmText, zX as applyLeftovers, lTe as applyPlanText, fTe as applyText, _M as applyTheme, gy as asNumber, Qwe as attachOrphan, oi as authorAvatar, ci as authorGroups, ai as authorInitial, ii as authorName, Bq as autoResetPageIndex, ho as avatarInner, E3 as bandRows, Kwe as baseName, PCe as batchOperate, uue as beginPlayerGuidePreview, Lj as boundedPreference, jCe as bulkCloudPreferences, EV as busyProps, oge as cB, AMe as cachedMagnetStates, Lg as calcGeneratorVelocity, twe as canApprove, fg as cancelFrame, rTe as candidateText, RH as cardClass, MM as cardRatio, YB as cc, Ui as checkEvidenceGap, Hi as checkFailures, Ni as checkFeeds, xwe as checkLine, Bi as checkReceipt, Vi as checkSummary, gke as checkText, Wi as checkedText, fK as clickedBlank, Y5 as closeDrawerAfterNav, CCe as cloudLocations, O0 as cloudProxySkeleton, QC as clsx, Zhe as cn, av as collectMotionValues, oJ as columnVisibilityFeature, qJ as column_getCanSort, UJ as column_getSortFn, $Ce as commonReviewSources, Df as configurationSection, aPe as configureTasteBrowser, al as confirmModal, zfe as controlTask, Sq as copyInstancePropertiesWithoutMemos, so as coverUrl, Zq as createColumnHelper, rke as createPlaylist, Ji as credentialDone, w0 as credentialsSkeleton, uwe as currentReviewRow, JI as cx, rV as dZ, swe as decisionPayload, cwe as decisionReceipt, owe as defaultChoice, mTe as deletePerformerVideos, ake as deletePlaylist, x as diagnosticHeaders, K1 as diagnosticsSkeleton, EW as discoveryArtwork, wW as discoveryKey, HAe as discoveryScore, o9 as disposeStage, DCe as distinctName, Ri as dropSources, age as du, MCe as duplicateVictims, pL as elapsedText, en as entityDisplayName, mo as entityFaceImg, Mn as entityPath, $r as errorHeadline, sr as errorMessage, B as esc, zq as expandRowModel, NB as f1, Qr as feedIntervalText, e1 as fetchAmaneBridge, gi as fetchCheckJob, u1 as fetchConfiguration, $$ as fetchCoverJob, hi as fetchCredentials, q$ as fetchCustomSources, VX as fetchDeletePerformers, pTe as fetchDeletePlan, YQ as fetchDiagnostics, TW as fetchDiscoveries, MY as fetchDuplicates, Ffe as fetchEarlier, Twe as fetchFeedSchedule, Ai as fetchFeeds, mi as fetchFollow, wwe as fetchFollowSchedule, qX as fetchJunkSummary, _H as fetchLibraryProcessing, sX as fetchLinkCheck, cX as fetchLinkPrune, oX as fetchLinkStats, Cwe as fetchMediaProcessing, LY as fetchMediaRepair, vr as fetchMediaSources, wX as fetchOrganize, Rwe as fetchOrganizeExample, DX as fetchOrphanRecords, ki as fetchPending, W$ as fetchPlaylists, VY as fetchQualityGoals, RY as fetchRepairLibraries, _i as fetchResolveJob, NX as fetchResourceApply, MX as fetchResourceScan, $Y as fetchReview, KX as fetchReviewCounts, xX as fetchSettings, Q$ as fetchSources, x3 as fetchStats, vi as fetchSuggestions, cL as fetchTasks, K3 as fetchTaste, oPe as fetchTasteJob, Ewe as fetchThumbnailJobs, JX as fetchTrashSummary, _W as fetchWants, ZCe as filterReviewRows, Qn as firstGrapheme, iq as flexRender, xPe as flowGraph, SPe as flowLabel, bNe as fmtCount, Kn as fmtDur, Jn as fmtSize, Pfe as foldByKind, Xfe as foldRoutine, Fi as followFeedByName, Br as followSuggestKey, Qfe as followupDetail, Nfe as followupTally, dg as frame, LB as g4, lJ as getDefaultPaginationState, jM as gridLayout, si as groupByAuthor, Yfe as groupFollowups, XY as groupReviewRows, sTe as hasChanges, PX as hasResourceRoots, uL as hasResultProblems, fPe as historySpan, PB as i2, uPe as importTasteExport, T0 as indexersSkeleton, Ng as interpolate, xW as invalidateWants, fL as isActive, Zr as isBroken, Gr as isLayout, gv as isMotionValue, GY as isReviewCategory, Zfe as isRoutine, E0 as javBrowserSkeleton, I0 as javContentSkeleton, wM as javLayout, F0 as javTagSkeleton, yTe as junkBreakdown, oke as keepPlaylist, Oe as keepPreviousData, di as keepSelected, S3 as known, Phe as l7, Jfe as latestOfKind, MNe as lengthRows, xr as localTime, Pi as lookupFeedActor, RB as m7, nV as mM, Tn as mapLimit, Oi as markItem, D3 as max, ANe as mediumRows, Ife as mergeFinished, O3 as min, hwe as mirrorText, RCe as missingToolText, NY as mixedCloudPreferences, _L as momentText, pS as motion, sv as motionValue, tn as nameFallback, Ve as notifyManager, Jwe as organizeOutcome, Q0 as overlayHost, Kr as pageSizeOf, ui as pageWindow, pr as paginationRange, Li as patchSource, G as peachHistory, G as peachHistory$1, awe as pendingGenres, SNe as percentText, Vwe as pickOrganizeFolder, k$ as plainStatClass, qwe as planSummary, C3 as playedFor, wNe as playedItemUrl, sL as pollInterval, qs as popCount, nke as posterUrl, zye as previewLibraryColor, Bwe as previewOrganize, VCe as previewUrl, qfe as problemDestination, fH as processingActive, mL as progressText, vU as providerIcon, bwe as pruneText, IX as purgeCount, $we as purgeOrphan, aV as pv, ige as qE, U as queryClient, FB as r2, vPe as radarRows, DNe as radialArc, ONe as radialBarSize, ENe as radialCeiling, TNe as radialSlices, qN as randomId, gPe as rankDetail, _Pe as rankShares, T3 as reachedShare, hL as readableErrorHeadline, UAe as recommendationScore, dwe as recordGenre, tTe as recordsText, ske as recreatePlaylist, eke as refreshPlaylists, Sl as relayoutCovers, zi as reloadFollowManage, mwe as reloadReview, xAe as rememberShape, Uwe as rememberTemplates, Ti as removeAlias, Mi as removeFeed, Si as removeSource, lPe as removeTasteSource, yW as removeWants, Ei as renameAliasGroup, ike as renamePlaylist, xe as replaceEqualDeep, PNe as replayRows, re as require_jsx_runtime, A as require_react, N as require_react_dom, vq as require_with_selector, bW as resetWants, fr as resolveFollowSort, Bg as resolveStartTime, s_e as restartEffectText, tke as resumeAssetId, XCe as reviewGroupingOptions, YY as reviewQueueData, JY as reviewQueueOf, vTe as reviewSummary, QCe as reviewWindow, rwe as rowEvidence, QY as rowFieldName, gJ as rowPaginationFeature, LJ as rowSelectionFeature, XJ as rowSortingFeature, ZY as rowSubject, iwe as rowTags, nwe as rowTitle, jhe as s5, Di as saveCredential, cTe as scanLine, jwe as schedulePollInterval, CW as searchNote, ewe as selectReviewRange, fi as selectionState, ji as setFeedEnabled, xi as setSourceEnabled, jf as settingsPath, pwe as settleReviewRows, ECe as sharedNamePrefix, Tp as shellNavigate, b8 as showToast, Rn as siteMarkUrl, Aq as skipFirstRun, YI as sortCx, Jr as sortLabel, vn as sourceDefaultCost, Ki as sourceIconUrl, dTe as sourceMeta, Rs as spinnerHtml, jg as spring, wV as spriteGlyph, yi as startCheck, vwe as startLinkCheck, ywe as startLinkPrune, Hwe as startOrganize, bi as startResolve, aTe as startResourceApply, iTe as startResourceScan, cPe as startTasteRefresh, jOe as statCardClass, Ufe as statusLabel, LCe as statusLine, Xr as statusText, NM as storeJavLayout, lwe as submitDecision, vL as summaryItems, Qq as tableFeatures, jq as tableMemo, li as tableRows, Kfe as taskIssues, q3 as tasteDate, mPe as tasteDimensions, pPe as tasteHours, G3 as tasteKey, rPe as tasteRefetchInterval, iPe as tasteTime, tL as textLang, Qm as time, Whe as tl, pi as toggleGroup, J3 as topScores, qhe as uo, EH as useAction, qZ as useBackgroundJob, JU as useClientUpdates, um as useConstant, yL as useEntityNames, TL as useHorizontalScroller, dm as useIsomorphicLayoutEffect, dK as useLibraryTints, Pt as useMutation, ZV as useOverlayScrollbar, Nt as useQuery, ae as useQueryClient, tS as useReducedMotion, Awe as useRunSchedule, Owe as useSaveFollowSchedule, SX as useSaveSettings, Mwe as useSaveThumbnailMode, ZJ as useTable, mY as useTablePreferences, ML as useViewGlide, NCe as victimBytes, SW as wantName, CNe as watchNote, w3 as watchedShare, Ec as wireHorizontalScroller, Wwe as withOrganizeJob };
-//# debugId=d936f90f-02d6-46b8-985e-c11c02eb3d9c
\ No newline at end of file
+//# debugId=ed1d9ae5-3561-4465-81b0-fa7e1a9354fc
\ No newline at end of file