feat: add library icons
This commit is contained in:
@@ -17,6 +17,7 @@ class Library(BigIntAuditBase, SlugKey):
|
||||
# Which structure to save the files in the filesystem (i.e {author_name}/{title}.{ext})
|
||||
path_template: Mapped[str]
|
||||
description: Mapped[Optional[str]]
|
||||
icon: Mapped[str] = mapped_column(default="library")
|
||||
read_only: Mapped[bool] = mapped_column(nullable=False, default=False)
|
||||
|
||||
books: Mapped[list["Book"]] = relationship(back_populates="library")
|
||||
|
||||
@@ -8,6 +8,7 @@ class LibraryCreate(BaseModel):
|
||||
root_path: str
|
||||
path_template: str | None = "{author}/{title}"
|
||||
description: str | None = None
|
||||
icon: str = "library"
|
||||
read_only: bool = False
|
||||
|
||||
@computed_field
|
||||
@@ -21,6 +22,7 @@ class LibraryRead(BaseModel):
|
||||
root_path: str
|
||||
path_template: str
|
||||
description: str | None
|
||||
icon: str
|
||||
read_only: bool
|
||||
total: int | None = None
|
||||
|
||||
@@ -30,4 +32,5 @@ class LibraryUpdate(BaseModel):
|
||||
root_path: str | None
|
||||
path_template: str | None
|
||||
description: str | None
|
||||
icon: str | None
|
||||
read_only: bool | None
|
||||
|
||||
Reference in New Issue
Block a user