Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Book fileLastModified reports UTC timestamps, but values are actually localized #1430

Closed
5 tasks done
farahnur42 opened this issue Feb 16, 2024 · 3 comments
Closed
5 tasks done
Labels
bug Something isn't working released

Comments

@farahnur42
Copy link
Contributor

Steps to reproduce

  1. Add a newly grabbed/created/modified book to any series
  2. Check fileLastModified for that book from the API response (with e.g. /api/v1/books/{bookId})
{
  "id": "0F58NY1Z9D205",
  "seriesId": "0CJ42PH9819KV",
  "seriesTitle": "The Pension Life Vampire",
  "libraryId": "04CQ0DEQJ2E78",
  "name": "The Pension Life Vampire c022 (2024) (Digital)",
  "url": "/manga/The Pension Life Vampire/The Pension Life Vampire c022 (2024) (Digital).cbz",
  "number": 27,
  "created": "2024-02-16T16:28:12Z",
  "lastModified": "2024-02-16T16:29:27Z",
  "fileLastModified": "2024-02-16T11:42:32Z", ## should be 2024-02-16T05:42:32Z
  "sizeBytes": 14802017,
  "size": "14.1 MiB",
  "media": {
    "status": "READY",
    "mediaType": "application/zip",
    "pagesCount": 20,
    "comment": "",
    "epubDivinaCompatible": false,
    "mediaProfile": "DIVINA"
  },
  "metadata": {
    "title": "The Pension Life Vampire c022 (2024) (Digital)",
    "titleLock": false,
    "summary": "",
    "summaryLock": false,
    "number": "22",
    "numberLock": true,
    "numberSort": 22,
    "numberSortLock": true,
    "releaseDate": null,
    "releaseDateLock": false,
    "authors": [
      {
        "name": "Shouichi Taguchi",
        "role": "penciller"
      },
      {
        "name": "Shouichi Taguchi",
        "role": "inker"
      },
      {
        "name": "Shouichi Taguchi",
        "role": "colorist"
      },
      {
        "name": "Shouichi Taguchi",
        "role": "letterer"
      },
      {
        "name": "Shouichi Taguchi",
        "role": "cover"
      },
      {
        "name": "Shouichi Taguchi",
        "role": "writer"
      }
    ],
    "authorsLock": false,
    "tags": [],
    "tagsLock": false,
    "isbn": "",
    "isbnLock": false,
    "links": [],
    "linksLock": false,
    "created": "2024-02-16T16:28:12Z",
    "lastModified": "2024-02-16T16:34:28Z"
  },
  "readProgress": null,
  "deleted": false,
  "fileHash": "6748aa089dd44956a83397d06ffaf1f8",
  "oneshot": false
}
  1. Notice that the time is localized, not in UTC.
    image

Expected behavior

The time should be converted to UTC from whatever the configured timezone is, as the API reports it as UTC.

Actual behavior

The time is localized so it can be either in the future or the past depending on your native timezone (in my case perpetually 6h in the future).

Logs

No response

Komga version

1.10.3-master

Operating system

Docker

Installation method

Docker

Other details

This throws off the date/time for recently added content on e.g. the Tachiyomi Komga extension <=1.4.55 (1.4.55 switches from fileLastModified to lastModified which is even more incorrect as any metadata change, reordering etc to the book will throw it off - I've asked for this behaviour to be reverted once the timestamps are fixed Komga-side).

Acknowledgements

  • I have searched the existing issues (open AND closed) and this is a new ticket, NOT a duplicate or related to another open issue.
  • I have written a short but informative title.
  • I have checked the FAQ.
  • I have updated the app to the latest version.
  • I will fill out all of the requested information in this form.
@gotson
Copy link
Owner

gotson commented Feb 19, 2024

can you provide details of your filesystem time for that file ?

@gotson gotson changed the title [Bug/unintended behaviour] fileLastModified reports UTC timestamps, but values are actually localized. Book fileLastModified reports UTC timestamps, but values are actually localized Feb 19, 2024
@gotson gotson added bug Something isn't working and removed triage labels Feb 19, 2024
@gotson gotson closed this as completed in 1648533 Feb 19, 2024
@farahnur42
Copy link
Contributor Author

farahnur42 commented Feb 19, 2024

This throws off the date/time for recently added content on e.g. the Tachiyomi Komga extension <=1.4.55 (1.4.55 switches from fileLastModified to lastModified which is even more incorrect as any metadata change, reordering etc to the book will throw it off - I've asked for this behaviour to be reverted once the timestamps are fixed Komga-side).

Update on this for anyone stumbling upon this issue: 1.4.56 switches over to book.created instead of book.LastModified, and it can be switched back over to fileLastModified in the future.

Copy link
Contributor

🎉 This issue has been resolved in 1.10.4 (Release Notes)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants