feat(signage): gallery widget (pictures and videos one after another, from a list or a media folder); media folders on the Media page
Folders are only a grouping in the database (media_folders, media.folder_id, Alembic 0046): made, renamed, deleted (files stay) on the Media page, a file filed from its details, uploads go into the folder shown, the picker filters by folder. The gallery widget: its own pictures/videos in order or a folder as it is now, seconds each, fade / slide / zoom, cover / contain. Plan 6R.16, F-114. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -39,9 +39,21 @@ class Media(Base):
|
||||
# or no video tool on this server). `progress` 0-100 while working.
|
||||
processing = Column(String, nullable=True)
|
||||
progress = Column(Integer, nullable=True)
|
||||
# its folder on the Media page (6R.16): only a grouping, the file stays where it is
|
||||
folder_id = Column(Integer, ForeignKey("media_folders.id", ondelete="SET NULL"), nullable=True, index=True)
|
||||
|
||||
uploader = relationship("User", lazy="joined")
|
||||
|
||||
@property
|
||||
def uploaded_by_name(self):
|
||||
return self.uploader.full_name or self.uploader.username if self.uploader is not None else None
|
||||
|
||||
|
||||
class MediaFolder(Base):
|
||||
"""A folder of the media library (6R.16): a name and a place in the list; its files point at it."""
|
||||
__tablename__ = "media_folders"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
name = Column(String, nullable=False)
|
||||
position = Column(Integer, nullable=False, default=0, server_default='0')
|
||||
created_at = Column(UTCDateTime, default=utcnow, nullable=False)
|
||||
|
||||
Reference in New Issue
Block a user