mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Add option to filename parser to skip organized scenes (#1665)
Fixes #1219
This commit is contained in:
@@ -125,7 +125,8 @@ type FindScenesResultType {
|
||||
input SceneParserInput {
|
||||
ignoreWords: [String!],
|
||||
whitespaceCharacters: String,
|
||||
capitalizeTitle: Boolean
|
||||
capitalizeTitle: Boolean,
|
||||
ignoreOrganized: Boolean
|
||||
}
|
||||
|
||||
type SceneMovieID {
|
||||
|
||||
@@ -484,6 +484,11 @@ func (p *SceneFilenameParser) Parse(repo models.ReaderRepository) ([]*models.Sce
|
||||
},
|
||||
}
|
||||
|
||||
if p.ParserInput.IgnoreOrganized != nil && *p.ParserInput.IgnoreOrganized {
|
||||
organized := false
|
||||
sceneFilter.Organized = &organized
|
||||
}
|
||||
|
||||
p.Filter.Q = nil
|
||||
|
||||
scenes, total, err := repo.Scene().Query(sceneFilter, p.Filter)
|
||||
|
||||
@@ -63,6 +63,7 @@ export interface IParserInput {
|
||||
page: number;
|
||||
pageSize: number;
|
||||
findClicked: boolean;
|
||||
ignoreOrganized: boolean;
|
||||
}
|
||||
|
||||
interface IParserRecipe {
|
||||
@@ -95,6 +96,9 @@ export const ParserInput: React.FC<IParserInputProps> = (
|
||||
const [capitalizeTitle, setCapitalizeTitle] = useState<boolean>(
|
||||
props.input.capitalizeTitle
|
||||
);
|
||||
const [ignoreOrganized, setIgnoreOrganized] = useState<boolean>(
|
||||
props.input.ignoreOrganized
|
||||
);
|
||||
|
||||
function onFind() {
|
||||
props.onFind({
|
||||
@@ -105,6 +109,7 @@ export const ParserInput: React.FC<IParserInputProps> = (
|
||||
page: 1,
|
||||
pageSize: props.input.pageSize,
|
||||
findClicked: props.input.findClicked,
|
||||
ignoreOrganized,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -226,6 +231,20 @@ export const ParserInput: React.FC<IParserInputProps> = (
|
||||
})}
|
||||
</Form.Label>
|
||||
</Form.Group>
|
||||
<Form.Group>
|
||||
<Form.Check
|
||||
inline
|
||||
className="m-0"
|
||||
id="ignore-organized"
|
||||
checked={ignoreOrganized}
|
||||
onChange={() => setIgnoreOrganized(!ignoreOrganized)}
|
||||
/>
|
||||
<Form.Label htmlFor="ignore-organized">
|
||||
{intl.formatMessage({
|
||||
id: "config.tools.scene_filename_parser.ignore_organized",
|
||||
})}
|
||||
</Form.Label>
|
||||
</Form.Group>
|
||||
|
||||
{/* TODO - mapping stuff will go here */}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ const initialParserInput = {
|
||||
page: 1,
|
||||
pageSize: 20,
|
||||
findClicked: false,
|
||||
ignoreOrganized: true,
|
||||
};
|
||||
|
||||
const initialShowFieldsState = new Map<string, boolean>([
|
||||
@@ -127,6 +128,7 @@ export const SceneFilenameParser: React.FC = () => {
|
||||
ignoreWords: parserInput.ignoreWords,
|
||||
whitespaceCharacters: parserInput.whitespaceCharacters,
|
||||
capitalizeTitle: parserInput.capitalizeTitle,
|
||||
ignoreOrganized: parserInput.ignoreOrganized,
|
||||
};
|
||||
|
||||
queryParseSceneFilenames(parserFilter, parserInputData)
|
||||
|
||||
@@ -295,6 +295,7 @@
|
||||
"escape_chars": "Use \\ to escape literal characters",
|
||||
"filename": "Filename",
|
||||
"filename_pattern": "Filename Pattern",
|
||||
"ignore_organized": "Ignore organised scenes",
|
||||
"ignored_words": "Ignored words",
|
||||
"matches_with": "Matches with {i}",
|
||||
"select_parser_recipe": "Select Parser Recipe",
|
||||
|
||||
@@ -2,5 +2,10 @@
|
||||
"eye_color": "Eye Color",
|
||||
"favourite": "Favorite",
|
||||
"hair_color": "Hair Color",
|
||||
"organized": "Organized"
|
||||
"organized": "Organized",
|
||||
"tools": {
|
||||
"scene_filename_parser": {
|
||||
"ignore_organized": "Ignore organized scenes"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user