From c1ce6d539df8496be629dda507f04d345fe1d6aa Mon Sep 17 00:00:00 2001 From: Infinite Date: Wed, 29 Jan 2020 22:28:13 +0100 Subject: [PATCH] Prettier --- ui/v2.5/src/components/Galleries/Gallery.tsx | 5 +- ui/v2.5/src/components/MainNavbar.tsx | 4 +- .../SceneFilenameParser/ParserField.ts | 1 - .../SceneFilenameParser/ParserInput.tsx | 56 ++++++++++---- .../SceneFilenameParser.tsx | 18 ++--- .../SceneFilenameParser/ShowFields.tsx | 11 +-- .../Settings/SettingsAboutPanel.tsx | 2 +- .../Settings/SettingsConfigurationPanel.tsx | 44 ++++++----- .../Settings/SettingsInterfacePanel.tsx | 5 +- .../components/Settings/SettingsLogsPanel.tsx | 2 +- .../SettingsTasksPanel/GenerateButton.tsx | 7 +- .../SettingsTasksPanel/SettingsTasksPanel.tsx | 4 +- .../components/Shared/DetailsEditNavbar.tsx | 26 ++++--- .../src/components/Shared/DurationInput.tsx | 14 +++- .../Shared/FolderSelect/FolderSelect.tsx | 10 ++- ui/v2.5/src/components/Shared/ImageInput.tsx | 10 ++- .../components/Shared/LoadingIndicator.tsx | 9 ++- ui/v2.5/src/components/Shared/Select.tsx | 37 ++++++---- ui/v2.5/src/components/Shared/index.ts | 2 +- ui/v2.5/src/components/Stats.tsx | 5 +- ui/v2.5/src/components/Studios/StudioCard.tsx | 7 +- .../Studios/StudioDetails/Studio.tsx | 28 ++++--- .../StudioDetails/StudioScenesPanel.tsx | 4 +- ui/v2.5/src/components/Studios/StudioList.tsx | 3 +- ui/v2.5/src/components/Tags/TagList.tsx | 7 +- ui/v2.5/src/components/Wall/WallItem.tsx | 7 +- ui/v2.5/src/components/list/AddFilter.tsx | 17 ++++- ui/v2.5/src/components/list/ListFilter.tsx | 22 ++++-- ui/v2.5/src/components/list/Pagination.tsx | 23 +++--- .../performers/PerformerDetails/Performer.tsx | 36 ++++++--- .../PerformerDetailsPanel.tsx | 26 ++++--- .../scenes/SceneDetails/PrimaryTags.tsx | 43 +++++------ .../components/scenes/SceneDetails/Scene.tsx | 28 +++---- .../scenes/SceneDetails/SceneDetailPanel.tsx | 20 +++-- .../scenes/SceneDetails/SceneEditPanel.tsx | 22 +++--- .../SceneDetails/SceneFileInfoPanel.tsx | 16 +++- .../scenes/SceneDetails/SceneMarkerForm.tsx | 73 +++++++++---------- .../scenes/SceneDetails/SceneMarkersPanel.tsx | 31 ++++---- .../src/components/scenes/SceneMarkerList.tsx | 4 +- .../scenes/ScenePlayer/ScenePlayer.tsx | 7 +- .../scenes/SceneSelectedOptions.tsx | 19 +++-- ui/v2.5/src/hooks/ListHook.tsx | 2 +- ui/v2.5/src/utils/index.ts | 2 +- ui/v2.5/src/utils/jwplayer.ts | 4 +- ui/v2.5/src/utils/table.tsx | 6 +- 45 files changed, 419 insertions(+), 310 deletions(-) diff --git a/ui/v2.5/src/components/Galleries/Gallery.tsx b/ui/v2.5/src/components/Galleries/Gallery.tsx index e6cc10f24..4bc0dcd48 100644 --- a/ui/v2.5/src/components/Galleries/Gallery.tsx +++ b/ui/v2.5/src/components/Galleries/Gallery.tsx @@ -1,7 +1,7 @@ import React from "react"; import { useParams } from "react-router-dom"; import { StashService } from "src/core/StashService"; -import { LoadingIndicator } from 'src/components/Shared'; +import { LoadingIndicator } from "src/components/Shared"; import { GalleryViewer } from "./GalleryViewer"; export const Gallery: React.FC = () => { @@ -10,8 +10,7 @@ export const Gallery: React.FC = () => { const { data, error, loading } = StashService.useFindGallery(id); const gallery = data?.findGallery; - if (loading || !gallery) - return ; + if (loading || !gallery) return ; if (error) return
{error.message}
; return ( diff --git a/ui/v2.5/src/components/MainNavbar.tsx b/ui/v2.5/src/components/MainNavbar.tsx index 87649c477..fcab11e27 100644 --- a/ui/v2.5/src/components/MainNavbar.tsx +++ b/ui/v2.5/src/components/MainNavbar.tsx @@ -91,9 +91,7 @@ export const MainNavbar: React.FC = () => { ))}
Notes
- This is still an early version, some things are still a work in progress. + + This is still an early version, some things are still a work in + progress. + ); diff --git a/ui/v2.5/src/components/Studios/StudioCard.tsx b/ui/v2.5/src/components/Studios/StudioCard.tsx index e6f813270..13c621813 100644 --- a/ui/v2.5/src/components/Studios/StudioCard.tsx +++ b/ui/v2.5/src/components/Studios/StudioCard.tsx @@ -10,11 +10,8 @@ interface IProps { export const StudioCard: React.FC = ({ studio }) => { return ( - - {studio.name} + + {studio.name}
{studio.name}
diff --git a/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx b/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx index 716aea489..127ccd7f0 100644 --- a/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx +++ b/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx @@ -3,14 +3,18 @@ import { Table } from "react-bootstrap"; import React, { useEffect, useState } from "react"; import { useParams, useHistory } from "react-router-dom"; -import cx from 'classnames'; +import cx from "classnames"; import * as GQL from "src/core/generated-graphql"; import { StashService } from "src/core/StashService"; import { ImageUtils, TableUtils } from "src/utils"; -import { DetailsEditNavbar, Modal, LoadingIndicator } from "src/components/Shared"; +import { + DetailsEditNavbar, + Modal, + LoadingIndicator +} from "src/components/Shared"; import { useToast } from "src/hooks"; -import { StudioScenesPanel } from './StudioScenesPanel'; +import { StudioScenesPanel } from "./StudioScenesPanel"; export const Studio: React.FC = () => { const history = useHistory(); @@ -71,8 +75,7 @@ export const Studio: React.FC = () => { ImageUtils.usePasteImage(onImageLoad); if (!isNew && !isEditing) { - if (!data?.findStudio || loading) - return ; + if (!data?.findStudio || loading) return ; if (error) return
{error.message}
; } @@ -142,21 +145,26 @@ export const Studio: React.FC = () => { accept={{ text: "Delete", variant: "danger", onClick: onDelete }} cancel={{ onClick: () => setIsDeleteAlertOpen(false) }} > -

Are you sure you want to delete {studio.name ?? 'studio'}?

+

Are you sure you want to delete {studio.name ?? "studio"}?

); } return (
-
- { isNew &&

Add Studio

} +
+ {isNew &&

Add Studio

} {name} {TableUtils.renderInputGroup({ title: "Name", - value: studio.name ?? '', + value: studio.name ?? "", isEditing: !!isEditing, onChange: setName })} @@ -179,7 +187,7 @@ export const Studio: React.FC = () => { onDelete={onDelete} /> - { !isNew && ( + {!isNew && (
diff --git a/ui/v2.5/src/components/Studios/StudioDetails/StudioScenesPanel.tsx b/ui/v2.5/src/components/Studios/StudioDetails/StudioScenesPanel.tsx index 92a4d5f24..4f1550f29 100644 --- a/ui/v2.5/src/components/Studios/StudioDetails/StudioScenesPanel.tsx +++ b/ui/v2.5/src/components/Studios/StudioDetails/StudioScenesPanel.tsx @@ -8,9 +8,7 @@ interface IStudioScenesPanel { studio: Partial; } -export const StudioScenesPanel: React.FC = ({ - studio -}) => { +export const StudioScenesPanel: React.FC = ({ studio }) => { function filterHook(filter: ListFilterModel) { const studioValue = { id: studio.id!, label: studio.name! }; // if studio is already present, then we modify it, otherwise add diff --git a/ui/v2.5/src/components/Studios/StudioList.tsx b/ui/v2.5/src/components/Studios/StudioList.tsx index 1173b1678..5bb0d4305 100644 --- a/ui/v2.5/src/components/Studios/StudioList.tsx +++ b/ui/v2.5/src/components/Studios/StudioList.tsx @@ -14,8 +14,7 @@ export const StudioList: React.FC = () => { result: FindStudiosQueryResult, filter: ListFilterModel ) { - if (!result.data?.findStudios) - return; + if (!result.data?.findStudios) return; if (filter.displayMode === DisplayMode.Grid) { return ( diff --git a/ui/v2.5/src/components/Tags/TagList.tsx b/ui/v2.5/src/components/Tags/TagList.tsx index 7dfbfb6fc..24684293b 100644 --- a/ui/v2.5/src/components/Tags/TagList.tsx +++ b/ui/v2.5/src/components/Tags/TagList.tsx @@ -93,8 +93,7 @@ export const TagList: React.FC = () => { ); - if (!data?.allTags) - return ; + if (!data?.allTags) return ; if (error) return
{error.message}
; const tagElements = data.allTags.map(tag => { @@ -104,7 +103,9 @@ export const TagList: React.FC = () => { {tag.name}
- + @@ -180,7 +183,9 @@ export const ListFilter: React.FC = ( function renderSelectAll() { if (props.onSelectAll) { return ( - onSelectAll()}>Select All + onSelectAll()}> + Select All + ); } } @@ -201,7 +206,9 @@ export const ListFilter: React.FC = ( if (props.otherOperations) { props.otherOperations.forEach(o => { options.push( - {o.text} + + {o.text} + ); }); } @@ -259,7 +266,9 @@ export const ListFilter: React.FC = ( className="filter-item col-1 d-none d-sm-inline" > {PAGE_SIZE_OPTIONS.map(s => ( - + ))} @@ -288,7 +297,6 @@ export const ListFilter: React.FC = ( - = ( {maybeRenderZoom()} - {renderMore()} + + {renderMore()} +
= ({ i => startPage + i ); - const calculatePageClass = (buttonPage:number) => { - if(pages.length <= 4) return ''; + const calculatePageClass = (buttonPage: number) => { + if (pages.length <= 4) return ""; - if(currentPage === 1 && buttonPage <= 4) return ''; + if (currentPage === 1 && buttonPage <= 4) return ""; const maxPage = pages[pages.length - 1]; - if(currentPage === maxPage && buttonPage > (maxPage - 3)) return ''; - if(Math.abs(buttonPage - currentPage) <= 1) return ''; - return 'd-none d-sm-block' - } + if (currentPage === maxPage && buttonPage > maxPage - 3) return ""; + if (Math.abs(buttonPage - currentPage) <= 1) return ""; + return "d-none d-sm-block"; + }; const pageButtons = pages.map((page: number) => ( )); - if(pages.length <= 1) - return
; + if (pages.length <= 1) return
; return ( - diff --git a/ui/v2.5/src/components/performers/PerformerDetails/Performer.tsx b/ui/v2.5/src/components/performers/PerformerDetails/Performer.tsx index 9b53a742e..1c37e516d 100644 --- a/ui/v2.5/src/components/performers/PerformerDetails/Performer.tsx +++ b/ui/v2.5/src/components/performers/PerformerDetails/Performer.tsx @@ -3,7 +3,7 @@ import React, { useEffect, useState } from "react"; import { Button, Tabs, Tab } from "react-bootstrap"; import { useParams, useHistory } from "react-router-dom"; -import cx from 'classnames' +import cx from "classnames"; import * as GQL from "src/core/generated-graphql"; import { StashService } from "src/core/StashService"; import { Icon, LoadingIndicator } from "src/components/Shared"; @@ -166,34 +166,52 @@ export const Performer: React.FC = () => { const renderIcons = () => ( - { performer.url && ( + {performer.url && ( )} - { performer.twitter && ( + {performer.twitter && ( )} - { performer.instagram && ( + {performer.instagram && ( )} - ) + ); function renderNewView() { return ( diff --git a/ui/v2.5/src/components/performers/PerformerDetails/PerformerDetailsPanel.tsx b/ui/v2.5/src/components/performers/PerformerDetails/PerformerDetailsPanel.tsx index a6b288ba9..03ef8ee65 100644 --- a/ui/v2.5/src/components/performers/PerformerDetails/PerformerDetailsPanel.tsx +++ b/ui/v2.5/src/components/performers/PerformerDetails/PerformerDetailsPanel.tsx @@ -1,16 +1,16 @@ /* eslint-disable react/no-this-in-sfc */ import React, { useEffect, useState } from "react"; -import { - Button, - Form, - Popover, - OverlayTrigger, - Table -} from "react-bootstrap"; +import { Button, Form, Popover, OverlayTrigger, Table } from "react-bootstrap"; import * as GQL from "src/core/generated-graphql"; import { StashService } from "src/core/StashService"; -import { Icon, Modal, ImageInput, ScrapePerformerSuggest, LoadingIndicator } from "src/components/Shared"; +import { + Icon, + Modal, + ImageInput, + ScrapePerformerSuggest, + LoadingIndicator +} from "src/components/Shared"; import { ImageUtils, TableUtils } from "src/utils"; import { useToast } from "src/hooks"; @@ -276,7 +276,10 @@ export const PerformerDetailsPanel: React.FC = ({ return undefined; } return ( - ); @@ -446,7 +449,10 @@ export const PerformerDetailsPanel: React.FC = ({ isEditing: !!isEditing, onChange: setInstagram })} - +
diff --git a/ui/v2.5/src/components/scenes/SceneDetails/PrimaryTags.tsx b/ui/v2.5/src/components/scenes/SceneDetails/PrimaryTags.tsx index 7e2900d4b..ff4ff02e7 100644 --- a/ui/v2.5/src/components/scenes/SceneDetails/PrimaryTags.tsx +++ b/ui/v2.5/src/components/scenes/SceneDetails/PrimaryTags.tsx @@ -1,22 +1,25 @@ import React from "react"; import * as GQL from "src/core/generated-graphql"; -import { Button, Badge, Card } from 'react-bootstrap'; +import { Button, Badge, Card } from "react-bootstrap"; import { TextUtils } from "src/utils"; interface IPrimaryTags { sceneMarkers: GQL.SceneMarkerDataFragment[]; - onClickMarker: (marker:GQL.SceneMarkerDataFragment) => void; - onEdit: (marker:GQL.SceneMarkerDataFragment) =>void; + onClickMarker: (marker: GQL.SceneMarkerDataFragment) => void; + onEdit: (marker: GQL.SceneMarkerDataFragment) => void; } -export const PrimaryTags: React.FC = ({ sceneMarkers, onClickMarker, onEdit }) => { +export const PrimaryTags: React.FC = ({ + sceneMarkers, + onClickMarker, + onEdit +}) => { if (!sceneMarkers?.length) return
; - const primaries:Record = {}; - const primaryTags:Record = {}; + const primaries: Record = {}; + const primaryTags: Record = {}; sceneMarkers.forEach(m => { - if(primaryTags[m.primary_tag.id]) - primaryTags[m.primary_tag.id].push(m); + if (primaryTags[m.primary_tag.id]) primaryTags[m.primary_tag.id].push(m); else { primaryTags[m.primary_tag.id] = [m]; primaries[m.primary_tag.id] = m.primary_tag; @@ -38,13 +41,13 @@ export const PrimaryTags: React.FC = ({ sceneMarkers, onClickMarke - +
{TextUtils.secondsToTimestamp(marker.seconds)}
{tags}
@@ -55,16 +58,10 @@ export const PrimaryTags: React.FC = ({ sceneMarkers, onClickMarke return (

{primaries[id].name}

- - { markers } - + {markers}
); }); - return ( -
- { primaryCards } -
- ); + return
{primaryCards}
; }; diff --git a/ui/v2.5/src/components/scenes/SceneDetails/Scene.tsx b/ui/v2.5/src/components/scenes/SceneDetails/Scene.tsx index 011bff2db..76ff43233 100644 --- a/ui/v2.5/src/components/scenes/SceneDetails/Scene.tsx +++ b/ui/v2.5/src/components/scenes/SceneDetails/Scene.tsx @@ -5,7 +5,7 @@ import { useParams, useLocation, useHistory } from "react-router-dom"; import * as GQL from "src/core/generated-graphql"; import { StashService } from "src/core/StashService"; import { GalleryViewer } from "src/components/Galleries/GalleryViewer"; -import { LoadingIndicator } from 'src/components/Shared'; +import { LoadingIndicator } from "src/components/Shared"; import { ScenePlayer } from "src/components/scenes/ScenePlayer/ScenePlayer"; import { ScenePerformerPanel } from "./ScenePerformerPanel"; import { SceneMarkersPanel } from "./SceneMarkersPanel"; @@ -25,8 +25,7 @@ export const Scene: React.FC = () => { const autoplay = queryParams?.autoplay === "true"; useEffect(() => { - if(data?.findScene) - setScene(data.findScene) + if (data?.findScene) setScene(data.findScene); }, [data]); function getInitialTimestamp() { @@ -50,21 +49,14 @@ export const Scene: React.FC = () => { return ( <> - +
- + {scene.performers.length > 0 ? ( @@ -80,10 +72,18 @@ export const Scene: React.FC = () => { ) : ( "" )} - + - + setScene(newScene)} diff --git a/ui/v2.5/src/components/scenes/SceneDetails/SceneDetailPanel.tsx b/ui/v2.5/src/components/scenes/SceneDetails/SceneDetailPanel.tsx index 836ffe7cf..dd8b7f69d 100644 --- a/ui/v2.5/src/components/scenes/SceneDetails/SceneDetailPanel.tsx +++ b/ui/v2.5/src/components/scenes/SceneDetails/SceneDetailPanel.tsx @@ -10,7 +10,7 @@ interface ISceneDetailProps { export const SceneDetailPanel: React.FC = props => { function renderDetails() { - if (!props.scene.details || props.scene.details === "")return; + if (!props.scene.details || props.scene.details === "") return; return ( <>
Details
@@ -38,7 +38,7 @@ export const SceneDetailPanel: React.FC = props => { {props.scene.title ?? TextUtils.fileNameFromPath(props.scene.path)}
-

{props.scene.date ?? ''}

+

{props.scene.date ?? ""}

{props.scene.rating ?
Rating: {props.scene.rating}
: ""} {props.scene.file.height && (
Resolution: {TextUtils.resolution(props.scene.file.height)}
@@ -47,11 +47,17 @@ export const SceneDetailPanel: React.FC = props => { {renderTags()}
- { props.scene.studio && ( - - {`${props.scene.studio.name} - - )} + {props.scene.studio && ( + + {`${props.scene.studio.name} + + )}
); diff --git a/ui/v2.5/src/components/scenes/SceneDetails/SceneEditPanel.tsx b/ui/v2.5/src/components/scenes/SceneDetails/SceneEditPanel.tsx index 518de6ea3..d5331c686 100644 --- a/ui/v2.5/src/components/scenes/SceneDetails/SceneEditPanel.tsx +++ b/ui/v2.5/src/components/scenes/SceneDetails/SceneEditPanel.tsx @@ -1,13 +1,7 @@ /* eslint-disable react/no-this-in-sfc */ import React, { useEffect, useState } from "react"; -import { - Button, - Dropdown, - DropdownButton, - Form, - Table -} from "react-bootstrap"; +import { Button, Dropdown, DropdownButton, Form, Table } from "react-bootstrap"; import * as GQL from "src/core/generated-graphql"; import { StashService } from "src/core/StashService"; import { @@ -294,8 +288,7 @@ export const SceneEditPanel: React.FC = (props: IProps) => { ); } - if(isLoading) - return ; + if (isLoading) return ; return (
@@ -329,8 +322,9 @@ export const SceneEditPanel: React.FC = (props: IProps) => { title: "Rating", value: rating, isEditing: true, - onChange: (value: string) => setRating(Number.parseInt(value, 10)), - selectOptions: ['', 1, 2, 3, 4, 5] + onChange: (value: string) => + setRating(Number.parseInt(value, 10)), + selectOptions: ["", 1, 2, 3, 4, 5] })} Gallery @@ -356,7 +350,9 @@ export const SceneEditPanel: React.FC = (props: IProps) => { setPerformerIds(items.map(item => item.id))} + onSelect={items => + setPerformerIds(items.map(item => item.id)) + } ids={performerIds} /> @@ -387,7 +383,7 @@ export const SceneEditPanel: React.FC = (props: IProps) => {
- Cover Image + Cover Image = ( return (
Frame Rate - {props.scene.file.framerate} frames per second + + {props.scene.file.framerate} frames per second +
); } @@ -106,7 +108,9 @@ export const SceneFileInfoPanel: React.FC = ( return (
Bit Rate - {TextUtils.bitRate(props.scene.file.bitrate ?? 0)} + + {TextUtils.bitRate(props.scene.file.bitrate ?? 0)} +
); } @@ -118,7 +122,9 @@ export const SceneFileInfoPanel: React.FC = ( return (
Video Codec - {props.scene.file.video_codec} + + {props.scene.file.video_codec} +
); } @@ -130,7 +136,9 @@ export const SceneFileInfoPanel: React.FC = ( return (
Audio Codec - {props.scene.file.audio_codec} + + {props.scene.file.audio_codec} +
); } diff --git a/ui/v2.5/src/components/scenes/SceneDetails/SceneMarkerForm.tsx b/ui/v2.5/src/components/scenes/SceneDetails/SceneMarkerForm.tsx index c21c32128..fdccf6a4e 100644 --- a/ui/v2.5/src/components/scenes/SceneDetails/SceneMarkerForm.tsx +++ b/ui/v2.5/src/components/scenes/SceneDetails/SceneMarkerForm.tsx @@ -1,8 +1,5 @@ import React from "react"; -import { - Button, - Form -} from "react-bootstrap"; +import { Button, Form } from "react-bootstrap"; import { Field, FieldProps, Form as FormikForm, Formik } from "formik"; import * as GQL from "src/core/generated-graphql"; import { StashService } from "src/core/StashService"; @@ -27,16 +24,19 @@ interface ISceneMarkerForm { onClose: () => void; } -export const SceneMarkerForm: React.FC = ({ sceneID, editingMarker, playerPosition, onClose }) => { +export const SceneMarkerForm: React.FC = ({ + sceneID, + editingMarker, + playerPosition, + onClose +}) => { const [sceneMarkerCreate] = StashService.useSceneMarkerCreate(); const [sceneMarkerUpdate] = StashService.useSceneMarkerUpdate(); const [sceneMarkerDestroy] = StashService.useSceneMarkerDestroy(); const Toast = useToast(); const onSubmit = (values: IFormFields) => { - const variables: - | GQL.SceneMarkerUpdateInput - | GQL.SceneMarkerCreateInput = { + const variables: GQL.SceneMarkerUpdateInput | GQL.SceneMarkerCreateInput = { title: values.title, seconds: parseFloat(values.seconds), scene_id: sceneID, @@ -54,15 +54,15 @@ export const SceneMarkerForm: React.FC = ({ sceneID, editingMa .then(onClose) .catch(err => Toast.error(err)); } - } + }; const onDelete = () => { - if (!editingMarker) return; + if (!editingMarker) return; - sceneMarkerDestroy({ variables: { id: editingMarker.id } }) - .then(onClose) - .catch(err => Toast.error(err)); - } + sceneMarkerDestroy({ variables: { id: editingMarker.id } }) + .then(onClose) + .catch(err => Toast.error(err)); + }; const renderTitleField = (fieldProps: FieldProps) => (
= ({ sceneID, editingMa Math.round(playerPosition ?? 0) ) } - numericValue={Number.parseInt(fieldProps.field.value ?? '0', 10)} + numericValue={Number.parseInt(fieldProps.field.value ?? "0", 10)} />
); @@ -113,48 +113,43 @@ export const SceneMarkerForm: React.FC = ({ sceneID, editingMa /> ); - const values:IFormFields = { - title: editingMarker?.title ?? '', - seconds: (editingMarker?.seconds ?? Math.round(playerPosition ?? 0)).toString(), - primaryTagId: editingMarker?.primary_tag.id ?? '', + const values: IFormFields = { + title: editingMarker?.title ?? "", + seconds: ( + editingMarker?.seconds ?? Math.round(playerPosition ?? 0) + ).toString(), + primaryTagId: editingMarker?.primary_tag.id ?? "", tagIds: editingMarker?.tags.map(tag => tag.id) ?? [] }; return ( - +
Scene Marker Title - - {renderTitleField} - + {renderTitleField} Primary Tag
- - {renderPrimaryTagField} - + {renderPrimaryTagField}
- Time - - {renderSecondsField} - + + Time + + {renderSecondsField}
- Tags + + Tags +
- - {renderTagsField} - + {renderTagsField}
@@ -165,7 +160,7 @@ export const SceneMarkerForm: React.FC = ({ sceneID, editingMa - { editingMarker && ( + {editingMarker && ( -
- -
+
+ +
{ filterCopy.itemsPerPage = 1; filterCopy.currentPage = index + 1; const singleResult = await StashService.queryFindSceneMarkers(filterCopy); - if ( - singleResult?.data?.findSceneMarkers?.scene_markers?.length === 1 - ) { + if (singleResult?.data?.findSceneMarkers?.scene_markers?.length === 1) { // navigate to the scene player page const url = NavUtils.makeSceneMarkerUrl( singleResult.data.findSceneMarkers.scene_markers[0] diff --git a/ui/v2.5/src/components/scenes/ScenePlayer/ScenePlayer.tsx b/ui/v2.5/src/components/scenes/ScenePlayer/ScenePlayer.tsx index de859144d..74a1846fd 100644 --- a/ui/v2.5/src/components/scenes/ScenePlayer/ScenePlayer.tsx +++ b/ui/v2.5/src/components/scenes/ScenePlayer/ScenePlayer.tsx @@ -3,7 +3,7 @@ import ReactJWPlayer from "react-jw-player"; import { HotKeys } from "react-hotkeys"; import * as GQL from "src/core/generated-graphql"; import { StashService } from "src/core/StashService"; -import { JWUtils } from 'src/utils'; +import { JWUtils } from "src/utils"; import { ScenePlayerScrubber } from "./ScenePlayerScrubber"; interface IScenePlayerProps { @@ -206,7 +206,10 @@ export class ScenePlayerImpl extends React.Component< public render() { return ( -
+
{this.renderPlayer()} = ( useEffect(() => { const state = props.selected; let updateRating = ""; - let updateStudioID: string|undefined; + let updateStudioID: string | undefined; let updatePerformerIds: string[] = []; let updateTagIds: string[] = []; let first = true; @@ -223,7 +227,6 @@ export const SceneSelectedOptions: React.FC = ( setIsLoading(false); }, [props.selected]); - function renderMultiSelect( type: "performers" | "tags", ids: string[] | undefined @@ -249,19 +252,21 @@ export const SceneSelectedOptions: React.FC = ( ); } - if(isLoading) - return ; + if (isLoading) return ; function render() { return (
- + Rating setRating(event.target.value)} > - {["", '1', '2', '3', '4', '5'].map(opt => ( + {["", "1", "2", "3", "4", "5"].map(opt => ( diff --git a/ui/v2.5/src/hooks/ListHook.tsx b/ui/v2.5/src/hooks/ListHook.tsx index 33efb3484..97ddd9466 100644 --- a/ui/v2.5/src/hooks/ListHook.tsx +++ b/ui/v2.5/src/hooks/ListHook.tsx @@ -15,7 +15,7 @@ import { FindStudiosQueryResult, FindPerformersQueryResult } from "src/core/generated-graphql"; -import { LoadingIndicator } from 'src/components/Shared'; +import { LoadingIndicator } from "src/components/Shared"; import { ListFilter } from "src/components/list/ListFilter"; import { Pagination } from "src/components/list/Pagination"; import { StashService } from "src/core/StashService"; diff --git a/ui/v2.5/src/utils/index.ts b/ui/v2.5/src/utils/index.ts index 8ed02d4d6..9bdca9ff2 100644 --- a/ui/v2.5/src/utils/index.ts +++ b/ui/v2.5/src/utils/index.ts @@ -3,4 +3,4 @@ export { default as NavUtils } from "./navigation"; export { default as TableUtils } from "./table"; export { default as TextUtils } from "./text"; export { default as DurationUtils } from "./duration"; -export { default as JWUtils } from './jwplayer'; +export { default as JWUtils } from "./jwplayer"; diff --git a/ui/v2.5/src/utils/jwplayer.ts b/ui/v2.5/src/utils/jwplayer.ts index 7b9c751f5..0a46c88c4 100644 --- a/ui/v2.5/src/utils/jwplayer.ts +++ b/ui/v2.5/src/utils/jwplayer.ts @@ -1,7 +1,5 @@ const playerID = "main-jwplayer"; -const getPlayer = () => ( - (window as any).jwplayer(playerID) -) +const getPlayer = () => (window as any).jwplayer(playerID); export default { playerID, diff --git a/ui/v2.5/src/utils/table.tsx b/ui/v2.5/src/utils/table.tsx index aabbf512c..0428ae9f7 100644 --- a/ui/v2.5/src/utils/table.tsx +++ b/ui/v2.5/src/utils/table.tsx @@ -94,7 +94,11 @@ const renderHtmlSelect = (options: { options.onChange(event.currentTarget.value) } > - { options.selectOptions.map(opt => )} + {options.selectOptions.map(opt => ( + + ))}