feat: add hdr filtering (#86)

* feat: filter hdr content

* feat: check filter hdr

* feat: improve hdr parse and filter and tests
This commit is contained in:
Ludvig Lundgren 2022-01-16 13:50:21 +01:00 committed by GitHub
parent 67c6bd7b53
commit 284a2f9590
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 284 additions and 22 deletions

View file

@ -19,7 +19,7 @@ const MultiSelect: React.FC<MultiSelectProps> = ({
label,
options,
className,
columns
columns,
}) => (
<div
className={classNames(
@ -49,7 +49,7 @@ const MultiSelect: React.FC<MultiSelectProps> = ({
setFieldValue(field.name, am)
}}
className="dark:bg-gray-700"
className="dark:bg-gray-700 dark"
/>
)}
</Field>

View file

@ -62,6 +62,20 @@ export const containers = [
export const CONTAINER_OPTIONS = containers.map(v => ({ value: v, label: v, key: v}));
export const hdr = [
"HDR",
"HDR10",
"HDR10+",
"DV",
"DV HDR",
"DV HDR10",
"DV HDR10+",
"DoVi",
"Dolby Vision",
];
export const HDR_OPTIONS = hdr.map(v => ({ value: v, label: v, key: v}));
export interface radioFieldsetOption {
label: string;
description: string;

View file

@ -83,6 +83,8 @@ export interface Filter {
sources: string[];
codecs: string[];
containers: string[];
match_hdr: string[];
except_hdr: string[];
seasons: string;
episodes: string;
match_releases: string;

View file

@ -4,46 +4,58 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
@keyframes enter {
0% {
transform: scale(.9);
opacity: 0
transform: scale(0.9);
opacity: 0;
}
to {
transform: scale(1);
opacity: 1
transform: scale(1);
opacity: 1;
}
}
.animate-enter {
animation: enter .2s ease-out
animation: enter 0.2s ease-out;
}
@keyframes leave {
0% {
transform: scale(1);
opacity: 1
transform: scale(1);
opacity: 1;
}
to {
transform: scale(.9);
opacity: 0
transform: scale(0.9);
opacity: 0;
}
}
.animate-leave {
animation: leave .15s ease-in forwards
}
animation: leave 0.15s ease-in forwards;
}
@media (prefers-color-scheme: dark) {
.rmsc.dark {
--rmsc-main: #4285f4;
--rmsc-hover: #0e0c0a;
--rmsc-selected: #1d1915;
--rmsc-border: #35353a;
--rmsc-gray: #555555;
--rmsc-bg: #27272a;
color: #fff;
}
}

View file

@ -16,7 +16,7 @@ import { Action, ActionType, DownloadClient, Filter, Indexer } from "../../domai
import { useToggle } from "../../hooks/hooks";
import { useMutation, useQuery } from "react-query";
import { queryClient } from "../../App";
import { CONTAINER_OPTIONS, CODECS_OPTIONS, RESOLUTION_OPTIONS, SOURCES_OPTIONS, ActionTypeNameMap, ActionTypeOptions } from "../../domain/constants";
import { CONTAINER_OPTIONS, CODECS_OPTIONS, RESOLUTION_OPTIONS, SOURCES_OPTIONS, ActionTypeNameMap, ActionTypeOptions, HDR_OPTIONS } from "../../domain/constants";
import DEBUG from "../../components/debug";
import { TitleSubtitle } from "../../components/headings";
@ -233,6 +233,8 @@ export default function FilterDetails() {
sources: data.sources || [],
codecs: data.codecs || [],
containers: data.containers || [],
match_hdr: data.match_hdr || [],
except_hdr: data.except_hdr || [],
seasons: data.seasons,
episodes: data.episodes,
match_releases: data.match_releases,
@ -393,6 +395,11 @@ function MoviesTv() {
<MultiSelect name="codecs" options={CODECS_OPTIONS} label="codecs" columns={6} />
<MultiSelect name="containers" options={CONTAINER_OPTIONS} label="containers" columns={6} />
</div>
<div className="mt-6 grid grid-cols-12 gap-6">
<MultiSelect name="match_hdr" options={HDR_OPTIONS} label="Match HDR" columns={6} />
<MultiSelect name="except_hdr" options={HDR_OPTIONS} label="Except HDR" columns={6} />
</div>
</div>
</div>
)