Add share's contents and description to the DB

This commit is contained in:
Deluan
2023-01-21 22:04:40 -05:00
parent 364fdfbd8d
commit d9c42b3183
3 changed files with 31 additions and 1 deletions
+9
View File
@@ -10,6 +10,7 @@ import {
import {
SelectInput,
SimpleForm,
TextInput,
useCreate,
useGetList,
useNotify,
@@ -24,6 +25,7 @@ export const ShareDialog = ({ open, close, onClose, ids, resource, title }) => {
const [format, setFormat] = useState(config.defaultDownsamplingFormat)
const [maxBitRate, setMaxBitRate] = useState(DEFAULT_SHARE_BITRATE)
const [originalFormat, setUseOriginalFormat] = useState(true)
const [description, setDescription] = useState('')
const { data: formats, loading: loadingFormats } = useGetList(
'transcoding',
{
@@ -59,6 +61,7 @@ export const ShareDialog = ({ open, close, onClose, ids, resource, title }) => {
{
resourceType: resource,
resourceIds: ids?.join(','),
description,
...(!originalFormat && { format }),
...(!originalFormat && { maxBitRate }),
},
@@ -105,6 +108,12 @@ export const ShareDialog = ({ open, close, onClose, ids, resource, title }) => {
label={'Share in original format'}
onChange={handleOriginal}
/>
<TextInput
source="description"
onChange={(event) => {
setDescription(event.target.value)
}}
/>
{!originalFormat && (
<SelectInput
source="format"