mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
feat(filters): support Language filtering (#632)
* feat(filters): add support for language * feat(filters): add db migrations and repo * feat(filters): fix failing tests * feat(filters): fix failing tests
This commit is contained in:
parent
3c4711efa0
commit
5c402b6d6c
11 changed files with 120 additions and 8 deletions
|
@ -154,6 +154,61 @@ export const originOptions = [
|
|||
|
||||
export const ORIGIN_OPTIONS = originOptions.map(v => ({ value: v, label: v, key: v }));
|
||||
|
||||
export const languageOptions = [
|
||||
"BALTIC",
|
||||
"BRAZiLiAN",
|
||||
"BULGARiAN",
|
||||
"CHiNESE",
|
||||
"CHS",
|
||||
"CHT",
|
||||
"CZECH",
|
||||
"DANiSH",
|
||||
"DUBBED",
|
||||
"DKSUBS",
|
||||
"DUTCH",
|
||||
"ENGLiSH",
|
||||
"ESTONiAN",
|
||||
"FLEMiSH",
|
||||
"FiNNiSH",
|
||||
"FRENCH",
|
||||
"GERMAN",
|
||||
"GREEK",
|
||||
"HAiTiAN",
|
||||
"HARDSUB",
|
||||
"Hardcoded",
|
||||
"HEBREW",
|
||||
"HebSub",
|
||||
"HiNDi",
|
||||
"HUNGARiAN",
|
||||
"iCELANDiC",
|
||||
"iTALiAN",
|
||||
"JAPANESE",
|
||||
"KOREAN",
|
||||
"LATiN",
|
||||
"MANDARiN",
|
||||
"MULTi",
|
||||
"MULTILANG",
|
||||
"MULTiSUB",
|
||||
"MULTiSUBS",
|
||||
"NORDiC",
|
||||
"NORWEGiAN",
|
||||
"POLiSH",
|
||||
"PORTUGUESE",
|
||||
"ROMANiAN",
|
||||
"RUSSiAN",
|
||||
"SPANiSH",
|
||||
"SUBBED",
|
||||
"SUBFORCED",
|
||||
"SUBPACK",
|
||||
"SWEDiSH",
|
||||
"SYNCED",
|
||||
"TURKiSH",
|
||||
"UKRAiNiAN",
|
||||
"UNSUBBED"
|
||||
];
|
||||
|
||||
export const LANGUAGE_OPTIONS = languageOptions.map(v => ({ value: v, label: v, key: v }));
|
||||
|
||||
export interface RadioFieldsetOption {
|
||||
label: string;
|
||||
description: string;
|
||||
|
|
|
@ -11,6 +11,7 @@ import {
|
|||
downloadsPerUnitOptions,
|
||||
FORMATS_OPTIONS,
|
||||
HDR_OPTIONS,
|
||||
LANGUAGE_OPTIONS,
|
||||
ORIGIN_OPTIONS,
|
||||
OTHER_OPTIONS,
|
||||
QUALITY_MUSIC_OPTIONS,
|
||||
|
@ -265,6 +266,8 @@ export default function FilterDetails() {
|
|||
except_tags: filter.except_tags,
|
||||
match_uploaders: filter.match_uploaders,
|
||||
except_uploaders: filter.except_uploaders,
|
||||
match_language: filter.match_language || [],
|
||||
except_language: filter.except_language || [],
|
||||
freeleech: filter.freeleech,
|
||||
freeleech_percent: filter.freeleech_percent,
|
||||
formats: filter.formats || [],
|
||||
|
@ -516,6 +519,11 @@ export function Advanced({ values }: AdvancedProps) {
|
|||
<TextField name="except_uploaders" label="Except uploaders" columns={6} placeholder="eg. anonymous" />
|
||||
</CollapsableSection>
|
||||
|
||||
<CollapsableSection defaultOpen={true} title="Language" subtitle="Match or ignore languages.">
|
||||
<MultiSelect name="match_language" options={LANGUAGE_OPTIONS} label="Match Language" columns={6} creatable={true} />
|
||||
<MultiSelect name="except_language" options={LANGUAGE_OPTIONS} label="Except Language" columns={6} creatable={true} />
|
||||
</CollapsableSection>
|
||||
|
||||
<CollapsableSection defaultOpen={true} title="Origins" subtitle="Match Internals, scene, p2p etc. if announced.">
|
||||
<MultiSelect name="origins" options={ORIGIN_OPTIONS} label="Match Origins" columns={6} creatable={true} />
|
||||
<MultiSelect name="except_origins" options={ORIGIN_OPTIONS} label="Except Origins" columns={6} creatable={true} />
|
||||
|
|
2
web/src/types/Filter.d.ts
vendored
2
web/src/types/Filter.d.ts
vendored
|
@ -51,6 +51,8 @@ interface Filter {
|
|||
except_categories: string;
|
||||
match_uploaders: string;
|
||||
except_uploaders: string;
|
||||
match_language: string[];
|
||||
except_language: string[];
|
||||
tags: string;
|
||||
except_tags: string;
|
||||
tags_any: string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue