update web for categories

This commit is contained in:
nikk gitanes
2024-04-06 05:14:27 +03:00
parent 0e33bae9ae
commit de8137bfbf
10 changed files with 66 additions and 29 deletions

View File

@@ -61,8 +61,8 @@ func AddTorrent(spec *torrent.TorrentSpec, title, poster string, data string, ca
if torr.Category == "" {
if torDB != nil {
torr.Category = torDB.Category
} else {
torr.Category = "Unknown"
// } else {
// torr.Category = "None"
}
}
@@ -72,6 +72,7 @@ func AddTorrent(spec *torrent.TorrentSpec, title, poster string, data string, ca
torr.Poster = torDB.Poster
}
}
if torr.Data == "" {
torr.Data = data
if torr.Data == "" && torDB != nil {

View File

@@ -3,9 +3,9 @@ import { rgba } from 'polished'
import { NoImageIcon } from 'icons'
import {
FormControl,
FormHelperText,
IconButton,
InputAdornment,
InputLabel,
MenuItem,
Select,
TextField,
@@ -136,19 +136,19 @@ export default function RightSideComponent({
variant='outlined'
fullWidth
/>
<FormControl fullWidth>
<InputLabel id='torrent-category-select-label'>Torrent category</InputLabel>
<FormHelperText style={{ padding: '0.2em 1.2em 0.5em 1.2em' }}>
{t('AddDialog.CategoryHelperText')}
</FormHelperText>
<Select
labelId='torrent-category-select-label'
id='torrent-category-select'
value={category}
label='Torrent category'
margin='dense'
onChange={handleCategoryChange}
variant='outlined'
fullWidth
defaultValue='Unknown'
defaultValue='Other'
>
{TORRENT_CATEGORIES.map(category => (
<MenuItem value={category.name}>{category.name}</MenuItem>

View File

@@ -116,15 +116,12 @@ const Torrent = ({ torrent }) => {
</TorrentCardButtons>
<TorrentCardDescription>
<div className='description-wrapper'>
<div className='description-title-wrapper'>
<div className='description-section-name'>{t('Name')}</div>
<div className='description-torrent-title'>{parsedTitle}</div>
</div>
<div className='description-category-wrapper'>
<div className='description-section-name'>{t('Category')}</div>
<div className='description-torrent-title'>{category}</div>
<div className='description-title-wrapper'>
<div className='description-section-name'>
{t('Name')}
<div className='description-category-wrapper'>{category}</div>
</div>
<div className='description-torrent-title'>{parsedTitle}</div>
</div>
<div className='description-statistics-wrapper'>

View File

@@ -94,6 +94,7 @@ export const TorrentCardButtons = styled.div`
export const TorrentCardDescription = styled.div`
${({
theme: {
app: { sidebarBGColor },
torrentCard: { cardSecondaryColor, accentCardColor },
},
}) => css`
@@ -110,21 +111,17 @@ export const TorrentCardDescription = styled.div`
gap: 3px;
}
.description-wrapper {
display: flex;
flex-direction: row;
}
.description-wrapper > * {
flex: 1;
}
.description-title-wrapper {
display: flex;
flex-direction: column;
}
.description-section-name {
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
self-align: end;
text-transform: uppercase;
font-size: 10px;
font-weight: 600;
@@ -138,9 +135,8 @@ export const TorrentCardDescription = styled.div`
}
.description-category-wrapper {
display: flex;
flex-direction: column;
align-items: end;
display: inline-flex;
color: ${sidebarBGColor};
}
.description-status-wrapper {

View File

@@ -2,12 +2,12 @@ import MovieCreationIcon from '@material-ui/icons/MovieCreation'
import LiveTvIcon from '@material-ui/icons/LiveTv'
import MusicNoteIcon from '@material-ui/icons/MusicNote'
import MoreHorizIcon from '@material-ui/icons/MoreHoriz'
import HelpIcon from '@material-ui/icons/Help'
// import HelpIcon from '@material-ui/icons/Help'
export const TORRENT_CATEGORIES = [
{ name: 'Movies', icon: <MovieCreationIcon /> },
{ name: 'Series', icon: <LiveTvIcon /> },
{ name: 'Music', icon: <MusicNoteIcon /> },
{ name: 'Other', icon: <MoreHorizIcon /> },
{ name: 'Unknown', icon: <HelpIcon /> },
// { name: 'None', icon: <HelpIcon /> }, // TODO: unset category with this option
]

View File

@@ -9,6 +9,7 @@
"Or": "или",
"ClickOrDrag": "Щракнете / Влачи§Пусни (.torrent)"
},
"CategoryHelperText": "Торент категория",
"CustomTorrentTitle": "Персонализирано заглавие (по избор)",
"CustomTorrentTitleHelperText": "Напишете персонализирано заглавие, за да намерите плакат",
"HashExists": "Този торент вече е в базата данни",
@@ -28,6 +29,14 @@
"BufferNote": "Задайте предварително зареден кеш преди възпроизвеждане > 32 MB в настройките, за да промените предварителния буфер",
"Cache": "Кеш",
"Cancel": "Отказ",
"Category": "Категория",
"CategoryLabel": {
"Movies": "Филми",
"Series": "Серия",
"Music": "Музика",
"Other": "Други",
"None": "Нито един"
},
"Clear": "Изчисти",
"Close": "Затвори",
"CloseServer?": "Искате ли да изключите сървъра?",

View File

@@ -9,6 +9,7 @@
"Or": "OR",
"ClickOrDrag": "CLICK / DRAG & DROP (.torrent)"
},
"CategoryHelperText": "Torrent category",
"CustomTorrentTitle": "Custom title (optional)",
"CustomTorrentTitleHelperText": "Write custom title to find poster",
"HashExists": "This torrent is already in database",
@@ -28,6 +29,13 @@
"BufferNote": "Set Preload Cache Before Play > 32 MB in settings to change preload size",
"Cache": "Cache",
"Cancel": "Cancel",
"Category": "Category",
"CategoryLabel": {
"Movies": "Movies",
"Series": "Series",
"Music": "Music",
"Other": "Other"
},
"Clear": "Clear",
"Close": "Close",
"CloseServer?": "Do you want to turn off server?",

View File

@@ -9,6 +9,7 @@
"Or": "ИЛИ",
"ClickOrDrag": "НАЖМИТЕ / ПЕРЕТАЩИТЕ ФАЙЛ (.torrent)"
},
"CategoryHelperText": "Категория для торрента",
"CustomTorrentTitle": "Cвое название (не обязательно)",
"CustomTorrentTitleHelperText": "Напишите свое название, чтобы найти постер",
"HashExists": "Этот торрент уже есть в базе данных",
@@ -28,6 +29,13 @@
"BufferNote": "Установите Буфер предзагрузки > 32 МБ в настройках для измененения размера предзагрузки",
"Cache": "Кеш",
"Cancel": "Отмена",
"Category": "Категория",
"CategoryLabel": {
"Movies": "Фильмы",
"Series": "Сериалы",
"Music": "Музыка",
"Other": "Другое"
},
"Clear": "Очистить",
"Close": "Закрыть",
"CloseServer?": "Хотите выключить сервер?",

View File

@@ -9,6 +9,7 @@
"Or": "ЧИ",
"ClickOrDrag": "НАТИСНІТЬ / ПЕРЕТЯГНІТЬ ФАЙЛ (.torrent)"
},
"CategoryHelperText": "Торрент-категорія",
"CustomTorrentTitle": "Власна назва (опційно)",
"CustomTorrentTitleHelperText": "Напишіть власну назву, щоб знайти плакат",
"HashExists": "Даний торент вже є у базі даних",
@@ -28,6 +29,14 @@
"BufferNote": "Встановіть буфер попереднього завантаження > 32 МБ в налаштуваннях, щоб його змінити.",
"Cache": "Кеш",
"Cancel": "Скасувати",
"Category": "Категорія",
"CategoryLabel": {
"Movies": "Фільми",
"Series": "Серія",
"Music": "Музика",
"Other": "Інший",
"None": "Жодного"
},
"Clear": "Очистити",
"Close": "Закрити",
"CloseServer?": "Хочете вимкнути сервер?",

View File

@@ -9,6 +9,7 @@
"Or": "或",
"ClickOrDrag": "点击/拖放上传 (.torrent)"
},
"CategoryHelperText": "Torrent 类别",
"CustomTorrentTitle": "自定义标题(可选)",
"CustomTorrentTitleHelperText": "编写自定义标题以查找海报",
"HashExists": "这个种子已经在数据库中",
@@ -28,6 +29,14 @@
"BufferNote": "在设置中将播放前预加载缓存设置为大于 32 MB 以更改预加载大小",
"Cache": "缓存",
"Cancel": "取消",
"Category": "类别",
"CategoryLabel": {
"Movies": "电影",
"Series": "系列",
"Music": "音乐",
"Other": "其他",
"None": "没有任何"
},
"Clear": "清除",
"Close": "关闭",
"CloseServer?": "你想关闭服务器吗?",