diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 0203bba61..76a175d63 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -25,7 +25,7 @@ "react-dom": "^17", "react-helmet": "^6.1", "react-redux": "^7.2", - "react-router-dom": "^5.2", + "react-router-dom": "^5.3", "react-scripts": "^4", "react-select": "^4", "react-table": "^7", @@ -17095,11 +17095,11 @@ } }, "node_modules/react-router": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz", - "integrity": "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.1.tgz", + "integrity": "sha512-lIboRiOtDLFdg1VTemMwud9vRVuOCZmUIT/7lUoZiSpPODiiH1UQlfXy+vPLC/7IWdFYnhRwAyNqA/+I7wnvKQ==", "dependencies": { - "@babel/runtime": "^7.1.2", + "@babel/runtime": "^7.12.13", "history": "^4.9.0", "hoist-non-react-statics": "^3.1.0", "loose-envify": "^1.3.1", @@ -17115,15 +17115,15 @@ } }, "node_modules/react-router-dom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.0.tgz", - "integrity": "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.0.tgz", + "integrity": "sha512-ObVBLjUZsphUUMVycibxgMdh5jJ1e3o+KpAZBVeHcNQZ4W+uUGGWsokurzlF4YOldQYRQL4y6yFRWM4m3svmuQ==", "dependencies": { - "@babel/runtime": "^7.1.2", + "@babel/runtime": "^7.12.13", "history": "^4.9.0", "loose-envify": "^1.3.1", "prop-types": "^15.6.2", - "react-router": "5.2.0", + "react-router": "5.2.1", "tiny-invariant": "^1.0.2", "tiny-warning": "^1.0.0" }, @@ -35324,11 +35324,11 @@ } }, "react-router": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz", - "integrity": "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.1.tgz", + "integrity": "sha512-lIboRiOtDLFdg1VTemMwud9vRVuOCZmUIT/7lUoZiSpPODiiH1UQlfXy+vPLC/7IWdFYnhRwAyNqA/+I7wnvKQ==", "requires": { - "@babel/runtime": "^7.1.2", + "@babel/runtime": "^7.12.13", "history": "^4.9.0", "hoist-non-react-statics": "^3.1.0", "loose-envify": "^1.3.1", @@ -35341,15 +35341,15 @@ } }, "react-router-dom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.0.tgz", - "integrity": "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.0.tgz", + "integrity": "sha512-ObVBLjUZsphUUMVycibxgMdh5jJ1e3o+KpAZBVeHcNQZ4W+uUGGWsokurzlF4YOldQYRQL4y6yFRWM4m3svmuQ==", "requires": { - "@babel/runtime": "^7.1.2", + "@babel/runtime": "^7.12.13", "history": "^4.9.0", "loose-envify": "^1.3.1", "prop-types": "^15.6.2", - "react-router": "5.2.0", + "react-router": "5.2.1", "tiny-invariant": "^1.0.2", "tiny-warning": "^1.0.0" } diff --git a/frontend/package.json b/frontend/package.json index e3793fc4b..9b616aecc 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -30,7 +30,7 @@ "react-dom": "^17", "react-helmet": "^6.1", "react-redux": "^7.2", - "react-router-dom": "^5.2", + "react-router-dom": "^5.3", "react-scripts": "^4", "react-select": "^4", "react-table": "^7", diff --git a/frontend/src/DisplayItem/Episodes/index.tsx b/frontend/src/DisplayItem/Episodes/index.tsx index aa43c513d..3cf8643fc 100644 --- a/frontend/src/DisplayItem/Episodes/index.tsx +++ b/frontend/src/DisplayItem/Episodes/index.tsx @@ -102,7 +102,7 @@ const SeriesEpisodesView: FunctionComponent = (props) => { seriesid: id, } ); - dispatchTask("Scaning disk...", [task], "Scaning..."); + dispatchTask("Scanning disk...", [task], "Scanning..."); }} > Scan Disk diff --git a/frontend/src/Navigation/RootRedirect.tsx b/frontend/src/Navigation/RootRedirect.tsx new file mode 100644 index 000000000..eec9a335d --- /dev/null +++ b/frontend/src/Navigation/RootRedirect.tsx @@ -0,0 +1,19 @@ +import { FunctionComponent } from "react"; +import { Redirect } from "react-router-dom"; +import { useIsRadarrEnabled, useIsSonarrEnabled } from "../@redux/hooks"; + +const RootRedirect: FunctionComponent = () => { + const sonarr = useIsSonarrEnabled(); + const radarr = useIsRadarrEnabled(); + + let path = "/settings"; + if (sonarr) { + path = "/series"; + } else if (radarr) { + path = "movies"; + } + + return ; +}; + +export default RootRedirect; diff --git a/frontend/src/Navigation/index.ts b/frontend/src/Navigation/index.ts index 5468bea34..db98a838b 100644 --- a/frontend/src/Navigation/index.ts +++ b/frontend/src/Navigation/index.ts @@ -37,6 +37,7 @@ import SystemTasksView from "../System/Tasks"; import WantedMoviesView from "../Wanted/Movies"; import WantedSeriesView from "../Wanted/Series"; import { Navigation } from "./nav"; +import RootRedirect from "./RootRedirect"; export function useNavigationItems() { const seriesEnabled = useIsSeriesEnabled(); @@ -51,6 +52,12 @@ export function useNavigationItems() { component: EmptyPage, routeOnly: true, }, + { + name: "Redirect", + path: "/", + component: RootRedirect, + routeOnly: true, + }, { icon: faPlay, name: "Series", diff --git a/libs/subliminal_patch/providers/addic7ed.py b/libs/subliminal_patch/providers/addic7ed.py index f61222ee6..530ab62dc 100644 --- a/libs/subliminal_patch/providers/addic7ed.py +++ b/libs/subliminal_patch/providers/addic7ed.py @@ -252,7 +252,8 @@ class Addic7edProvider(_Addic7edProvider): type, media_id = link['href'].split('/') if type == 'movie': media_title = link.text - if match := re.search(r'(.+)\s\((\d{4})\)$', media_title): + match = re.search(r'(.+)\s\((\d{4})\)$', media_title) + if match: media_name = match.group(1) media_year = match.group(2) if sanitize(media_name.lower()) == sanitize(movie.lower()) and media_year == str(year): diff --git a/libs/subliminal_patch/providers/titrari.py b/libs/subliminal_patch/providers/titrari.py index 7ac00c3d7..615ceb122 100644 --- a/libs/subliminal_patch/providers/titrari.py +++ b/libs/subliminal_patch/providers/titrari.py @@ -97,7 +97,7 @@ class TitrariProvider(Provider, ProviderSubtitleArchiveMixin): languages = {Language(l) for l in ['ron', 'eng']} languages.update(set(Language.rebuild(l, forced=True) for l in languages)) api_url = 'https://www.titrari.ro/' - query_advanced_search = 'cautaredevansata' + query_advanced_search = 'cautarenedevansata' def __init__(self): self.session = None