Skip to content

[WIP] Accommodate server side changes #1190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 32 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fff5669
fix: fix incompatibles with server-side changes
revam Mar 11, 2025
0327168
fix: fix incorrect release info mapping
revam Mar 17, 2025
51d8779
misc: rename tmdb settings
revam Mar 17, 2025
7de7f8b
feat: add initial PoC for auto-generated settings
revam Mar 23, 2025
ba59dba
feat: add hashing & release settings
revam Mar 23, 2025
bfbafa9
chore: add more TODOs
revam Mar 23, 2025
efd612f
refactor: display each hash separately, remove hash priority
revam Mar 24, 2025
a90c14a
fix: dismiss toasts upon "page" navigation
revam Mar 24, 2025
ce4430f
fix: fix setting priority for release info providers
revam Mar 24, 2025
38dad4c
feat: add managed folders to import settings
revam Mar 24, 2025
55974ec
feat: add basic user add ability to user management
revam Mar 24, 2025
5049dca
fix: delay unsaved changes value to offset rapid changes during initi…
revam Mar 24, 2025
59e82a6
fix: fix rendering the auto-generated config. schema
revam Mar 24, 2025
5118e16
feat: add redirect upon config. result support
revam Mar 30, 2025
7382919
fix: properly line break the different paragraphs
revam Mar 30, 2025
87e7f8d
refactor: simplify patch settings mutation
revam Apr 6, 2025
aec1cb0
refactor: make row selection hook more generic
revam Apr 6, 2025
ab81d94
misc: remove 'add to anidb' button from unrecognized utility
revam Apr 6, 2025
52545f8
refactor: overhaul manual linking process [1/2]
revam Apr 7, 2025
f55909e
fix: only block keypresses if we act on them
revam Apr 15, 2025
132912c
fix: fix default display for enum selectors
revam Apr 15, 2025
3ded89b
fix: always retry non-existing keys
revam Apr 15, 2025
4522268
feat: add back manual linking submitting
revam Apr 15, 2025
d310c1f
fix: faster signalr queue reaction logic
revam Apr 18, 2025
f16531f
refactor: improvements to the linking page
revam Apr 18, 2025
09502e6
fix: adjust signalr events to match server
revam Apr 20, 2025
e69ea73
misc: tweak xref for release & fix type in query
revam Apr 23, 2025
8d4793e
misc: show currently executing count in queue processor widget
revam Apr 23, 2025
c567b0e
misc: mark release source as a const enum
revam Apr 24, 2025
0682adc
misc: tweak edited by user detection
revam Apr 24, 2025
6c1382d
misc: add WEBUI_PREFIX to define where the web ui should be mounted
revam May 2, 2025
2b852e0
fix: fix signalr event channel names
revam May 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"parserOptions": {
"project": "./tsconfig.json"
},
"globals": {
"WEBUI_PREFIX": true
},
"settings": {
"import/resolver": {
"typescript": {}
Expand All @@ -30,6 +33,9 @@
}
},
"rules": {
"@typescript-eslint/comma-dangle": "off", // deprecated rule https://typescript-eslint.io/rules/comma-dangle/
"function-paren-newline": "off", // deprecated rule https://eslint.org/docs/latest/rules/function-paren-newline
"operator-linebreak": "off", // deprecated rule https://eslint.org/docs/latest/rules/operator-linebreak
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/indent": "off",
"@typescript-eslint/no-floating-promises": [
Expand Down Expand Up @@ -93,6 +99,7 @@
"error",
{ "allow": ["warn", "error"] }
],
"no-continue": "off",
"no-param-reassign": [
"error",
{ "props": true, "ignorePropertyModificationsFor": ["sliceState", "immerState", "draftState", "draftState2", "reduceResult"] }
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script>globalThis.WEBUI_PREFIX='/webui';if(!WEBUI_PREFIX.endsWith('/'))WEBUI_PREFIX+='/';</script>
<meta charset="utf-8">
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->
<title>Shoko</title>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"@stylistic/stylelint-plugin": "^3.1.1",
"@tanstack/eslint-plugin-query": "^5.62.1",
"@types/format-thousands": "^2.0.3",
"@types/json-schema": "^7.0.15",
"@types/lodash": "^4.17.13",
"@types/node": "^22.10.2",
"@types/react": "^19.0.1",
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/components/Collection/CollectionTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const CollectionTitle = React.memo(({ count, filterActive, filterName, groupName
return (
<div className="flex min-w-0 items-center gap-x-2 text-xl font-semibold">
<Link
to="/webui/collection"
to="/collection"
className={cx((filterName ?? groupName ?? filterActive) ? 'text-panel-text-primary' : 'pointer-events-none')}
>
Collection
Expand All @@ -36,7 +36,7 @@ const CollectionTitle = React.memo(({ count, filterActive, filterName, groupName
<>
<Icon className="flex-none" path={mdiChevronRight} size={1} />
<Link
to={`/webui/collection/group/${groupId}`}
to={`/collection/group/${groupId}`}
className={cx(
(filterName ?? filterActive) ? 'text-panel-text-primary' : 'pointer-events-none',
'truncate',
Expand Down
2 changes: 1 addition & 1 deletion src/components/Collection/DisplaySettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const DisplaySettingsModal = ({ onClose, show }: Props) => {
});

const handleSave = useEventCallback(() => {
patchSettings({ newSettings }, {
patchSettings(newSettings, {
onSuccess: () => onClose(),
});
});
Expand Down
15 changes: 7 additions & 8 deletions src/components/Collection/Episode/EpisodeFiles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
mdiTrashCanOutline,
} from '@mdi/js';
import { Icon } from '@mdi/react';
import { get, map } from 'lodash';
import { map } from 'lodash';

import DeleteFilesModal from '@/components/Dialogs/DeleteFilesModal';
import FileInfo from '@/components/FileInfo';
Expand Down Expand Up @@ -92,8 +92,7 @@ const EpisodeFiles = ({ anidbSeriesId, episodeFiles, episodeId, seriesId }: Prop
return (
<div className="flex flex-col gap-y-6 p-6 pt-4">
{map(episodeFiles, (file) => {
const ReleaseGroupID = get(file, 'AniDB.ReleaseGroup.ID', 0);
const ReleaseGroupName = get(file, 'AniDB.ReleaseGroup.Name', null);
const releaseGroup = file.Release?.Group;

return (
<div className="flex flex-col gap-y-6" key={file.ID}>
Expand Down Expand Up @@ -141,24 +140,24 @@ const EpisodeFiles = ({ anidbSeriesId, episodeFiles, episodeId, seriesId }: Prop
/>
Copy ShokoID
</div>
{file.AniDB && (
<a href={`https://anidb.net/file/${file.AniDB.ID}`} target="_blank" rel="noopener noreferrer">
{file.Release?.ReleaseURI?.startsWith('https://anidb.net/file/') && (
<a href={file.Release.ReleaseURI} target="_blank" rel="noopener noreferrer">
<div className="flex items-center gap-x-2 font-semibold text-panel-text-primary">
<div className="metadata-link-icon AniDB" />
AniDB
<Icon className="text-panel-icon-action" path={mdiOpenInNew} size={1} />
</div>
</a>
)}
{ReleaseGroupID > 0 && (
{releaseGroup && releaseGroup.Source === 'AniDB' && (
<a
href={`https://anidb.net/group/${ReleaseGroupID}/anime/${anidbSeriesId}`}
href={`https://anidb.net/group/${releaseGroup.ID}/anime/${anidbSeriesId}`}
target="_blank"
rel="noopener noreferrer"
>
<div className="flex items-center gap-x-2 font-semibold text-panel-text-primary">
<div className="metadata-link-icon AniDB" />
{ReleaseGroupName ?? 'Unknown'}
{releaseGroup.Name}
&nbsp;(AniDB)
<Icon className="text-panel-icon-action" path={mdiOpenInNew} size={1} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Collection/Episode/EpisodeSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const EpisodeSummary = React.memo(

const episodeFilesQuery = useEpisodeFilesQuery(
episodeId,
{ includeDataFrom: ['AniDB'], include: ['AbsolutePaths', 'MediaInfo'] },
{ include: ['AbsolutePaths', 'ReleaseInfo', 'MediaInfo'] },
open,
);
const { isPending: markWatchedPending, mutate: markWatched } = useWatchEpisodeMutation(seriesId, page, nextUp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const DeleteActionsTab = ({ seriesId }: Props) => {

const { mutate: deleteSeries } = useDeleteSeriesMutation();

const navigateToCollection = () => navigate('/webui/collection');
const navigateToCollection = () => navigate('/collection');

return (
<div className="flex grow flex-col gap-y-4 overflow-y-auto">
Expand Down
2 changes: 1 addition & 1 deletion src/components/Collection/SeriesInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const SeriesInfo = ({ series }: SeriesInfoProps) => {
const [season, year] = overview.FirstAirSeason.split(' ');
addFilterCriteriaToStore('InSeason').then(() => {
dispatch(setFilterValues({ InSeason: [`${year}: ${season}`] }));
navigate('/webui/collection/filter/live');
navigate('/collection/filter/live');
}).catch(console.error);
});

Expand Down
2 changes: 1 addition & 1 deletion src/components/Collection/TagButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const TagButton = React.memo(({ tagType, text, type }: Props) => {
dispatch(resetFilter());
addFilterCriteriaToStore('HasTag').then(() => {
dispatch(setFilterTag({ HasTag: [{ Name: text, isExcluded: false }] }));
navigate('/webui/collection/filter/live');
navigate('/collection/filter/live');
}).catch(console.error);
});

Expand Down
2 changes: 1 addition & 1 deletion src/components/Collection/Tags/TagDetailsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type { TagType } from '@/core/types/api/tags';

const SeriesLink = React.memo(({ extraPadding, series }: { series: SeriesType, extraPadding: boolean }) => (
<Link
to={`/webui/collection/series/${series.IDs.ID}`}
to={`/collection/series/${series.IDs.ID}`}
className={cx(
'flex justify-between align-middle hover:text-panel-text-primary transition-colors',
extraPadding && ('pr-4'),
Expand Down
10 changes: 5 additions & 5 deletions src/components/Collection/TimelineSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import type { SeriesType } from '@/core/types/api/series';

const TimelineItem = ({ series }: { series: SeriesType }) => {
const mainPoster = useMainPoster(series);
const seriesType = series.AniDB?.Type === SeriesTypeEnum.TVSpecial
? 'TV Special'
: series.AniDB?.Type;
let seriesType = series.AniDB?.Type as string | undefined;
if (seriesType === SeriesTypeEnum.TVSpecial) seriesType = 'TV Special';
else if (seriesType === SeriesTypeEnum.MusicVideo) seriesType = 'Music Video';

return (
<div className="flex gap-x-3" key={series.IDs.ID}>
<Link to={`/webui/collection/series/${series.IDs.ID}`}>
<Link to={`/collection/series/${series.IDs.ID}`}>
<BackgroundImagePlaceholderDiv
image={mainPoster}
className="group h-24 w-[4.4375rem] shrink-0 rounded-lg border border-panel-border drop-shadow-md"
Expand All @@ -33,7 +33,7 @@ const TimelineItem = ({ series }: { series: SeriesType }) => {
</div>
<div className="line-clamp-2">
<Link
to={`/webui/collection/series/${series.IDs.ID}`}
to={`/collection/series/${series.IDs.ID}`}
className="transition-colors hover:text-panel-text-primary"
data-tooltip-id="tooltip"
data-tooltip-content={series.Name}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Collection/Tmdb/TopPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const TopPanel = (props: Props) => {
buttonType="secondary"
buttonSize="normal"
className="flex flex-row flex-wrap items-center gap-x-2 py-3"
onClick={() => navigate(`/webui/collection/series/${seriesId}`)}
onClick={() => navigate(`/collection/series/${seriesId}`)}
>
Cancel
</Button>
Expand Down
Loading