OpenSlides/server/openslides/mediafiles/projector.py

30 lines
708 B
Python
Raw Normal View History

2018-12-23 11:05:38 +01:00
from typing import Any, Dict
2019-02-15 12:01:16 +01:00
from ..utils.projector import (
ProjectorAllDataProvider,
get_model,
2019-02-15 12:01:16 +01:00
register_projector_slide,
)
async def mediafile_slide(
all_data_provider: ProjectorAllDataProvider,
element: Dict[str, Any],
projector_id: int,
2019-02-21 14:40:07 +01:00
) -> Dict[str, Any]:
2018-12-23 11:05:38 +01:00
"""
Slide for Mediafile.
"""
mediafile = await get_model(
all_data_provider, "mediafiles/mediafile", element.get("id")
)
2019-02-15 12:01:16 +01:00
return {
"path": mediafile["path"],
"mimetype": mediafile["mimetype"],
2019-02-15 12:01:16 +01:00
"media_url_prefix": mediafile["media_url_prefix"],
}
def register_projector_slides() -> None:
register_projector_slide("mediafiles/mediafile", mediafile_slide)