mirror of
https://github.com/morpheus65535/bazarr
synced 2025-02-22 14:00:52 +00:00
Merge remote-tracking branch 'origin/development' into development
This commit is contained in:
commit
46a8bd2909
3 changed files with 10 additions and 1 deletions
|
@ -37,4 +37,5 @@ class Searches(Resource):
|
||||||
movies = list(movies)
|
movies = list(movies)
|
||||||
search_list += movies
|
search_list += movies
|
||||||
|
|
||||||
|
|
||||||
return jsonify(search_list)
|
return jsonify(search_list)
|
||||||
|
|
|
@ -5,6 +5,7 @@ import {
|
||||||
faUser,
|
faUser,
|
||||||
} from "@fortawesome/free-solid-svg-icons";
|
} from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
import { uniqueId } from "lodash";
|
||||||
import React, { FunctionComponent, useMemo } from "react";
|
import React, { FunctionComponent, useMemo } from "react";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
|
@ -35,16 +36,22 @@ async function SearchItem(text: string) {
|
||||||
|
|
||||||
return results.map<SearchResult>((v) => {
|
return results.map<SearchResult>((v) => {
|
||||||
let link: string;
|
let link: string;
|
||||||
|
let id: string;
|
||||||
if (v.sonarrSeriesId) {
|
if (v.sonarrSeriesId) {
|
||||||
link = `/series/${v.sonarrSeriesId}`;
|
link = `/series/${v.sonarrSeriesId}`;
|
||||||
|
id = `series-${v.sonarrSeriesId}`;
|
||||||
} else if (v.radarrId) {
|
} else if (v.radarrId) {
|
||||||
link = `/movies/${v.radarrId}`;
|
link = `/movies/${v.radarrId}`;
|
||||||
|
id = `movie-${v.radarrId}`;
|
||||||
} else {
|
} else {
|
||||||
link = "";
|
link = "";
|
||||||
|
id = uniqueId("unknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: `${v.title} (${v.year})`,
|
name: `${v.title} (${v.year})`,
|
||||||
link,
|
link,
|
||||||
|
id,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { useHistory } from "react-router";
|
||||||
import { useThrottle } from "rooks";
|
import { useThrottle } from "rooks";
|
||||||
|
|
||||||
export interface SearchResult {
|
export interface SearchResult {
|
||||||
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
link?: string;
|
link?: string;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +59,7 @@ export const SearchBar: FunctionComponent<Props> = ({
|
||||||
const items = useMemo(() => {
|
const items = useMemo(() => {
|
||||||
const its = results.map((v) => (
|
const its = results.map((v) => (
|
||||||
<Dropdown.Item
|
<Dropdown.Item
|
||||||
key={v.name}
|
key={v.id}
|
||||||
eventKey={v.link}
|
eventKey={v.link}
|
||||||
disabled={v.link === undefined}
|
disabled={v.link === undefined}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in a new issue