Separate history into a class. #1

Closed
opened 2025-02-18 17:29:47 +01:00 by fedir · 4 comments
Owner

History needs to become it's own class to allow for easy addition of new history formats.

Here is the draft of the design specification of the new history classes and interfaces.

Screenshot From 2025-02-18 17-27-11.png

All classes related to history should be implemented in a separate file: history.py.

History needs to become it's own class to allow for easy addition of new history formats. Here is the draft of the design specification of the new history classes and interfaces. ![Screenshot From 2025-02-18 17-27-11.png](/attachments/14c6f6d7-57c7-42f0-975b-91aab4679259) All classes related to history should be implemented in a separate file: `history.py`.
fedir added the
enhancement
help wanted
labels 2025-02-18 17:37:10 +01:00
fedir added this to the Alpha project 2025-02-18 18:04:26 +01:00
nicolarius was assigned by fedir 2025-02-18 18:04:32 +01:00
Author
Owner

Slight redesign, with inclusion of a Video class (that will be implemented in a moment).

Slight redesign, with inclusion of a `Video` class (that will be implemented in a moment).
Collaborator

Succesfully separated

Succesfully separated
Author
Owner

Unfortunately this will not suffice for closing the issue.

  • Typing needs to be used to ensure that correct objects are passed to the functions. (e.g. if filename is of type str, the function argument should be filename: str)
  • parse_history() is not static (that is, you already need to have an instance of History to call it).
  • Interfaces should not implement any logic, and should just use pass instead.
  • parse_history() needs implementation.

Also, it seems like at least one implementation of the interface should be created for parse_history() to work, so FreeTubeHistory should be copied from parse_history() in preprocess.py to close this issue.

Unfortunately this will not suffice for closing the issue. * Typing needs to be used to ensure that correct objects are passed to the functions. (e.g. if `filename` is of type `str`, the function argument should be `filename: str`) * `parse_history()` is not static (that is, you already need to have an instance of `History` to call it). * Interfaces should not implement any logic, and should just use `pass` instead. * `parse_history()` needs implementation. Also, it seems like at least one implementation of the interface should be created for `parse_history()` to work, so `FreeTubeHistory` should be copied from `parse_history()` in `preprocess.py` to close this issue.
fedir reopened this issue 2025-02-18 19:24:23 +01:00
fedir added a new dependency 2025-02-18 19:55:56 +01:00
Author
Owner

Fixed by #13.

Fixed by #13.
fedir closed this issue 2025-02-26 20:48:14 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: fedir/shadowtube#1
No description provided.