Skip to content

Fix Sort by Last Played for Movies and TV Shows#1062

Open
zarek-marshall wants to merge 1 commit into
xbmc:masterfrom
zarek-marshall:fix/sort-by-last-played
Open

Fix Sort by Last Played for Movies and TV Shows#1062
zarek-marshall wants to merge 1 commit into
xbmc:masterfrom
zarek-marshall:fix/sort-by-last-played

Conversation

@zarek-marshall

Copy link
Copy Markdown

Summary

Sort by Last Played was a no-op for both the Movies and TV Shows lists. The library sync omits the lastplayed field via JSON-RPC, so the local cache column stays NULL and the menu option produces an effectively unordered list.

Root cause

VideoType.FieldsMovie.LASTPLAYED and VideoType.FieldsTVShow.LASTPLAYED are both commented out of the property arrays in SyncMovies.java and SyncTVShows.java respectively. A 2022 commit (f8c8d48) explicitly split the TV Shows line and left LASTPLAYED commented while uncommenting VOTES, but no rationale was recorded. The Movies version appears to have been commented since the file was created.

SyncUtils (lines 61 and 160) already writes the field to the local cache when present, so requesting it via JSON-RPC is sufficient to populate the column.

Fix

Uncomment the field in both property arrays. One line each, two files.

Test plan

  • ./gradlew assembleRelease lintRelease testDebugUnitTest — clean
  • Installed debug build on a Pixel 9 Pro emulator against a live Kodi library
  • Triggered library re-sync; verified the TV Shows list sorts correctly by Last Played (most recently played at top)
  • Same verification for the Movies list

Sort by Last Played was a no-op for both the Movies and TV Shows lists.
The library sync omits the lastplayed field via JSON-RPC, so the local
cache column stays NULL and the menu option produces an effectively
unordered list.

VideoType.FieldsMovie.LASTPLAYED and VideoType.FieldsTVShow.LASTPLAYED
are both commented out of the property arrays in SyncMovies.java and
SyncTVShows.java. SyncUtils already writes the field to the local cache
when present (lines 61 and 160), so uncommenting in the property arrays
is sufficient.

Verified on a Pixel emulator against a live Kodi library: both lists
now sort with most-recently-played at the top.
@kodiai

kodiai Bot commented May 20, 2026

Copy link
Copy Markdown

Decision: APPROVE

kodiai response

Decision: APPROVE
Issues: none

Evidence:

  • Review prompt covered 2 changed files.
  • Review scope note: output was scoped by prompt budget limits; Review Details include bounded counts only.
