VideoHistory¶
FileVideoHistory¶
- class ytnoti.models.history.FileVideoHistory(*, dir_path: Path, num_videos: int = 100)¶
Bases:
VideoHistoryRepresents a file-based history of videos.
- __init__(*, dir_path: Path, num_videos: int = 100) None¶
Create a new FileVideoHistory instance.
- Parameters:
dir_path – The path to the directory to store the history files
num_videos – The number of videos to keep in the history file. If the number of videos exceeds this value, the oldest videos will be removed.
InMemoryVideoHistory¶
- class ytnoti.models.history.InMemoryVideoHistory(*, cache_size: int = 5000)¶
Bases:
VideoHistoryRepresents an in-memory history of notifications.
- __init__(*, cache_size: int = 5000) None¶
Create a new InMemoryVideoHistory instance.
- Parameters:
cache_size – The size of the cache. If the cache is full, the oldest video will be removed.
- property cache_size: int¶
Get the size of the cache.
- Returns:
The size of the cache.