mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
Final work to add torrents categories
This commit is contained in:
@@ -26,12 +26,13 @@ export default function AddDialog({
|
||||
title: originalTitle,
|
||||
name: originalName,
|
||||
poster: originalPoster,
|
||||
category: originalCategory,
|
||||
}) {
|
||||
const { t } = useTranslation()
|
||||
const isEditMode = !!originalHash
|
||||
const [torrentSource, setTorrentSource] = useState(originalHash || '')
|
||||
const [title, setTitle] = useState(originalTitle || '')
|
||||
const [category, setCategory] = useState('Unknown')
|
||||
const [category, setCategory] = useState(originalCategory || '')
|
||||
const [originalTorrentTitle, setOriginalTorrentTitle] = useState('')
|
||||
const [parsedTitle, setParsedTitle] = useState('')
|
||||
const [posterUrl, setPosterUrl] = useState(originalPoster || '')
|
||||
@@ -248,7 +249,6 @@ export default function AddDialog({
|
||||
setTorrentSource={setTorrentSource}
|
||||
/>
|
||||
)}
|
||||
|
||||
<RightSideComponent
|
||||
originalTorrentTitle={originalTorrentTitle}
|
||||
setTitle={setTitle}
|
||||
|
||||
@@ -69,6 +69,8 @@ export default function RightSideComponent({
|
||||
setIsUserInteractedWithPoster(true)
|
||||
}
|
||||
|
||||
const torrentCategories = ['Movies', 'Series', 'Music', 'Other', 'Unknown']
|
||||
|
||||
return (
|
||||
<RightSide>
|
||||
<RightSideContainer isHidden={!isTorrentSourceCorrect || (isHashAlreadyExists && !isEditMode)}>
|
||||
@@ -113,26 +115,6 @@ export default function RightSideComponent({
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
<FormControl fullWidth>
|
||||
<InputLabel id='torrent-category-select-label'>Torrent category</InputLabel>
|
||||
<Select
|
||||
labelId='torrent-category-select-label'
|
||||
id='torrent-category-select'
|
||||
value={category}
|
||||
label='Torrent category'
|
||||
margin='dense'
|
||||
onChange={handleCategoryChange}
|
||||
variant='outlined'
|
||||
fullWidth
|
||||
>
|
||||
<MenuItem value='Films'>Films</MenuItem>
|
||||
<MenuItem value='Series'>Series</MenuItem>
|
||||
<MenuItem value='Music'>Music</MenuItem>
|
||||
<MenuItem value='Other'>Other</MenuItem>
|
||||
<MenuItem value='Unknown'>Unknown</MenuItem>
|
||||
</Select>
|
||||
</FormControl>
|
||||
</>
|
||||
) : (
|
||||
<TextField
|
||||
@@ -156,6 +138,25 @@ export default function RightSideComponent({
|
||||
fullWidth
|
||||
/>
|
||||
|
||||
<FormControl fullWidth>
|
||||
<InputLabel id='torrent-category-select-label'>Torrent category</InputLabel>
|
||||
<Select
|
||||
labelId='torrent-category-select-label'
|
||||
id='torrent-category-select'
|
||||
value={category}
|
||||
label='Torrent category'
|
||||
margin='dense'
|
||||
onChange={handleCategoryChange}
|
||||
variant='outlined'
|
||||
fullWidth
|
||||
defaultValue='Unknown'
|
||||
>
|
||||
{torrentCategories.map(category => (
|
||||
<MenuItem value={category}>{category}</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
</FormControl>
|
||||
|
||||
<PosterWrapper>
|
||||
<Poster poster={+isPosterUrlCorrect}>
|
||||
{isPosterUrlCorrect ? <img src={posterUrl} alt='poster' /> : <NoImageIcon />}
|
||||
|
||||
@@ -185,7 +185,14 @@ const Torrent = ({ torrent }) => {
|
||||
</Dialog>
|
||||
|
||||
{isEditDialogOpen && (
|
||||
<AddDialog hash={hash} title={title} name={name} poster={poster} handleClose={handleCloseEditDialog} />
|
||||
<AddDialog
|
||||
hash={hash}
|
||||
title={title}
|
||||
name={name}
|
||||
poster={poster}
|
||||
handleClose={handleCloseEditDialog}
|
||||
category={category}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user