Review Details
  • Review plan: ready hash=0451dad551b0 route=tiny-diff task=review.small-diff files=2 lines=4(local-diff) budget=25t/695s gates=3/3 publish=canonical-visible-surface graph=skipped candidates=preferred doctrine=disabled/0/0/0 reasons=disabled

  • Review reducer: ready input=0 kept=0 suppressed=0 rewritten=0 deprioritized=0 lowConfidence=0 auditEvents=0 severityDemoted=0 graphValidated=0 graphUncertain=0 doctrine=disabled/0/0/0 reasons=disabled

  • Review candidates: shadow recorded=0 rejected=0 errors=0 artifact=absent repo=xbmc-Kore pr=1062 key=kodiai-review-output:v1:inst-109141824:xbmc-kore:pr-1062:action-opened:delivery- delivery=c282ce90-542d-11f1-8ecb-df55cd2c3c7f

  • Review candidate publication: mode=blocked approved=0 rewritten=0 published=0 directFallback=0 reasons=no-candidate-publication-path,approval-blocked

  • Files reviewed: 2

  • Findings: 0 critical, 0 major, 0 medium, 0 minor

  • Lines changed: +2 -2

  • Profile: strict (auto, lines changed: 4)

  • Contributor experience: coarse-fallback (using coarse fallback signals only)

  • Shadow specialist: lane=docs-config-truth status=skipped reason=no-operator-truth-paths candidateCount=0 decisionCount=0 decisionCounts=candidate:0,duplicate:0,disagreement:0,dismissed:0,unclassifiable:0 duplicateCount=0 disagreementCount=0 dismissedCount=0 unclassifiableCount=0 truncatedCandidateCount=0 metricAvailability=token:n,cost:n,latency:n visiblePublicationDenied=true approvalPublicationDenied=true privateOnly=true shadowOnly=true redacted=raw:n,publication:n,approval:n,unsafe:0 correlationKey=67f21a91abfe0bf8 deliveryId=c282ce90-542d-11f1-8ecb-df55cd2… reviewOutputKey=kodiai-review-output:v1:inst-10…

  • M072 candidate publication bridge: status=denied; bridgeVersion=candidate-publication-bridge.v1; bridgeId=candidate-publication-record:c3f7df6f80513ad1ced6d3a42a65515d; recordKey=candidate-publication-record:c3f7df6f80513ad1ced6d3a42a65515d; correlationKey=candidate-publication-bridge:2586decea41cfaec4e428f6e60e8f43f; source=review-handler-publication; candidateRef=candidate-publication-summary-9282617a; verification=none; counts=candidateCount:0,evidenceCount:0,verifiedCount:0,partiallyVerifiedCount:0,unverifiedCount:0,disprovenCount:0,publicationEligibleCount:0,malformedRecordCount:0,unsafeInputFieldCount:0; reasons=no-evidence,publication-ineligible; malformed=none; presence=deliveryId:y,reviewOutputKey:y,upstreamCorrelationKey:y,policyCorrelationKey:y; handoffOwner=available; redaction=privateOnly:y,rawPayloads:n,publicationFields:n,evidencePayloads:n,githubCommentBody:n,reducerRawPayload:n,discardedRawPayload:n,discardedPublicationFields:n,discardedEvidencePayloads:n

  • Review finding lifecycle: status=normalized; counts=input:0,recorded:0,rejected:0,unsafeInputFields:0; correlation=repo:y,pull:y,reviewOutputKey:y,deliveryId:y,commit:n; statuses=detected:0,open:0,suggested:0,validated:0,revalidated:0,resolved:0,blocked:0,degraded:0; severity=critical:0,major:0,medium:0,minor:0; actionability=actionable:0,needs-human-review:0,needs-reproduction:0,blocked:0,not-actionable:0; reasons=none; rejected=none; redaction=privateOnly:y,rawPrompts:n,rawModelOutput:n,candidateBodies:n,toolPayloads:n,secretLike:n,diffs:n,unboundedArrays:n,unsafeFields:0

  • Review validation truth: status=empty; counts=detected:0,suggested:0,validated:0,revalidated:0,resolved:0,blocked:0,degraded:0,open:0,uncertain:0,inputFindings:0,unsafeInputFields:0; evidence=fresh:0,stale:0,missingValidation:0,missingRevalidation:0; reasons=none; refs=none; correlation=reviewOutputKey:y,deliveryId:y; redaction=privateOnly:y,rawPrompts:n,rawModelOutput:n,candidateBodies:n,replacementText:n,toolPayloads:n,secretLike:n,diffs:n,unboundedArrays:n,unsafeFields:0

  • Review completed: 2026-05-20T09:27:53.057Z

  • Total wall-clock: 2m 58s

  • Phase timings:

    • queue wait: 0ms
    • workspace preparation: 4.4s
    • retrieval/context assembly: 4.4s
    • executor handoff: 40s
    • remote runtime: 2m 2s
    • publication: 3.6s
  • Tokens: 34 in / 4,391 out | 0.1581

  • Keyword parsing: No keywords detected

  • Budget behavior: scoped (prompt-budget-limited).

  • Prompt budget: 6 sections, 1 trimmed, 0 bypassed, 331 trimmed tokens.

  • Cache behavior: 2 observations, 1 hits, 1 misses, 0 degraded, 0 bypassed.

  • Continuation behavior: 0 observations, 0 compacted, 0 fallback, 0 degraded, 0 bypassed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant