cache
¶
Cache utilities for FFmpeg operations.
Functions:
Name | Description |
---|---|
clean |
Clean the cache for a class. |
list_all |
List all objects of a class in the cache. |
load |
Load an object from the cache. |
save |
Save an object to the cache. |
list_all
¶
list_all(cls: type[T]) -> list[T]
List all objects of a class in the cache.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cls
|
type[T]
|
The class of the objects |
required |
Returns:
Type | Description |
---|---|
list[T]
|
A list of all objects of the class in the cache |
load
¶
load(cls: type[T], id: str) -> T
Load an object from the cache.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cls
|
type[T]
|
The class of the object |
required |
id
|
str
|
The id of the object |
required |
Returns:
Type | Description |
---|---|
T
|
The loaded object |
save
¶
save(obj: T, id: str) -> None
Save an object to the cache.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj
|
T
|
The object to save |
required |
id
|
str
|
The id of the object |
required |