-
Notifications
You must be signed in to change notification settings - Fork 6
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
Prevent [upcoming and truly live YouTube] videos from carrying over [to] subsequent download tasks [& discussion of UTC for code safety — avoid TZ code complexity wherever possible!?] #212
base: master
Are you sure you want to change the base?
Conversation
Is this PR safe in situations when the system clock (date & time) suddenly changes? (e.g. during a country's time change — or when machine's sysadmin changes the system clock back in time?) |
Time changes generally affect a whole operating system. The views-per-day sorting, an important feature recently added to IIAB Calibre-Web, would be affected as well. So, the answer is No. |
In the case of IIAB machines that are sometimes offline, system clocks can change VERY often:
|
The function compares
Machine-specific local times or time changes, accidental, voluntary or timezone change induced can cause inconsistencies.
To make this possible, the task's time related operations should be timezone-aware. By explicitly using NB In Calibre-Web databases schema and other parts like in editbooks.py |
Should we &/or upstream Calibre-Web begin to prepare, in a separate PR? (Of course Debian 13 "Trixie" is likely a few weeks/months away from upgrading from Python 3.11 to 3.13, expected around 2024-10-01 !) PS Mandating "perceived UTC" (from the local IIAB machine's standpoint) sounds like a great compromise — to at least increase code safety, and to avoid code bloat, by staying away from TZ complexity as much as humanly possible — i.e. to allow for crystal clear + maintainable + "Dead Simple" design! 🛤️ (After all, IIAB machines are shipped to other countries and time zones all the time, whether or not their system clocks inevitably drift, or suddenly jumping forward/back as they go offline/online intermittently and unpredictably ;) |
We begin in #217, we'll propose changes to upstream in a separate PR. |
I didn't quite understand your above comment: The missing piece is that |
Thanks much for explaining ✅
Question: Would it be feasible to distinguish between "upcoming / not yet live" and "truly live / actually live" YouTube video URLs versus "formerly live" YouTube video URLs more precisely — by avoiding the use of elapsed time calculations entirely?
|
@holta, no elapsed time calculations is used in this PR, neither in PR #217. The code only retrieves a list of videos added since a specific time,
For every download request made, the value of
|
Awesome news! @deldesir can you please also explain specifically why time needs to be involved:
Thanks! |
@deldesir FYI merge conflict as a result of the just-merged: |
If it helps us understand the original screenshots above:
Related: |
Apologies I'm not yet up-to-speed here in understanding the whole design/architecture. But we'll get through this code review (design review) soon in coming days keeping our heads down here. As @deldesir began today to explain to me some critical above mechanics / assumptions relating to 2 above snippets (repasted below...)
|
Upcoming and actually live videos are not being downloaded due to their duration being unknown. Records of these videos are kept in xklb-metadata.db. Unfortunately, these videos urls are caught in subsequent downloads tasks. We choose not to delete them in support of an eventual "download retry" feature. This PR prevents them from being carried over by cutting the selection [threshold] to the time the task was created. So any live or failed videos prior to this timestamp is ignored.
Fixes #202
Tested on Ubuntu 24.04 (LRN2)
Before
After