MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / relevanceSortValue

Function relevanceSortValue

deployments/desktop/static/app.js:807–818  ·  view source on GitHub ↗
(paper)

Source from the content-addressed store, hash-verified

805}
806
807function relevanceSortValue(paper) {
808 const categoryRank = {
809 must_read: 5,
810 high_relevant: 4,
811 maybe_interested: 3,
812 edge_relevant: 2,
813 pending: 1,
814 };
815 const category = String(paper?.category || "").trim().toLowerCase();
816 const score = Number(paper?.score);
817 return (categoryRank[category] || 0) * 1000 + (Number.isFinite(score) ? score : -1);
818}
819
820function sortCurrentPushByRelevance() {
821 if (!state.push || !Array.isArray(state.push.papers) || !state.push.papers.length) return;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected