Skip to content

Use the PDF modification date for page listings - #7

Merged
garbear merged 1 commit into
Piersfrom
pdf-date
Oct 23, 2026
Merged

garbear merged 1 commit into
Piersfrom
pdf-date

Conversation

@garbear

@garbear garbear commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Use the source PDF's modification date for generated page listings.

  • Reuse the document cache's existing StatFile() result to retrieve the PDF's modification time.
  • Apply that timestamp to each page's directory entry.
  • Leave the date unspecified when file metadata is unavailable.
  • Avoid additional filesystem I/O or page rendering.

Motivation and context

PDF pages are exposed as virtual JPEG files, but previously had no associated date, causing Kodi to display 01/01/1970.

Using the source PDF's modification date provides meaningful metadata for each page without changing how pages are generated or cached.

Screenshots

kodi-vfs-pdf-date-2026-10-23

Note: -1.00B fixed in xbmc/xbmc#30065.

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change

Summary by CodeRabbit

  • New Features
    • Page listings now include the modification time of the source PDF, making it easier to see when the document was last updated.
    • If the document’s modification time cannot be determined, the listing uses a consistent fallback value. This information is available alongside each page entry and reflects the source document’s timestamp.

Reuse the document cache's existing stat result so page dates are
available without extra I/O or rendering. Leave unknown dates unset.
@garbear
garbear requested a review from sunlollyking October 23, 2026 12:31
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 322c2451-ec7d-4587-8b7c-01ac00aa363a
📥 Commits

Reviewing files that changed from the base of the PR and between eec172f and 1b0519d.

📒 Files selected for processing: 1
  • src/PdfFile.cpp

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

CCache::Document can return a PDF’s modification time. ListPages adds that time to each generated page directory entry. If StatFile fails, the returned time is 0.

Changes: PDF page metadata

Layer / File(s) Summary
Read and propagate document modification time
src/PdfFile.cpp
CCache::Document optionally returns the file modification time, or 0 if StatFile fails. ListPages adds the returned time to each generated page directory entry.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: sunlollyking

Merge Risk: ⚪ Minimal · up to 1b051

No confirmed merge-blocking regression remains in this change.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: using the PDF modification date for page listings.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sunlollyking sunlollyking left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, nice that it reuses the stat the cache already does.

@garbear
garbear merged commit 181e1c4 into Piers Oct 23, 2026
12 checks passed
@garbear
garbear deleted the pdf-date branch October 23, 2026 15:09
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.

2 participants