Fixed and improved UI while correcting text

This commit is contained in:
JayZed 2024-03-12 23:03:08 -04:00 committed by GitHub
parent 2b9275244b
commit 814b1af79f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 105 additions and 82 deletions

View File

@ -75,8 +75,8 @@ def check_radarr_rootfolder():
if not os.path.isdir(path_mappings.path_replace_movie(root_path)): if not os.path.isdir(path_mappings.path_replace_movie(root_path)):
database.execute( database.execute(
update(TableMoviesRootfolder) update(TableMoviesRootfolder)
.values(accessible=0, error='This Radarr root directory does not seems to be accessible by Please ' .values(accessible=0, error='This Radarr root directory does not seem to be accessible by Bazarr. '
'check path mapping.') 'Please check path mapping or if directory/drive is online.')
.where(TableMoviesRootfolder.id == item.id)) .where(TableMoviesRootfolder.id == item.id))
elif not os.access(path_mappings.path_replace_movie(root_path), os.W_OK): elif not os.access(path_mappings.path_replace_movie(root_path), os.W_OK):
database.execute( database.execute(

View File

@ -75,8 +75,8 @@ def check_sonarr_rootfolder():
if not os.path.isdir(path_mappings.path_replace(root_path)): if not os.path.isdir(path_mappings.path_replace(root_path)):
database.execute( database.execute(
update(TableShowsRootfolder) update(TableShowsRootfolder)
.values(accessible=0, error='This Sonarr root directory does not seems to be accessible by Bazarr. ' .values(accessible=0, error='This Sonarr root directory does not seem to be accessible by Bazarr. '
'Please check path mapping.') 'Please check path mapping or if directory/drive is online.')
.where(TableShowsRootfolder.id == item.id)) .where(TableShowsRootfolder.id == item.id))
elif not os.access(path_mappings.path_replace(root_path), os.W_OK): elif not os.access(path_mappings.path_replace(root_path), os.W_OK):
database.execute( database.execute(

View File

@ -227,7 +227,7 @@ class WhisperAIProvider(Provider):
if not ffmpeg_path: if not ffmpeg_path:
raise ConfigurationError("ffmpeg path must be provided") raise ConfigurationError("ffmpeg path must be provided")
self.endpoint = endpoint self.endpoint = endpoint.rstrip("/")
self.response = int(response) self.response = int(response)
self.timeout = int(timeout) self.timeout = int(timeout)
self.session = None self.session = None

View File

@ -77,7 +77,7 @@ const ItemEditForm: FunctionComponent<Props> = ({
{...profileOptions} {...profileOptions}
{...form.getInputProps("profile")} {...form.getInputProps("profile")}
clearable clearable
label="Languages Profiles" label="Languages Profile"
></Selector> ></Selector>
<Divider></Divider> <Divider></Divider>
<Group position="right"> <Group position="right">

View File

@ -64,6 +64,7 @@ function ManualSearchView<T extends SupportType>(props: Props<T>) {
}, },
}, },
{ {
Header: "Language",
accessor: "language", accessor: "language",
Cell: ({ row: { original }, value }) => { Cell: ({ row: { original }, value }) => {
const lang: Language.Info = { const lang: Language.Info = {
@ -137,7 +138,7 @@ function ManualSearchView<T extends SupportType>(props: Props<T>) {
}, },
}, },
{ {
Header: "Upload", Header: "Uploader",
accessor: "uploader", accessor: "uploader",
Cell: ({ value }) => { Cell: ({ value }) => {
const { classes } = useTableStyles(); const { classes } = useTableStyles();
@ -145,6 +146,7 @@ function ManualSearchView<T extends SupportType>(props: Props<T>) {
}, },
}, },
{ {
Header: "Match",
accessor: "matches", accessor: "matches",
Cell: (row) => { Cell: (row) => {
const { matches, dont_matches: dont } = row.row.original; const { matches, dont_matches: dont } = row.row.original;
@ -158,6 +160,7 @@ function ManualSearchView<T extends SupportType>(props: Props<T>) {
}, },
}, },
{ {
Header: "Get",
accessor: "subtitle", accessor: "subtitle",
Cell: ({ row }) => { Cell: ({ row }) => {
const result = row.original; const result = row.original;

View File

@ -221,10 +221,10 @@ const Table: FunctionComponent<Props> = ({
useEffect(() => { useEffect(() => {
if (instance.current) { if (instance.current) {
if (initial) { if (initial) {
// start with all rows collapsed
instance.current.toggleAllRowsExpanded(false);
// expand the last/current season on initial display // expand the last/current season on initial display
instance.current.toggleRowExpanded([`season:${maxSeason}`], true); instance.current.toggleRowExpanded([`season:${maxSeason}`], true);
// make sure season 0 is collapsed
instance.current.toggleRowExpanded([`season:0`], false);
} else { } else {
if (expand !== undefined) { if (expand !== undefined) {
instance.current.toggleAllRowsExpanded(expand); instance.current.toggleAllRowsExpanded(expand);

View File

@ -58,6 +58,7 @@ const MoviesHistoryView: FunctionComponent = () => {
accessor: "score", accessor: "score",
}, },
{ {
Header: "Match",
accessor: "matches", accessor: "matches",
Cell: (row) => { Cell: (row) => {
const { matches, dont_matches: dont } = row.row.original; const { matches, dont_matches: dont } = row.row.original;
@ -90,6 +91,7 @@ const MoviesHistoryView: FunctionComponent = () => {
}, },
}, },
{ {
Header: "Info",
accessor: "description", accessor: "description",
Cell: ({ value }) => { Cell: ({ value }) => {
return ( return (
@ -100,11 +102,12 @@ const MoviesHistoryView: FunctionComponent = () => {
}, },
}, },
{ {
Header: "Upgrade",
accessor: "upgradable", accessor: "upgradable",
Cell: (row) => { Cell: (row) => {
if (row.value) { if (row.value) {
return ( return (
<TextPopover text="This Subtitles File Is Eligible For An Upgrade."> <TextPopover text="This Subtitle File Is Eligible For An Upgrade.">
<FontAwesomeIcon size="sm" icon={faRecycle}></FontAwesomeIcon> <FontAwesomeIcon size="sm" icon={faRecycle}></FontAwesomeIcon>
</TextPopover> </TextPopover>
); );
@ -114,6 +117,7 @@ const MoviesHistoryView: FunctionComponent = () => {
}, },
}, },
{ {
Header: "Blacklist",
accessor: "blacklisted", accessor: "blacklisted",
Cell: ({ row, value }) => { Cell: ({ row, value }) => {
const add = useMovieAddBlacklist(); const add = useMovieAddBlacklist();

View File

@ -74,6 +74,7 @@ const SeriesHistoryView: FunctionComponent = () => {
accessor: "score", accessor: "score",
}, },
{ {
Header: "Match",
accessor: "matches", accessor: "matches",
Cell: (row) => { Cell: (row) => {
const { matches, dont_matches: dont } = row.row.original; const { matches, dont_matches: dont } = row.row.original;
@ -106,6 +107,7 @@ const SeriesHistoryView: FunctionComponent = () => {
}, },
}, },
{ {
Header: "Info",
accessor: "description", accessor: "description",
Cell: ({ row, value }) => { Cell: ({ row, value }) => {
return ( return (
@ -116,11 +118,12 @@ const SeriesHistoryView: FunctionComponent = () => {
}, },
}, },
{ {
Header: "Upgrade",
accessor: "upgradable", accessor: "upgradable",
Cell: (row) => { Cell: (row) => {
if (row.value) { if (row.value) {
return ( return (
<TextPopover text="This Subtitles File Is Eligible For An Upgrade."> <TextPopover text="This Subtitle File Is Eligible For An Upgrade.">
<FontAwesomeIcon size="sm" icon={faRecycle}></FontAwesomeIcon> <FontAwesomeIcon size="sm" icon={faRecycle}></FontAwesomeIcon>
</TextPopover> </TextPopover>
); );
@ -130,6 +133,7 @@ const SeriesHistoryView: FunctionComponent = () => {
}, },
}, },
{ {
Header: "Blacklist",
accessor: "blacklisted", accessor: "blacklisted",
Cell: ({ row, value }) => { Cell: ({ row, value }) => {
const { const {

View File

@ -1,6 +1,5 @@
import { useSeriesModification, useSeriesPagination } from "@/apis/hooks"; import { useSeriesModification, useSeriesPagination } from "@/apis/hooks";
import { Action } from "@/components"; import { Action } from "@/components";
import { AudioList } from "@/components/bazarr";
import LanguageProfileName from "@/components/bazarr/LanguageProfile"; import LanguageProfileName from "@/components/bazarr/LanguageProfile";
import { ItemEditModal } from "@/components/forms/ItemEditForm"; import { ItemEditModal } from "@/components/forms/ItemEditForm";
import { useModals } from "@/modules/modals"; import { useModals } from "@/modules/modals";
@ -44,13 +43,6 @@ const SeriesView: FunctionComponent = () => {
); );
}, },
}, },
{
Header: "Audio",
accessor: "audio_language",
Cell: ({ value }) => {
return <AudioList audios={value}></AudioList>;
},
},
{ {
Header: "Languages Profile", Header: "Languages Profile",
accessor: "profileId", accessor: "profileId",

View File

@ -102,7 +102,7 @@ const SettingsLanguagesView: FunctionComponent = () => {
<Selector <Selector
clearable clearable
settingKey={defaultUndEmbeddedSubtitlesLang} settingKey={defaultUndEmbeddedSubtitlesLang}
label="Treat unknown language embedded subtitles track as (changing this will trigger full subtitles indexation using cache)" label="Treat unknown language embedded subtitles track as (changing this will trigger full subtitles indexing using cache)"
placeholder="Select languages" placeholder="Select languages"
options={undEmbeddedSubtitlesLanguages.map((v) => { options={undEmbeddedSubtitlesLanguages.map((v) => {
return { label: v.name, value: v.code2 }; return { label: v.name, value: v.code2 };
@ -112,7 +112,7 @@ const SettingsLanguagesView: FunctionComponent = () => {
}} }}
></Selector> ></Selector>
</Section> </Section>
<Section header="Languages Profiles"> <Section header="Languages Profile">
<Table></Table> <Table></Table>
</Section> </Section>
<Section header="Default Settings"> <Section header="Default Settings">
@ -121,7 +121,7 @@ const SettingsLanguagesView: FunctionComponent = () => {
settingKey="settings-general-serie_default_enabled" settingKey="settings-general-serie_default_enabled"
></Check> ></Check>
<Message> <Message>
Apply only to Series added to Bazarr after enabling this option. Will apply only to Series added to Bazarr after enabling this option.
</Message> </Message>
<CollapseBox indent settingKey="settings-general-serie_default_enabled"> <CollapseBox indent settingKey="settings-general-serie_default_enabled">
@ -137,7 +137,7 @@ const SettingsLanguagesView: FunctionComponent = () => {
settingKey="settings-general-movie_default_enabled" settingKey="settings-general-movie_default_enabled"
></Check> ></Check>
<Message> <Message>
Apply only to Movies added to Bazarr after enabling this option. Will apply only to Movies added to Bazarr after enabling this option.
</Message> </Message>
<CollapseBox indent settingKey="settings-general-movie_default_enabled"> <CollapseBox indent settingKey="settings-general-movie_default_enabled">

View File

@ -33,12 +33,13 @@ export const folderOptions: SelectorOption<string>[] = [
export const embeddedSubtitlesParserOption: SelectorOption<string>[] = [ export const embeddedSubtitlesParserOption: SelectorOption<string>[] = [
{ {
label: "ffprobe (faster)", label:
"ffprobe (faster than mediainfo. Part of Bazarr installation already)",
value: "ffprobe", value: "ffprobe",
}, },
{ {
label: label:
"mediainfo (slower but may give better results. Must be already installed)", "mediainfo (slower but may give better results. User must install the mediainfo executable first)",
value: "mediainfo", value: "mediainfo",
}, },
]; ];

View File

@ -33,7 +33,7 @@ const Table: FunctionComponent<Props> = ({ announcements }) => {
}, },
}, },
{ {
Header: "More info", Header: "More Info",
accessor: "link", accessor: "link",
Cell: ({ value }) => { Cell: ({ value }) => {
if (value) { if (value) {

View File

@ -3,9 +3,8 @@ import { Action, PageTable } from "@/components";
import { useModals } from "@/modules/modals"; import { useModals } from "@/modules/modals";
import { useTableStyles } from "@/styles"; import { useTableStyles } from "@/styles";
import { Environment } from "@/utilities"; import { Environment } from "@/utilities";
import { faClock, faHistory, faTrash } from "@fortawesome/free-solid-svg-icons"; import { faHistory, faTrash } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { Anchor, Text } from "@mantine/core";
import { Anchor, Group, Text } from "@mantine/core";
import { FunctionComponent, useMemo } from "react"; import { FunctionComponent, useMemo } from "react";
import { Column } from "react-table"; import { Column } from "react-table";
@ -16,10 +15,6 @@ interface Props {
const Table: FunctionComponent<Props> = ({ backups }) => { const Table: FunctionComponent<Props> = ({ backups }) => {
const columns: Column<System.Backups>[] = useMemo<Column<System.Backups>[]>( const columns: Column<System.Backups>[] = useMemo<Column<System.Backups>[]>(
() => [ () => [
{
accessor: "type",
Cell: <FontAwesomeIcon icon={faClock}></FontAwesomeIcon>,
},
{ {
Header: "Name", Header: "Name",
accessor: "filename", accessor: "filename",
@ -50,52 +45,61 @@ const Table: FunctionComponent<Props> = ({ backups }) => {
}, },
}, },
{ {
id: "actions", id: "restore",
Header: "Restore",
accessor: "filename", accessor: "filename",
Cell: ({ value }) => { Cell: ({ value }) => {
const modals = useModals(); const modals = useModals();
const restore = useRestoreBackups(); const restore = useRestoreBackups();
return (
<Action
label="Restore"
onClick={() =>
modals.openConfirmModal({
title: "Restore Backup",
children: (
<Text size="sm">
Are you sure you want to restore the backup ({value})?
Bazarr will automatically restart and reload the UI during
the restore process.
</Text>
),
labels: { confirm: "Restore", cancel: "Cancel" },
confirmProps: { color: "red" },
onConfirm: () => restore.mutate(value),
})
}
icon={faHistory}
></Action>
);
},
},
{
id: "delet4",
Header: "Delete",
accessor: "filename",
Cell: ({ value }) => {
const modals = useModals();
const remove = useDeleteBackups(); const remove = useDeleteBackups();
return ( return (
<Group spacing="xs" noWrap> <Action
<Action label="Delete"
label="Restore" color="red"
onClick={() => onClick={() =>
modals.openConfirmModal({ modals.openConfirmModal({
title: "Restore Backup", title: "Delete Backup",
children: ( children: (
<Text size="sm"> <Text size="sm">
Are you sure you want to restore the backup ({value})? Are you sure you want to delete the backup ({value})?
Bazarr will automatically restart and reload the UI </Text>
during the restore process. ),
</Text> labels: { confirm: "Delete", cancel: "Cancel" },
), confirmProps: { color: "red" },
labels: { confirm: "Restore", cancel: "Cancel" }, onConfirm: () => remove.mutate(value),
confirmProps: { color: "red" }, })
onConfirm: () => restore.mutate(value), }
}) icon={faTrash}
} ></Action>
icon={faHistory}
></Action>
<Action
label="Delete"
color="red"
onClick={() =>
modals.openConfirmModal({
title: "Delete Backup",
children: (
<Text size="sm">
Are you sure you want to delete the backup ({value})?
</Text>
),
labels: { confirm: "Delete", cancel: "Cancel" },
confirmProps: { color: "red" },
onConfirm: () => remove.mutate(value),
})
}
icon={faTrash}
></Action>
</Group>
); );
}, },
}, },

View File

@ -10,7 +10,15 @@ import {
} from "@fortawesome/free-brands-svg-icons"; } from "@fortawesome/free-brands-svg-icons";
import { faCode, faPaperPlane } from "@fortawesome/free-solid-svg-icons"; import { faCode, faPaperPlane } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Anchor, Container, Divider, Grid, Stack, Text } from "@mantine/core"; import {
Anchor,
Container,
Divider,
Grid,
Space,
Stack,
Text,
} from "@mantine/core";
import { useDocumentTitle } from "@mantine/hooks"; import { useDocumentTitle } from "@mantine/hooks";
import moment from "moment"; import moment from "moment";
import { import {
@ -30,12 +38,14 @@ interface InfoProps {
function Row(props: InfoProps): JSX.Element { function Row(props: InfoProps): JSX.Element {
const { title, children } = props; const { title, children } = props;
return ( return (
<Grid> <Grid columns={10}>
<Grid.Col span={5}> <Grid.Col span={2}>
<Text weight="bold">{title}</Text> <Text size="sm" align="right" weight="bold">
{title}
</Text>
</Grid.Col> </Grid.Col>
<Grid.Col span={12 - 5}> <Grid.Col span={3}>
<Text>{children}</Text> <Text size="sm"> {children}</Text>
</Grid.Col> </Grid.Col>
</Grid> </Grid>
); );
@ -68,9 +78,13 @@ const InfoContainer: FunctionComponent<
> = ({ title, children }) => { > = ({ title, children }) => {
return ( return (
<Stack> <Stack>
<h4>{title}</h4> <Divider
<Divider></Divider> labelProps={{ size: "medium", weight: "bold" }}
labelPosition="left"
label={title}
></Divider>
{children} {children}
<Space />
</Stack> </Stack>
); );
}; };

View File

@ -35,6 +35,7 @@ const Table: FunctionComponent<Props> = ({ tasks }) => {
accessor: "next_run_in", accessor: "next_run_in",
}, },
{ {
Header: "Run",
accessor: "job_running", accessor: "job_running",
Cell: ({ row, value }) => { Cell: ({ row, value }) => {
const { job_id: jobId } = row.original; const { job_id: jobId } = row.original;
@ -42,7 +43,7 @@ const Table: FunctionComponent<Props> = ({ tasks }) => {
return ( return (
<MutateAction <MutateAction
label="Run" label="Run Job"
icon={faPlay} icon={faPlay}
iconProps={{ spin: value }} iconProps={{ spin: value }}
mutation={runTask} mutation={runTask}