1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

apply suggestion

Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com>
This commit is contained in:
grafixeyehero 2024-06-09 08:08:10 +03:00
parent 4d37b47331
commit 06e585e2bc
2 changed files with 13 additions and 13 deletions

View file

@ -35,13 +35,13 @@ const PlaybackTrickplay: FC = () => {
(page.querySelector('.chkEnableHwEncoding') as HTMLInputElement).checked = options?.EnableHwEncoding || false; (page.querySelector('.chkEnableHwEncoding') as HTMLInputElement).checked = options?.EnableHwEncoding || false;
(page.querySelector('#selectScanBehavior') as HTMLSelectElement).value = (options?.ScanBehavior || TrickplayScanBehavior.NonBlocking); (page.querySelector('#selectScanBehavior') as HTMLSelectElement).value = (options?.ScanBehavior || TrickplayScanBehavior.NonBlocking);
(page.querySelector('#selectProcessPriority') as HTMLSelectElement).value = (options?.ProcessPriority || ProcessPriorityClass.Normal); (page.querySelector('#selectProcessPriority') as HTMLSelectElement).value = (options?.ProcessPriority || ProcessPriorityClass.Normal);
(page.querySelector('#txtInterval') as HTMLInputElement).value = String(options?.Interval); (page.querySelector('#txtInterval') as HTMLInputElement).value = options?.Interval?.toString() || '10000';
(page.querySelector('#txtWidthResolutions') as HTMLInputElement).value = options?.WidthResolutions?.join(',') || ''; (page.querySelector('#txtWidthResolutions') as HTMLInputElement).value = options?.WidthResolutions?.join(',') || '';
(page.querySelector('#txtTileWidth') as HTMLInputElement).value = String(options?.TileWidth); (page.querySelector('#txtTileWidth') as HTMLInputElement).value = options?.TileWidth?.toString() || '10';
(page.querySelector('#txtTileHeight') as HTMLInputElement).value = String(options?.TileHeight); (page.querySelector('#txtTileHeight') as HTMLInputElement).value = options?.TileHeight?.toString() || '10';
(page.querySelector('#txtQscale') as HTMLInputElement).value = String(options?.Qscale); (page.querySelector('#txtQscale') as HTMLInputElement).value = options?.Qscale?.toString() || '4';
(page.querySelector('#txtJpegQuality') as HTMLInputElement).value = String(options?.JpegQuality); (page.querySelector('#txtJpegQuality') as HTMLInputElement).value = options?.JpegQuality?.toString() || '90';
(page.querySelector('#txtProcessThreads') as HTMLInputElement).value = String(options?.ProcessThreads); (page.querySelector('#txtProcessThreads') as HTMLInputElement).value = options?.ProcessThreads?.toString() || '1';
loading.hide(); loading.hide();
}, []); }, []);

View file

@ -20,12 +20,12 @@ import Page from '../../../../components/Page';
import prompt from '../../../../components/prompt/prompt'; import prompt from '../../../../components/prompt/prompt';
import ServerConnections from 'components/ServerConnections'; import ServerConnections from 'components/ServerConnections';
type ItemArr = { type NamedItem = {
name: string; name: string;
value: UnratedItem; value: UnratedItem;
}; };
type UnratedItemArr = ItemArr & { type UnratedNamedItem = NamedItem & {
checkedAttribute: string checkedAttribute: string
}; };
@ -63,7 +63,7 @@ function handleSaveUser(
const UserParentalControl = () => { const UserParentalControl = () => {
const [ userName, setUserName ] = useState(''); const [ userName, setUserName ] = useState('');
const [ parentalRatings, setParentalRatings ] = useState<ParentalRating[]>([]); const [ parentalRatings, setParentalRatings ] = useState<ParentalRating[]>([]);
const [ unratedItems, setUnratedItems ] = useState<UnratedItemArr[]>([]); const [ unratedItems, setUnratedItems ] = useState<UnratedNamedItem[]>([]);
const [ accessSchedules, setAccessSchedules ] = useState<AccessSchedule[]>([]); const [ accessSchedules, setAccessSchedules ] = useState<AccessSchedule[]>([]);
const [ allowedTags, setAllowedTags ] = useState<string[]>([]); const [ allowedTags, setAllowedTags ] = useState<string[]>([]);
const [ blockedTags, setBlockedTags ] = useState<string[]>([]); const [ blockedTags, setBlockedTags ] = useState<string[]>([]);
@ -103,7 +103,7 @@ const UserParentalControl = () => {
return; return;
} }
const items: ItemArr[] = [{ const items: NamedItem[] = [{
name: globalize.translate('Books'), name: globalize.translate('Books'),
value: UnratedItem.Book value: UnratedItem.Book
}, { }, {
@ -126,19 +126,19 @@ const UserParentalControl = () => {
value: UnratedItem.Series value: UnratedItem.Series
}]; }];
const itemsArr: UnratedItemArr[] = []; const unratedNamedItem: UnratedNamedItem[] = [];
for (const item of items) { for (const item of items) {
const isChecked = user.Policy?.BlockUnratedItems?.indexOf(item.value) != -1; const isChecked = user.Policy?.BlockUnratedItems?.indexOf(item.value) != -1;
const checkedAttribute = isChecked ? ' checked="checked"' : ''; const checkedAttribute = isChecked ? ' checked="checked"' : '';
itemsArr.push({ unratedNamedItem.push({
value: item.value, value: item.value,
name: item.name, name: item.name,
checkedAttribute: checkedAttribute checkedAttribute: checkedAttribute
}); });
} }
setUnratedItems(itemsArr); setUnratedItems(unratedNamedItem);
const blockUnratedItems = page.querySelector('.blockUnratedItems') as HTMLDivElement; const blockUnratedItems = page.querySelector('.blockUnratedItems') as HTMLDivElement;
blockUnratedItems.dispatchEvent(new CustomEvent('create')); blockUnratedItems.dispatchEvent(new CustomEvent('create'));