diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index be962be83..333ba2a71 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -3,6 +3,7 @@ name: CI Build
on:
push:
branches: [ develop, master ]
+ workflow_dispatch:
jobs:
build-ui:
@@ -38,7 +39,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
- dotnet-version: '5.0.x'
+ dotnet-version: '6.0.x'
- name: Nuget Cache
uses: actions/cache@v2
@@ -67,7 +68,7 @@ jobs:
uses: TriPSs/conventional-changelog-action@v3
with:
version-file: 'version.json'
- release-count: 20
+ release-count: 40
skip-on-empty: 'false'
git-message: 'chore(release): :rocket: {version}'
@@ -103,6 +104,12 @@ jobs:
format: tar.gz
steps:
- uses: actions/checkout@v2
+ - uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: '6.0.x'
+ - uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: '5.0.x'
- name: Nuget Cache
uses: actions/cache@v2
@@ -183,6 +190,7 @@ jobs:
if: contains(github.ref, 'develop')
with:
prerelease: true
+ generate_release_notes: true
body: ${{ needs.versioning.outputs.changelog }}
name: ${{ needs.versioning.outputs.tag }}
tag_name: ${{ needs.versioning.outputs.tag }}
diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml
new file mode 100644
index 000000000..47917439c
--- /dev/null
+++ b/.github/workflows/chromatic.yml
@@ -0,0 +1,47 @@
+name: 'Chromatic'
+
+# Event for the workflow
+on:
+ push:
+ workflow_dispatch:
+
+# List of jobs
+jobs:
+ storybook-build:
+ # Operating System
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: NodeModules Cache
+ uses: actions/cache@v2
+ with:
+ path: '**/node_modules'
+ key: node_modules-${{ hashFiles('**/yarn.lock') }}
+
+ - name: Install dependencies
+ working-directory: ./src/Ombi/ClientApp
+ run: yarn
+
+ - name: Publish to Chromatic
+ if: github.ref != 'refs/heads/master'
+ uses: chromaui/action@v1
+ with:
+ projectToken: 7c47e1a1a4bd
+ exitZeroOnChanges: true
+ workingDir: ./src/Ombi/ClientApp
+ buildScriptName: storybookbuild
+ exitOnceUploaded: true
+
+ - name: Publish to Chromatic and auto accept changes
+ if: github.ref == 'refs/heads/master'
+ uses: chromaui/action@v1
+ with:
+ projectToken: 7c47e1a1a4bd
+ autoAcceptChanges: true # 👈 Option to accept all changes
+ workingDir: ./src/Ombi/ClientApp
+ buildScriptName: storybookbuild
+ exitOnceUploaded: true
diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml
index 499cd272d..9101bdb60 100644
--- a/.github/workflows/cypress.yml
+++ b/.github/workflows/cypress.yml
@@ -7,6 +7,7 @@ on:
branches: [ develop ]
schedule:
- cron: '0 0 * * *'
+ workflow_dispatch:
jobs:
automation-tests:
@@ -18,7 +19,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
- dotnet-version: 5.0.x
+ dotnet-version: 6.0.x
- uses: actions/setup-node@v2
with:
node-version: '14'
@@ -33,15 +34,17 @@ jobs:
- name: Install Frontend Deps
run: yarn --cwd ./src/Ombi/ClientApp install
+ - name: Start Frontend
+ run: |
+ nohup yarn --cwd ./src/Ombi/ClientApp start &
+
- name: Install Automation Deps
run: yarn --cwd ./tests install
- name: Start Backend
run: |
- nohup dotnet run -p ./src/Ombi -- --host http://*:3577 &
- - name: Start Frontend
- run: |
- nohup yarn --cwd ./src/Ombi/ClientApp start &
+ nohup dotnet run --project ./src/Ombi -- --host http://*:3577 &
+
- name: Cypress Tests
uses: cypress-io/github-action@v2.8.2
with:
@@ -50,8 +53,8 @@ jobs:
headless: true
working-directory: tests
wait-on: http://localhost:3577/
- # 7 minutes
- wait-on-timeout: 420
+ # 10 minutes
+ wait-on-timeout: 600
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
\ No newline at end of file
diff --git a/.github/workflows/issue-check.yml b/.github/workflows/issue-check.yml
index 9dfe5cc45..51b87b8d3 100644
--- a/.github/workflows/issue-check.yml
+++ b/.github/workflows/issue-check.yml
@@ -8,9 +8,6 @@ jobs:
issueCheck:
runs-on: ubuntu-latest
steps:
- - name: Output version
- run: |
- echo "log: ${{ github.event.issue.body }}"
- if: startsWith(github.event.issue.body , '**Describe the bug**') == false
name: Close Issue
diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml
index 7c724a62a..402c5ffd0 100644
--- a/.github/workflows/label.yml
+++ b/.github/workflows/label.yml
@@ -8,6 +8,8 @@
name: Labeler
on: [pull_request]
+permissions: write-all
+
jobs:
label:
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index e353dce4d..7465635cc 100644
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -3,6 +3,12 @@ name: PR Build
on:
pull_request:
types: [opened, synchronize, reopened]
+ workflow_dispatch:
+
+permissions:
+ pull-requests: write
+ issues: write
+ repository-projects: write
jobs:
build-ui:
@@ -27,11 +33,12 @@ jobs:
unit-test:
runs-on: ubuntu-latest
+
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
- dotnet-version: '5.0.x'
+ dotnet-version: '6.0.x'
- name: Nuget Cache
uses: actions/cache@v2
@@ -44,7 +51,7 @@ jobs:
- name: Run Unit Tests
run: |
cd src
- dotnet test --logger trx --results-directory "TestResults"
+ dotnet test --configuration "Release" --logger "trx;LogFileName=test-results.trx"
analysis:
runs-on: ubuntu-latest
@@ -89,6 +96,9 @@ jobs:
format: tar.gz
steps:
- uses: actions/checkout@v2
+ - uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: '6.0.x'
- name: Nuget Cache
uses: actions/cache@v2
diff --git a/.gitignore b/.gitignore
index 845eda385..cae15017a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -251,3 +251,4 @@ _Pvt_Extensions
/src/Ombi/databases.json
/src/Ombi/healthchecksdb
/src/Ombi/ClientApp/package-lock.json
+/src/Ombi.Core/Properties/launchSettings.json
diff --git a/.mergify.yml b/.mergify.yml
new file mode 100644
index 000000000..fac2166e3
--- /dev/null
+++ b/.mergify.yml
@@ -0,0 +1,7 @@
+pull_request_rules:
+ - name: Automatic merge on approval
+ conditions:
+ - "#approved-reviews-by>=1"
+ actions:
+ merge:
+ method: merge
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0191c7064..63ab88463 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,62 +1,361 @@
-## [4.3.3](https://github.com/Ombi-app/Ombi/compare/v4.3.2...v4.3.3) (2021-11-05)
-
-
-
-## [4.3.2](https://github.com/Ombi-app/Ombi/compare/v4.3.1...v4.3.2) (2021-11-02)
+## [4.22.3](https://github.com/Ombi-app/Ombi/compare/v4.22.2...v4.22.3) (2022-07-28)
### Bug Fixes
-* **translations:** 🌐 Localization - Ensuring all of the app including backend are localized [#4366](https://github.com/Ombi-app/Ombi/issues/4366) ([5e140ab](https://github.com/Ombi-app/Ombi/commit/5e140ab6183b887a7665f5e870eb0bd05d487ace))
+* Override Sonarr V3 Profiles endpoint ([#4678](https://github.com/Ombi-app/Ombi/issues/4678)) ([875da95](https://github.com/Ombi-app/Ombi/commit/875da959f353119b05138d68ee6d32a49e14b91e))
-## [4.3.1](https://github.com/Ombi-app/Ombi/compare/v4.3.0...v4.3.1) (2021-10-27)
+## [4.22.2](https://github.com/Ombi-app/Ombi/compare/v4.22.1...v4.22.2) (2022-07-25)
### Bug Fixes
-* :bug: Hides no results message during search. ([#4375](https://github.com/Ombi-app/Ombi/issues/4375)) ([b819b0e](https://github.com/Ombi-app/Ombi/commit/b819b0e007e578bf3d8425f19591f87029c64d06))
+* fixed an issue where I broke images for some users ([81ddc85](https://github.com/Ombi-app/Ombi/commit/81ddc8553b9094c3f6843b036daebb2eb9262e00))
-# [4.3.0](https://github.com/Ombi-app/Ombi/compare/v4.2.13...v4.3.0) (2021-10-20)
+## [4.22.1](https://github.com/Ombi-app/Ombi/compare/v4.22.0...v4.22.1) (2022-07-25)
### Bug Fixes
-* **translations:** 🌐 New translations from Crowdin [skip ci] ([b0f3abb](https://github.com/Ombi-app/Ombi/commit/b0f3abb9ceebdbe5d6c20af98b7355df2999eb58))
-* **translations:** 🌐 New translations from Crowdin [skip ci] ([77d017b](https://github.com/Ombi-app/Ombi/commit/77d017b3d8ffd1714a2f6efecc8c900d56d062e4))
-* **translations:** 🌐 New translations from Crowdin [skip ci] ([f6e9784](https://github.com/Ombi-app/Ombi/commit/f6e9784367d3678d899ed79bef6caa52005b6661))
-* **translations:** 🌐 New translations from Crowdin [skip ci] ([601a877](https://github.com/Ombi-app/Ombi/commit/601a87762a2ad393ee5fa2fe52052ceeeefb1bef))
-* **translations:** 🌐 New translations from Crowdin [skip ci] ([a4a80ba](https://github.com/Ombi-app/Ombi/commit/a4a80ba4da49733a65e691003646c0f349bd4c5f))
-* **translations:** 🌐 New translations from Crowdin [skip ci] ([2961319](https://github.com/Ombi-app/Ombi/commit/2961319f61e95b2871480152b86ddca3375576a1))
-* **translations:** 🌐 New translations from Crowdin [skip ci] ([fc8d108](https://github.com/Ombi-app/Ombi/commit/fc8d108b660d53f499538328bfc271b05ac47d2b))
-* **translations:** 🌐 New translations from Crowdin [skip ci] ([1e03651](https://github.com/Ombi-app/Ombi/commit/1e03651c3b0eb77e45f9f6c55d31ee672eacd51e))
-* **translations:** 🌐 New translations from Crowdin [skip ci] ([c0dd327](https://github.com/Ombi-app/Ombi/commit/c0dd327426514e305a88750d7c3deb21c194108f))
-* **translations:** 🌐 New translations from Crowdin [skip ci] ([2156129](https://github.com/Ombi-app/Ombi/commit/2156129f175335746f204bb123035c070f518e96))
-* **translations:** 🌐 New translations from Crowdin [skip ci] ([aef0368](https://github.com/Ombi-app/Ombi/commit/aef0368de3aec306245bd1b16bc0de596a20d451))
-* **translations:** 🌐 New translations from Crowdin [skip ci] ([a38090b](https://github.com/Ombi-app/Ombi/commit/a38090b8dde17d1d150af0bca2830ea45d013a0e))
-* **translations:** 🌐 New translations from Crowdin [skip ci] ([c5f1d33](https://github.com/Ombi-app/Ombi/commit/c5f1d3355758a5c3648479d44e50397c7f6c1a9d))
-* **translations:** 🌐 New translations from Crowdin [skip ci] ([3846d56](https://github.com/Ombi-app/Ombi/commit/3846d56a6e561a1b1dc65c385151d90fdd6217ee))
-* **translations:** 🌐 New translations from Crowdin [skip ci] ([dafe9c1](https://github.com/Ombi-app/Ombi/commit/dafe9c1a19d84f00c13f0a51ba90927c24282926))
-* **translations:** 🌐 New translations from Crowdin [skip ci] ([edb418a](https://github.com/Ombi-app/Ombi/commit/edb418a6f05887c68a0c24c48decc691996f97e4))
-* **translations:** 🌐 New translations from Crowdin [skip ci] ([dadabf9](https://github.com/Ombi-app/Ombi/commit/dadabf93e1582a0c39321fd9bf3de3fb11e3f406))
+* **discover:** :bug: Created new Image component to handle 429's from TMDB ([#4698](https://github.com/Ombi-app/Ombi/issues/4698)) and fixed [#4635](https://github.com/Ombi-app/Ombi/issues/4635) ([#4699](https://github.com/Ombi-app/Ombi/issues/4699)) ([f22d3da](https://github.com/Ombi-app/Ombi/commit/f22d3da765799365455b919027f7563e52b347c3))
+
+
+
+# [4.22.0](https://github.com/Ombi-app/Ombi/compare/v4.21.2...v4.22.0) (2022-07-22)
### Features
-* **request-limits:** :sparkles: Added the new request limit options into the user importer ([01d4f4d](https://github.com/Ombi-app/Ombi/commit/01d4f4d718fe85ac181dae52565fb1b427965b4f))
-* **request-limits:** :sparkles: Added the new request limit options to the bulk edit ([03bc23a](https://github.com/Ombi-app/Ombi/commit/03bc23a74e4308aa6b4c6b25636edcdeb65c1f0e))
+* **discover:** ✨ Added infinite scroll on advanced search results ([898bc89](https://github.com/Ombi-app/Ombi/commit/898bc89fa78245c1f3de9481f6c724f087a16e39))
-## [4.2.13](https://github.com/Ombi-app/Ombi/compare/v4.2.12...v4.2.13) (2021-10-20)
+## [4.21.2](https://github.com/Ombi-app/Ombi/compare/v4.21.1...v4.21.2) (2022-07-22)
### Bug Fixes
-* **translations:** 🌐 New translations %two_letters_code% from Crowdin [skip ci] ([8fbd267](https://github.com/Ombi-app/Ombi/commit/8fbd267b516ddaa80fd16c091bae532b860fbf45))
+* Landing and Login page improvements ([#4690](https://github.com/Ombi-app/Ombi/issues/4690)) ([6d423b5](https://github.com/Ombi-app/Ombi/commit/6d423b5447c52c5e59d8d2bd92a23b47468eb736))
+
+
+
+## [4.21.1](https://github.com/Ombi-app/Ombi/compare/v4.21.0...v4.21.1) (2022-07-11)
+
+
+### Bug Fixes
+
+* **images:** Retry images with a backoff when we get a Too Many requests from TheMovieDb [#4685](https://github.com/Ombi-app/Ombi/issues/4685) ([3f1f35d](https://github.com/Ombi-app/Ombi/commit/3f1f35df3164db6739691cdda8f925c296239791))
+
+
+
+# [4.21.0](https://github.com/Ombi-app/Ombi/compare/v4.20.4...v4.21.0) (2022-06-22)
+
+
+### Features
+
+* Upgrade to Angular14 ([#4668](https://github.com/Ombi-app/Ombi/issues/4668)) ([b9d55a4](https://github.com/Ombi-app/Ombi/commit/b9d55a469b412558cbf67c1e25db7fdda5964cd8))
+
+
+### Performance Improvements
+
+* stop populating obsolete subscribe fields ([#4625](https://github.com/Ombi-app/Ombi/issues/4625)) ([9a73463](https://github.com/Ombi-app/Ombi/commit/9a734637665f671b17c2bb440d93b35a891c142b))
+
+
+
+## [4.20.4](https://github.com/Ombi-app/Ombi/compare/v4.20.3...v4.20.4) (2022-06-15)
+
+
+### Bug Fixes
+
+* fixed build ([f877921](https://github.com/Ombi-app/Ombi/commit/f8779219146051ea74f8b6408658ff7975afb88b))
+
+
+
+## [4.20.3](https://github.com/Ombi-app/Ombi/compare/v4.20.2...v4.20.3) (2022-06-05)
+
+
+### Bug Fixes
+
+* **plex:** 🐛 Fixed an issue with the Plex Sync ([ab1a11a](https://github.com/Ombi-app/Ombi/commit/ab1a11af78efbe9d37bd55aa80a640796c138a98))
+
+
+
+## [4.20.2](https://github.com/Ombi-app/Ombi/compare/v4.20.1...v4.20.2) (2022-06-03)
+
+
+### Bug Fixes
+
+* :bug: Fixed the Request on Behalf of having blanks ([#4667](https://github.com/Ombi-app/Ombi/issues/4667)) ([7dd9b1c](https://github.com/Ombi-app/Ombi/commit/7dd9b1cac07f571dd35b362544e4fe0226c4b817))
+
+
+
+## [4.20.1](https://github.com/Ombi-app/Ombi/compare/v4.20.0...v4.20.1) (2022-05-27)
+
+
+### Bug Fixes
+
+* added media type tag to media type text ([#4638](https://github.com/Ombi-app/Ombi/issues/4638)) ([fe501d3](https://github.com/Ombi-app/Ombi/commit/fe501d34a0c36ac9f000b107eca49dbc6694d006))
+* **API:** Fix pagination in some edge cases ([#4649](https://github.com/Ombi-app/Ombi/issues/4649)) ([a70bf8f](https://github.com/Ombi-app/Ombi/commit/a70bf8f46c76d74c9dfdf908c53bd9955ca0a35d))
+* **discover:** Carousel touch not working when scrolling page and recommendations and similar movie navigation ([#4633](https://github.com/Ombi-app/Ombi/issues/4633)) ([d5ef1d5](https://github.com/Ombi-app/Ombi/commit/d5ef1d53e5f77d19dba8b8059c80b538a3e14f2a))
+* Improve Swagger documentation ([#4652](https://github.com/Ombi-app/Ombi/issues/4652)) ([181892b](https://github.com/Ombi-app/Ombi/commit/181892bcfe88e6d76febf49ef57745d04552d08e))
+* Missing Poster broken link fix ([#4637](https://github.com/Ombi-app/Ombi/issues/4637)) ([4070f0d](https://github.com/Ombi-app/Ombi/commit/4070f0d093b1c92487a1c80cabad8283a9650f51))
+* **sickrage:** Fixed issue with incorrect handling of SiCKRAGE episode results returned during episode status changes, now expects array of objects from data path if present ([#4648](https://github.com/Ombi-app/Ombi/issues/4648)) ([6d16442](https://github.com/Ombi-app/Ombi/commit/6d16442d4d714920367df065a3ced42b729f4233))
+* **sync:** Emby+Jellyfin - sync multi-episode files of 3+ episodes ([bd8fd89](https://github.com/Ombi-app/Ombi/commit/bd8fd890554c9d85d6da4d2cee813e82ce698e52))
+
+
+
+# [4.20.0](https://github.com/Ombi-app/Ombi/compare/v4.19.1...v4.20.0) (2022-04-28)
+
+
+### Features
+
+* **discover:** Show more relevant shows in upcoming TV ([8357819](https://github.com/Ombi-app/Ombi/commit/8357819b53b8c675c0b246d7006b5a778bdba33f))
+
+
+
+## [4.19.1](https://github.com/Ombi-app/Ombi/compare/v4.19.0...v4.19.1) (2022-04-27)
+
+
+
+# [4.19.0](https://github.com/Ombi-app/Ombi/compare/v4.18.0...v4.19.0) (2022-04-27)
+
+
+### Features
+
+* **sync:** Detect reidentified movies in Emby and Jellyfin ([5938077](https://github.com/Ombi-app/Ombi/commit/5938077d82a5357f79c07b218b3986557a5816e8))
+* **sync:** Detect reidentified series in Emby and Jellyfin ([9096e91](https://github.com/Ombi-app/Ombi/commit/9096e91d55d268819bce22831f8a8b27f2a1776b))
+
+
+
+# [4.18.0](https://github.com/Ombi-app/Ombi/compare/v4.17.0...v4.18.0) (2022-04-26)
+
+
+### Bug Fixes
+
+* **discover:** Fix cache mix up ([03d9422](https://github.com/Ombi-app/Ombi/commit/03d94220c7eaafb50c6c80a6ed1150794b873ac3))
+* **discover:** Fix new trending feature detection ([6794b88](https://github.com/Ombi-app/Ombi/commit/6794b887f6544fb41528bdd9728b7824b65e47ee))
+* **settings:** Allow toggling features when there are more than one ([a373359](https://github.com/Ombi-app/Ombi/commit/a373359ae8e6bad42b558a6e01a8ff2840d3bbaa))
+
+
+### Features
+
+* **discover:** Add new trending source experimental feature ([1a0823c](https://github.com/Ombi-app/Ombi/commit/1a0823ca80559417c67323aaeaa1ef5243e98031))
+* **discover:** Default trending source to new logic ([4f12939](https://github.com/Ombi-app/Ombi/commit/4f12939e22020a67a5ee75e2907923faea136e8d))
+
+
+
+# [4.17.0](https://github.com/Ombi-app/Ombi/compare/v4.16.17...v4.17.0) (2022-04-25)
+
+
+### Features
+
+* **discover:** Add original language filter ([ef7ec86](https://github.com/Ombi-app/Ombi/commit/ef7ec861d8aede2a4817752c990617f583805391))
+
+
+
+## [4.16.17](https://github.com/Ombi-app/Ombi/compare/v4.16.16...v4.16.17) (2022-04-25)
+
+
+
+## [4.16.16](https://github.com/Ombi-app/Ombi/compare/v4.16.15...v4.16.16) (2022-04-25)
+
+
+### Bug Fixes
+
+* **4616:** :bug: fixed mandatory fields ([d8f2260](https://github.com/Ombi-app/Ombi/commit/d8f2260c7ae3ed48386743b7adbd06e284487034))
+
+
+
+## [4.16.15](https://github.com/Ombi-app/Ombi/compare/v4.16.14...v4.16.15) (2022-04-24)
+
+
+
+## [4.16.14](https://github.com/Ombi-app/Ombi/compare/v4.16.13...v4.16.14) (2022-04-19)
+
+
+
+## [4.16.13](https://github.com/Ombi-app/Ombi/compare/v4.16.12...v4.16.13) (2022-04-19)
+
+
+
+## [4.16.12](https://github.com/Ombi-app/Ombi/compare/v4.16.11...v4.16.12) (2022-04-19)
+
+
+
+## [4.16.11](https://github.com/Ombi-app/Ombi/compare/v4.16.10...v4.16.11) (2022-04-14)
+
+
+### Bug Fixes
+
+* Set the default job for the watchlist import to hourly instead of daily ([75906af](https://github.com/Ombi-app/Ombi/commit/75906af0adee3e3c68d825c3aaa8f7b918461b1f))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([0e8a64b](https://github.com/Ombi-app/Ombi/commit/0e8a64b8ca00d210fbe843ac2c3f6af218d80cbc))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([7b0ad61](https://github.com/Ombi-app/Ombi/commit/7b0ad61bfcff3986b33180dc64022cba7ea8eefb))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([4fc2c1f](https://github.com/Ombi-app/Ombi/commit/4fc2c1f24534085a783a3d5791f5533b68272153))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([76ab733](https://github.com/Ombi-app/Ombi/commit/76ab733b91791e4d93d184f3c7d0779c6a388695))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([06e4cef](https://github.com/Ombi-app/Ombi/commit/06e4cefa7b4e55b860da9a64f461f6ec8fa17367))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([c12d89d](https://github.com/Ombi-app/Ombi/commit/c12d89d6781a337520977ad285f8d08c93f434dd))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([bc0c2f6](https://github.com/Ombi-app/Ombi/commit/bc0c2f622e34fb5a2711039d9ed7aad34f982b15))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([e4b00e6](https://github.com/Ombi-app/Ombi/commit/e4b00e6b3468bd9389eeb02fc6ad7daf27abc3b3))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([d1998d3](https://github.com/Ombi-app/Ombi/commit/d1998d326f999a38586d0a351a20c5448df95842))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([bee4ccb](https://github.com/Ombi-app/Ombi/commit/bee4ccb804594e7385b1fbdc9fe2ef5c42e0d21f))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([80233ed](https://github.com/Ombi-app/Ombi/commit/80233ed560cc976e83570d0655c3472f20171fb3))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([8a78adc](https://github.com/Ombi-app/Ombi/commit/8a78adc9bb62f277f2b213dcb3847ed6d0089fcb))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([d04c60a](https://github.com/Ombi-app/Ombi/commit/d04c60aa5909b47ba6bffa6f66b03079cbd43521))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([92a785e](https://github.com/Ombi-app/Ombi/commit/92a785e736fa4b72a45270da2d0f4661df433078))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([634982d](https://github.com/Ombi-app/Ombi/commit/634982df2661cefab5ea9f5163fe04a005cc0171))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([b404baa](https://github.com/Ombi-app/Ombi/commit/b404baad6d0aeaa1561701e0db8db4e78613a364))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([d14f11e](https://github.com/Ombi-app/Ombi/commit/d14f11e0eb20ab0a68e765ee77968b3b3e54e995))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([7cf64f9](https://github.com/Ombi-app/Ombi/commit/7cf64f909d78908edaabeffb8a39a7d02e73fe7e))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([0c9e1ec](https://github.com/Ombi-app/Ombi/commit/0c9e1ec090827080cc8f7393e5e91456ff37d691))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([3b0b730](https://github.com/Ombi-app/Ombi/commit/3b0b730cb02efe24f6d4026e5fdb20d37e495119))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([6ed1a03](https://github.com/Ombi-app/Ombi/commit/6ed1a03b7ff4077f09ea9e13394b18b0d138f4c3))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([2941acd](https://github.com/Ombi-app/Ombi/commit/2941acd3b2ec74a5e6aeea275ab5a39d2653f37f))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([c075a1a](https://github.com/Ombi-app/Ombi/commit/c075a1a66784d975eaf60f2dfbbcbe048f2f63d7))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([76bd81c](https://github.com/Ombi-app/Ombi/commit/76bd81c3ca55a98c6ec944a838dc01294a6193a6))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([0d38275](https://github.com/Ombi-app/Ombi/commit/0d3827507e002bcf58f673e97ffcc3bd25dcf337))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([5c99601](https://github.com/Ombi-app/Ombi/commit/5c99601b07aec1a65d0186a4c4327440811e64c6))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([01546a0](https://github.com/Ombi-app/Ombi/commit/01546a0f7f86379528b486463246ef9bdfb9033e))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([d7fea78](https://github.com/Ombi-app/Ombi/commit/d7fea7843aaaab7ddff8dc31ca6d2a9117471dcc))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([1a6b95d](https://github.com/Ombi-app/Ombi/commit/1a6b95d45c220310213b8d811272a63f0f6ff42b))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([fa10174](https://github.com/Ombi-app/Ombi/commit/fa1017422c4efd4b0897871bd3c671151774d7c3))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([0c31e62](https://github.com/Ombi-app/Ombi/commit/0c31e628df376aac6d56ae67c7c705a9a4a7c080))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([6399643](https://github.com/Ombi-app/Ombi/commit/63996437a02fe10ffae6822ffa15369bec0a6b36))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([5826e2d](https://github.com/Ombi-app/Ombi/commit/5826e2d9a1c3f1210a87fa270dc0c81bac32944a))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([d434514](https://github.com/Ombi-app/Ombi/commit/d43451405be489254d7cdc7755d5f516a1e495a5))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([0b9596d](https://github.com/Ombi-app/Ombi/commit/0b9596d807178f5e071113ec0347868ec7f0960b))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([8c4c0b2](https://github.com/Ombi-app/Ombi/commit/8c4c0b262978c1303767af360d802c4b4c2b4d24))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([289ab77](https://github.com/Ombi-app/Ombi/commit/289ab77b0e04aae235b6f6cebc86e0a8d1f0cf2b))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([30e3417](https://github.com/Ombi-app/Ombi/commit/30e3417285a4eed18d429d7776f0e74096e834c0))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([6c0a5da](https://github.com/Ombi-app/Ombi/commit/6c0a5dadd4b8f37760252eb0fe7f88908f55506d))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([d5bf969](https://github.com/Ombi-app/Ombi/commit/d5bf9692ce1fc0ccfe7beca6dd200c78be177bdc))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([8a9e7ea](https://github.com/Ombi-app/Ombi/commit/8a9e7ea588aefbcd73ed82625887e3614e1703ea))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([01047a3](https://github.com/Ombi-app/Ombi/commit/01047a3fd67153f3ff16f860d2c7b50213e8d9b2))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([698a23f](https://github.com/Ombi-app/Ombi/commit/698a23fb83f323cdd1dd57cb49803079d44214a7))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([24eb842](https://github.com/Ombi-app/Ombi/commit/24eb842fc4424f7bcc3ec2949d7f5472492e96f6))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([ac8b16a](https://github.com/Ombi-app/Ombi/commit/ac8b16a3051ad71dbd54a8973c7dd847b564a515))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([f428ce6](https://github.com/Ombi-app/Ombi/commit/f428ce6a700c081437703839bc84d2f2b1138bcc))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([94b16df](https://github.com/Ombi-app/Ombi/commit/94b16dfe09bf1d2cd6286777d74eb5d4496abbbb))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([4881775](https://github.com/Ombi-app/Ombi/commit/4881775eda69a8f136ce0d8fbbf970e3d0406dc9))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([8297db9](https://github.com/Ombi-app/Ombi/commit/8297db91e85da308bde6fb09ad78347dee063630))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([d1152ab](https://github.com/Ombi-app/Ombi/commit/d1152ab7674243daa528c524c0cdc87d81ad49c9))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([eb2788b](https://github.com/Ombi-app/Ombi/commit/eb2788b761b55c487a59a049427ca08f6c10e836))
+* **translations:** 🌐 New translations from Crowdin [skip ci] ([21a794c](https://github.com/Ombi-app/Ombi/commit/21a794cbc0a5fa735ca0347c8f7f1ac04a487fbc))
+
+
+
+## [4.10.2](https://github.com/Ombi-app/Ombi/compare/v4.10.1...v4.10.2) (2022-01-22)
+
+
+
+## [4.16.10](https://github.com/Ombi-app/Ombi/compare/v4.16.9...v4.16.10) (2022-04-13)
+
+
+
+## [4.16.9](https://github.com/Ombi-app/Ombi/compare/v4.16.8...v4.16.9) (2022-04-13)
+
+
+### Bug Fixes
+
+* **plex-watchlist:** Only request the latest season when importing from the watchlist ([77a47ff](https://github.com/Ombi-app/Ombi/commit/77a47ff157c6c5feafe3f2a29a3fcba8df4fdfef))
+
+
+
+## [4.16.8](https://github.com/Ombi-app/Ombi/compare/v4.16.7...v4.16.8) (2022-04-13)
+
+
+### Bug Fixes
+
+* **availability:** Fixed an issue where we wouldn't mark a available 4k movie as available (when 4K request feature is disabled) ([b492699](https://github.com/Ombi-app/Ombi/commit/b49269961d4830a530e3054976a47f519524948b))
+
+
+
+## [4.16.7](https://github.com/Ombi-app/Ombi/compare/v4.16.6...v4.16.7) (2022-04-12)
+
+
+
+## [4.16.6](https://github.com/Ombi-app/Ombi/compare/v4.16.5...v4.16.6) (2022-04-11)
+
+
+
+## [4.16.5](https://github.com/Ombi-app/Ombi/compare/v4.16.4...v4.16.5) (2022-04-08)
+
+
+### Bug Fixes
+
+* **watchlist:** actually fixed it this time... ([d962a32](https://github.com/Ombi-app/Ombi/commit/d962a3211eca29520662ddce962676e3aea17ec5))
+
+
+
+## [4.16.4](https://github.com/Ombi-app/Ombi/compare/v4.16.3...v4.16.4) (2022-04-08)
+
+
+
+## [4.16.3](https://github.com/Ombi-app/Ombi/compare/v4.16.2...v4.16.3) (2022-04-08)
+
+
+### Bug Fixes
+
+* **plex-watchlist:** :bug: Fixed the issue where the watchlist didn't work for users logging in via OAuth ([6398f6a](https://github.com/Ombi-app/Ombi/commit/6398f6a4f7755281ebeac537e3ff623df5cfa0f3))
+
+
+
+## [4.16.2](https://github.com/Ombi-app/Ombi/compare/v4.16.1...v4.16.2) (2022-04-07)
+
+
+### Bug Fixes
+
+* **wizard:** Fixed an issue when using Plex OAuth it could fail setting up ([b743cf4](https://github.com/Ombi-app/Ombi/commit/b743cf4fafa7341ad1b163276f006d7ab0e9dcff))
+
+
+
+## [4.16.1](https://github.com/Ombi-app/Ombi/compare/v4.16.0...v4.16.1) (2022-04-07)
+
+
+
+# [4.16.0](https://github.com/Ombi-app/Ombi/compare/v4.15.6...v4.16.0) (2022-04-07)
+
+
+
+## [4.15.6](https://github.com/Ombi-app/Ombi/compare/v4.15.5...v4.15.6) (2022-04-07)
+
+
+### Bug Fixes
+
+* **radarr:** Fixed an issue where we couldn't sync radarr content [#4577](https://github.com/Ombi-app/Ombi/issues/4577) ([a5355a3](https://github.com/Ombi-app/Ombi/commit/a5355a3023e6900c4dd1b0da4722d7596c03907f))
+
+
+
+## [4.15.5](https://github.com/Ombi-app/Ombi/compare/v4.15.4...v4.15.5) (2022-04-06)
+
+
+
+## [4.15.4](https://github.com/Ombi-app/Ombi/compare/v4.15.3...v4.15.4) (2022-03-29)
+
+
+
+## [4.15.3](https://github.com/Ombi-app/Ombi/compare/v4.15.2...v4.15.3) (2022-03-24)
+
+
+
+## [4.15.2](https://github.com/Ombi-app/Ombi/compare/v4.15.1...v4.15.2) (2022-03-23)
+
+
+### Bug Fixes
+
+* **metadata:** improved the metadata job to also lookup the media in Plex to see if it has any more uptodate metadata ([83d1a15](https://github.com/Ombi-app/Ombi/commit/83d1a15cc9d0ee91be73bd91c4672cf1bcf2728a))
+
+
+
+## [4.15.1](https://github.com/Ombi-app/Ombi/compare/v4.15.0...v4.15.1) (2022-03-18)
+
+
+### Bug Fixes
+
+* **mediaserver:** fixed an issue where we were not detecting available content correctly [#4542](https://github.com/Ombi-app/Ombi/issues/4542) ([9cdd6f4](https://github.com/Ombi-app/Ombi/commit/9cdd6f41cdab8825a984905c089611409c53c753))
diff --git a/README.md b/README.md
index 636c58c3e..f7b2e58ff 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ Don't worry, it's grandma friendly, and more importantly; has wife approval cert
| Service | Stable | Develop
|----------|:---------------------------:|:----------------------------:|
-| Build Status | [](https://github.com/Ombi-app/Ombi/actions/workflows/build.yml) | [](https://github.com/Ombi-app/Ombi/actions/workflows/build.yml) | [](https://dev.azure.com/tidusjar/Ombi/_build/latest?definitionId=18&branchName=feature%2Fv4)
+| Build Status | [](https://github.com/Ombi-app/Ombi/actions/workflows/build.yml) | [](https://github.com/Ombi-app/Ombi/actions/workflows/build.yml) | [](https://dev.azure.com/tidusjar/Ombi/_build/latest?definitionId=18&branchName=feature%2Fv4)
| Download |[](https://github.com/Ombi-app/Ombi/releases) | [](https://ci.appveyor.com/project/tidusjar/requestplex/branch/develop/artifacts) | [](https://github.com/ombi-app/ombi/releases) |
# Feature Requests
@@ -99,21 +99,28 @@ Here are some of the features Ombi has:
Drew
+
+
+
+
+ Sephrat
+
+ |
Anojh Thayaparan
- |
+
+
Magikarp Lvl 4
- |
-
+
@@ -148,15 +155,15 @@ Here are some of the features Ombi has:
Dhruv Bhavsar
- |
+
+
Joshua M. Boniface
- |
-
+
@@ -164,13 +171,6 @@ Here are some of the features Ombi has:
Bruvv
|
-
-
-
-
- Sephrat
-
- |
@@ -222,10 +222,10 @@ Here are some of the features Ombi has:
|
-
-
+
+
- Stefangross
+ Stefan
|
@@ -243,6 +243,13 @@ Here are some of the features Ombi has:
|
+
+
+
+
+ Francesco Servida
+
+ |
@@ -277,6 +284,14 @@ Here are some of the features Ombi has:
Aptalca
+ |
+
+
+
+
+
+ Dr3amer
+
|
@@ -284,8 +299,7 @@ Here are some of the features Ombi has:
Mhann
- |
-
+
@@ -313,7 +327,8 @@ Here are some of the features Ombi has:
Austin Jackson
- |
+
+
@@ -327,8 +342,7 @@ Here are some of the features Ombi has:
David Pooley
- |
-
+
@@ -356,7 +370,8 @@ Here are some of the features Ombi has:
Jeffrey Peters
- |
+
+
@@ -370,8 +385,7 @@ Here are some of the features Ombi has:
Qstick
- |
-
+
@@ -399,7 +413,8 @@ Here are some of the features Ombi has:
Abe Kline
- |
+
+
@@ -413,8 +428,7 @@ Here are some of the features Ombi has:
Aljosa Asanovic
- |
-
+
@@ -442,7 +456,8 @@ Here are some of the features Ombi has:
Chris Lees
- |
+
+
@@ -456,8 +471,7 @@ Here are some of the features Ombi has:
Codehhh
- |
-
+
@@ -485,7 +499,8 @@ Here are some of the features Ombi has:
Devin Buhl
- |
+
+
@@ -499,8 +514,7 @@ Here are some of the features Ombi has:
Fish2
- |
-
+
@@ -508,6 +522,13 @@ Here are some of the features Ombi has:
Haries Ramdhani
|
+
+
+
+
+ Igor Borges
+
+ |
@@ -521,7 +542,8 @@ Here are some of the features Ombi has:
Jacob Pyke
- |
+
+
@@ -542,8 +564,7 @@ Here are some of the features Ombi has:
Joe Harvey
- |
-
+
@@ -564,7 +585,8 @@ Here are some of the features Ombi has:
Kris Klosterman
- |
+
+
@@ -579,20 +601,41 @@ Here are some of the features Ombi has:
Lightkeeper
|
+
+
+
+
+ Lucane
+
+ |
Madeleine Schönemann
- |
-
+
+
+
+
+
+ Marley
+
+ |
Matt
+ |
+
+
+
+
+
+ Maxence Lecanu
+
|
@@ -608,6 +651,13 @@ Here are some of the features Ombi has:
Nathan Miller
|
+
+
+
+
+ Qiming Chen
+
+ |
@@ -621,15 +671,15 @@ Here are some of the features Ombi has:
Rob Gökemeijer
- |
+
+
Samuel Bartík
- |
-
+
@@ -644,6 +694,13 @@ Here are some of the features Ombi has:
Shoghi
|
+
+
+
+
+ Teifun2
+
+ |
@@ -657,7 +714,8 @@ Here are some of the features Ombi has:
Tim Trott
- |
+
+
@@ -671,8 +729,7 @@ Here are some of the features Ombi has:
Torkil
- |
-
+
@@ -700,7 +757,8 @@ Here are some of the features Ombi has:
Blake Drumm
- |
+
+
@@ -714,8 +772,7 @@ Here are some of the features Ombi has:
Michael DiStaula
- |
-
+
@@ -723,6 +780,13 @@ Here are some of the features Ombi has:
Dorian ALKOUM
|
+
+
+
+
+ Echel0n
+
+ |
@@ -730,6 +794,14 @@ Here are some of the features Ombi has:
M4tta
|
+
+
+
+
+ Maartenheebink
+
+ |
+
@@ -757,8 +829,7 @@ Here are some of the features Ombi has:
Mike
- |
-
+
diff --git a/crowdin.yml b/crowdin.yml
index b7f48ef88..170fc200d 100644
--- a/crowdin.yml
+++ b/crowdin.yml
@@ -1,10 +1,10 @@
-
commit_message: "fix(translations): 🌐 New translations from Crowdin [skip ci]"
append_commit_message: false
pull_request_title: "🌐 Translations Update"
pull_request_labels:
- translations
-
files:
- source: /src/Ombi/wwwroot/translations/en.json
translation: /src/Ombi/wwwroot/translations/%two_letters_code%.json
+ - source: /src/Ombi.I18n/Resources/Texts.resx
+ translation: /src/Ombi.I18n/Resources/Texts.%two_letters_code%.resx
diff --git a/makefile b/makefile
new file mode 100644
index 000000000..62c11e5b5
--- /dev/null
+++ b/makefile
@@ -0,0 +1,17 @@
+backend:
+ cd src/Ombi && dotnet watch run -- --host http://*:3577
+
+frontend:
+ cd src/Ombi/ClientApp && yarn start
+
+install-frontend:
+ cd src/Ombi/ClientApp && yarn
+
+install-frontend-tests:
+ cd tests && yarn
+
+frontend-tests:
+ cd tests && npx cypress run
+
+backend-tests:
+ cd src/Ombi.Core.Tests && dotnet test
\ No newline at end of file
diff --git a/src/.idea/.idea.Ombi/.idea/contentModel.xml b/src/.idea/.idea.Ombi/.idea/contentModel.xml
index 4affa7aee..438274536 100644
--- a/src/.idea/.idea.Ombi/.idea/contentModel.xml
+++ b/src/.idea/.idea.Ombi/.idea/contentModel.xml
@@ -929,7 +929,7 @@
-
+
@@ -1876,7 +1876,7 @@
-
+
diff --git a/src/Ombi.Api.CloudService/Ombi.Api.CloudService.csproj b/src/Ombi.Api.CloudService/Ombi.Api.CloudService.csproj
index 0701967d1..5939549de 100644
--- a/src/Ombi.Api.CloudService/Ombi.Api.CloudService.csproj
+++ b/src/Ombi.Api.CloudService/Ombi.Api.CloudService.csproj
@@ -1,7 +1,7 @@
- net5.0
+ net6.0
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.CouchPotato/Ombi.Api.CouchPotato.csproj b/src/Ombi.Api.CouchPotato/Ombi.Api.CouchPotato.csproj
index 320c51076..89c47d251 100644
--- a/src/Ombi.Api.CouchPotato/Ombi.Api.CouchPotato.csproj
+++ b/src/Ombi.Api.CouchPotato/Ombi.Api.CouchPotato.csproj
@@ -1,8 +1,8 @@
- net5.0
- 8.0
+ net6.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.Discord/Ombi.Api.Discord.csproj b/src/Ombi.Api.Discord/Ombi.Api.Discord.csproj
index 20c8a9aef..70032d638 100644
--- a/src/Ombi.Api.Discord/Ombi.Api.Discord.csproj
+++ b/src/Ombi.Api.Discord/Ombi.Api.Discord.csproj
@@ -1,12 +1,12 @@
- net5.0
+ net6.0
3.0.0.0
3.0.0.0
- 8.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.DogNzb/Ombi.Api.DogNzb.csproj b/src/Ombi.Api.DogNzb/Ombi.Api.DogNzb.csproj
index 320c51076..89c47d251 100644
--- a/src/Ombi.Api.DogNzb/Ombi.Api.DogNzb.csproj
+++ b/src/Ombi.Api.DogNzb/Ombi.Api.DogNzb.csproj
@@ -1,8 +1,8 @@
- net5.0
- 8.0
+ net6.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.Emby/EmbyApi.cs b/src/Ombi.Api.Emby/EmbyApi.cs
index c413ecded..e9e5f0fca 100644
--- a/src/Ombi.Api.Emby/EmbyApi.cs
+++ b/src/Ombi.Api.Emby/EmbyApi.cs
@@ -1,12 +1,8 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
+using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
-using Microsoft.EntityFrameworkCore.Internal;
using Newtonsoft.Json;
using Ombi.Api.Emby.Models;
-using Ombi.Api.Emby.Models.Media;
using Ombi.Api.Emby.Models.Media.Tv;
using Ombi.Api.Emby.Models.Movie;
using Ombi.Helpers;
@@ -110,7 +106,7 @@ namespace Ombi.Api.Emby
request.AddQueryString("Fields", "ProviderIds,Overview");
- request.AddQueryString("IsVirtualItem", "False");
+ request.AddQueryString("IsMissing", "False");
return await Api.Request>(request);
}
@@ -124,22 +120,36 @@ namespace Ombi.Api.Emby
return response;
}
-
public async Task> GetAllMovies(string apiKey, string parentIdFilder, int startIndex, int count, string userId, string baseUri)
{
return await GetAll("Movie", apiKey, userId, baseUri, true, startIndex, count, parentIdFilder);
}
+ public async Task> RecentlyAddedMovies(string apiKey, string parentIdFilder, int startIndex, int count, string userId, string baseUri)
+ {
+ return await RecentlyAdded("Movie", apiKey, userId, baseUri, true, startIndex, count, parentIdFilder);
+ }
+
public async Task> GetAllEpisodes(string apiKey, string parentIdFilder, int startIndex, int count, string userId, string baseUri)
{
return await GetAll("Episode", apiKey, userId, baseUri, false, startIndex, count, parentIdFilder);
}
+ public async Task> RecentlyAddedEpisodes(string apiKey, string parentIdFilder, int startIndex, int count, string userId, string baseUri)
+ {
+ return await RecentlyAdded("Episode", apiKey, userId, baseUri, false, startIndex, count, parentIdFilder);
+ }
+
public async Task> GetAllShows(string apiKey, string parentIdFilder, int startIndex, int count, string userId, string baseUri)
{
return await GetAll("Series", apiKey, userId, baseUri, false, startIndex, count, parentIdFilder);
}
+ public async Task> RecentlyAddedShows(string apiKey, string parentIdFilder, int startIndex, int count, string userId, string baseUri)
+ {
+ return await RecentlyAdded("Series", apiKey, userId, baseUri, false, startIndex, count, parentIdFilder);
+ }
+
public async Task GetSeriesInformation(string mediaId, string apiKey, string userId, string baseUrl)
{
return await GetInformation(mediaId, apiKey, userId, baseUrl);
@@ -154,6 +164,31 @@ namespace Ombi.Api.Emby
return await GetInformation(mediaId, apiKey, userId, baseUrl);
}
+ private async Task> RecentlyAdded(string type, string apiKey, string userId, string baseUri, bool includeOverview, int startIndex, int count, string parentIdFilder = default)
+ {
+ var request = new Request($"emby/users/{userId}/items", baseUri, HttpMethod.Get);
+
+ request.AddQueryString("Recursive", true.ToString());
+ request.AddQueryString("IncludeItemTypes", type);
+ request.AddQueryString("Fields", includeOverview ? "ProviderIds,MediaStreams,Overview" : "ProviderIds,MediaStreams ");
+ request.AddQueryString("startIndex", startIndex.ToString());
+ request.AddQueryString("limit", count.ToString());
+ request.AddQueryString("sortBy", "DateCreated");
+ request.AddQueryString("SortOrder", "Descending");
+ if (!string.IsNullOrEmpty(parentIdFilder))
+ {
+ request.AddQueryString("ParentId", parentIdFilder);
+ }
+
+ request.AddQueryString("IsMissing", "False");
+
+ AddHeaders(request, apiKey);
+
+
+ var obj = await Api.Request>(request);
+ return obj;
+ }
+
private async Task GetInformation(string mediaId, string apiKey, string userId, string baseUrl)
{
var request = new Request($"emby/users/{userId}/items/{mediaId}", baseUrl, HttpMethod.Get);
@@ -172,7 +207,7 @@ namespace Ombi.Api.Emby
request.AddQueryString("IncludeItemTypes", type);
request.AddQueryString("Fields", includeOverview ? "ProviderIds,Overview" : "ProviderIds");
- request.AddQueryString("IsVirtualItem", "False");
+ request.AddQueryString("IsMissing", "False");
AddHeaders(request, apiKey);
@@ -186,7 +221,7 @@ namespace Ombi.Api.Emby
request.AddQueryString("Recursive", true.ToString());
request.AddQueryString("IncludeItemTypes", type);
- request.AddQueryString("Fields", includeOverview ? "ProviderIds,Overview" : "ProviderIds");
+ request.AddQueryString("Fields", includeOverview ? "ProviderIds,Overview,MediaStreams" : "ProviderIds,MediaStreams");
request.AddQueryString("startIndex", startIndex.ToString());
request.AddQueryString("limit", count.ToString());
if (!string.IsNullOrEmpty(parentIdFilder))
@@ -194,7 +229,7 @@ namespace Ombi.Api.Emby
request.AddQueryString("ParentId", parentIdFilder);
}
- request.AddQueryString("IsVirtualItem", "False");
+ request.AddQueryString("isMissing", "False");
AddHeaders(request, apiKey);
diff --git a/src/Ombi.Api.Emby/IBaseEmbyApi.cs b/src/Ombi.Api.Emby/IBaseEmbyApi.cs
index 4de81073d..248c0a88f 100644
--- a/src/Ombi.Api.Emby/IBaseEmbyApi.cs
+++ b/src/Ombi.Api.Emby/IBaseEmbyApi.cs
@@ -29,5 +29,8 @@ namespace Ombi.Api.Emby
Task GetMovieInformation(string mediaId, string apiKey, string userId, string baseUrl);
Task GetEpisodeInformation(string mediaId, string apiKey, string userId, string baseUrl);
Task GetPublicInformation(string baseUrl);
+ Task> RecentlyAddedMovies(string apiKey, string parentIdFilder, int startIndex, int count, string userId, string baseUri);
+ Task> RecentlyAddedEpisodes(string apiKey, string parentIdFilder, int startIndex, int count, string userId, string baseUri);
+ Task> RecentlyAddedShows(string apiKey, string parentIdFilder, int startIndex, int count, string userId, string baseUri);
}
}
\ No newline at end of file
diff --git a/src/Ombi.Api.Emby/Models/EmbyMediaType.cs b/src/Ombi.Api.Emby/Models/EmbyMediaType.cs
deleted file mode 100644
index 7b33f8972..000000000
--- a/src/Ombi.Api.Emby/Models/EmbyMediaType.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace Ombi.Api.Emby.Models
-{
- public enum EmbyMediaType
- {
- Movie = 0,
- Series = 1,
- Music = 2,
- Episode = 3
- }
-}
\ No newline at end of file
diff --git a/src/Ombi.Api.Emby/Models/Media/EmbyMediastream.cs b/src/Ombi.Api.Emby/Models/Media/EmbyMediastream.cs
index 01032e0e7..f633f4ce0 100644
--- a/src/Ombi.Api.Emby/Models/Media/EmbyMediastream.cs
+++ b/src/Ombi.Api.Emby/Models/Media/EmbyMediastream.cs
@@ -2,35 +2,6 @@ namespace Ombi.Api.Emby.Models.Movie
{
public class EmbyMediastream
{
- public string Codec { get; set; }
- public string Language { get; set; }
- public string TimeBase { get; set; }
- public string CodecTimeBase { get; set; }
- public string NalLengthSize { get; set; }
- public bool IsInterlaced { get; set; }
- public bool IsAVC { get; set; }
- public int BitRate { get; set; }
- public int BitDepth { get; set; }
- public int RefFrames { get; set; }
- public bool IsDefault { get; set; }
- public bool IsForced { get; set; }
- public int Height { get; set; }
- public int Width { get; set; }
- public float AverageFrameRate { get; set; }
- public float RealFrameRate { get; set; }
- public string Profile { get; set; }
- public string Type { get; set; }
- public string AspectRatio { get; set; }
- public int Index { get; set; }
- public bool IsExternal { get; set; }
- public bool IsTextSubtitleStream { get; set; }
- public bool SupportsExternalStream { get; set; }
- public string PixelFormat { get; set; }
- public int Level { get; set; }
- public bool IsAnamorphic { get; set; }
public string DisplayTitle { get; set; }
- public string ChannelLayout { get; set; }
- public int Channels { get; set; }
- public int SampleRate { get; set; }
}
}
\ No newline at end of file
diff --git a/src/Ombi.Api.Emby/Models/Media/EmbyProviderids.cs b/src/Ombi.Api.Emby/Models/Media/EmbyProviderids.cs
index 8302ee3ee..4a19025de 100644
--- a/src/Ombi.Api.Emby/Models/Media/EmbyProviderids.cs
+++ b/src/Ombi.Api.Emby/Models/Media/EmbyProviderids.cs
@@ -1,12 +1,10 @@
-namespace Ombi.Api.Emby.Models.Movie
-{
- public class EmbyProviderids
- {
- public string Tmdb { get; set; }
- public string Imdb { get; set; }
- public string TmdbCollection { get; set; }
+using Ombi.Api.MediaServer.Models;
- public string Tvdb { get; set; }
+namespace Ombi.Api.Emby.Models.Movie
+{
+ public class EmbyProviderids: BaseProviderids
+ {
+ public string TmdbCollection { get; set; }
public string Zap2It { get; set; }
public string TvRage { get; set; }
}
diff --git a/src/Ombi.Api.Emby/Models/Media/Movie/EmbyMovie.cs b/src/Ombi.Api.Emby/Models/Media/Movie/EmbyMovie.cs
index a10ddaae6..e127f75f6 100644
--- a/src/Ombi.Api.Emby/Models/Media/Movie/EmbyMovie.cs
+++ b/src/Ombi.Api.Emby/Models/Media/Movie/EmbyMovie.cs
@@ -30,5 +30,6 @@ namespace Ombi.Api.Emby.Models.Movie
public int CriticRating { get; set; }
public string Overview { get; set; }
public EmbyProviderids ProviderIds { get; set; }
+ public EmbyMediastream[] MediaStreams { get; set; }
}
}
\ No newline at end of file
diff --git a/src/Ombi.Api.Emby/Ombi.Api.Emby.csproj b/src/Ombi.Api.Emby/Ombi.Api.Emby.csproj
index 3008c9230..f60971192 100644
--- a/src/Ombi.Api.Emby/Ombi.Api.Emby.csproj
+++ b/src/Ombi.Api.Emby/Ombi.Api.Emby.csproj
@@ -1,17 +1,18 @@
- net5.0
+ net6.0
3.0.0.0
3.0.0.0
- 8.0
+ latest
Debug;Release;NonUiBuild
+
diff --git a/src/Ombi.Api.FanartTv/Ombi.Api.FanartTv.csproj b/src/Ombi.Api.FanartTv/Ombi.Api.FanartTv.csproj
index 20c8a9aef..70032d638 100644
--- a/src/Ombi.Api.FanartTv/Ombi.Api.FanartTv.csproj
+++ b/src/Ombi.Api.FanartTv/Ombi.Api.FanartTv.csproj
@@ -1,12 +1,12 @@
- net5.0
+ net6.0
3.0.0.0
3.0.0.0
- 8.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.Github/Ombi.Api.Github.csproj b/src/Ombi.Api.Github/Ombi.Api.Github.csproj
index 320c51076..89c47d251 100644
--- a/src/Ombi.Api.Github/Ombi.Api.Github.csproj
+++ b/src/Ombi.Api.Github/Ombi.Api.Github.csproj
@@ -1,8 +1,8 @@
- net5.0
- 8.0
+ net6.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.Gotify/Ombi.Api.Gotify.csproj b/src/Ombi.Api.Gotify/Ombi.Api.Gotify.csproj
index 7065a1e65..be32916f8 100644
--- a/src/Ombi.Api.Gotify/Ombi.Api.Gotify.csproj
+++ b/src/Ombi.Api.Gotify/Ombi.Api.Gotify.csproj
@@ -1,12 +1,12 @@
- net5.0
+ net6.0
3.0.0.0
3.0.0.0
- 8.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.GroupMe/Ombi.Api.GroupMe.csproj b/src/Ombi.Api.GroupMe/Ombi.Api.GroupMe.csproj
index 320c51076..89c47d251 100644
--- a/src/Ombi.Api.GroupMe/Ombi.Api.GroupMe.csproj
+++ b/src/Ombi.Api.GroupMe/Ombi.Api.GroupMe.csproj
@@ -1,8 +1,8 @@
- net5.0
- 8.0
+ net6.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.Jellyfin/JellyfinApi.cs b/src/Ombi.Api.Jellyfin/JellyfinApi.cs
index 2fafbfd86..0604cb984 100644
--- a/src/Ombi.Api.Jellyfin/JellyfinApi.cs
+++ b/src/Ombi.Api.Jellyfin/JellyfinApi.cs
@@ -82,7 +82,7 @@ namespace Ombi.Api.Jellyfin
request.AddQueryString("Fields", "ProviderIds,Overview");
- request.AddQueryString("IsVirtualItem", "False");
+ request.AddQueryString("isMissing", "False");
return await Api.Request>(request);
}
@@ -143,7 +143,7 @@ namespace Ombi.Api.Jellyfin
request.AddQueryString("IncludeItemTypes", type);
request.AddQueryString("Fields", includeOverview ? "ProviderIds,Overview" : "ProviderIds");
- request.AddQueryString("IsVirtualItem", "False");
+ request.AddQueryString("isMissing", "False");
AddHeaders(request, apiKey);
@@ -157,7 +157,7 @@ namespace Ombi.Api.Jellyfin
request.AddQueryString("Recursive", true.ToString());
request.AddQueryString("IncludeItemTypes", type);
- request.AddQueryString("Fields", includeOverview ? "ProviderIds,Overview,ParentId" : "ProviderIds,ParentId");
+ request.AddQueryString("Fields", includeOverview ? "ProviderIds,MediaStreams Overview,ParentId" : "ProviderIds,ParentId,MediaStreams");
request.AddQueryString("startIndex", startIndex.ToString());
request.AddQueryString("limit", count.ToString());
if(!string.IsNullOrEmpty(parentIdFilder))
@@ -165,7 +165,7 @@ namespace Ombi.Api.Jellyfin
request.AddQueryString("ParentId", parentIdFilder);
}
- request.AddQueryString("IsVirtualItem", "False");
+ request.AddQueryString("isMissing", "False");
AddHeaders(request, apiKey);
diff --git a/src/Ombi.Api.Jellyfin/Models/JellyfinMediaType.cs b/src/Ombi.Api.Jellyfin/Models/JellyfinMediaType.cs
deleted file mode 100644
index 2c4f75be0..000000000
--- a/src/Ombi.Api.Jellyfin/Models/JellyfinMediaType.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace Ombi.Api.Jellyfin.Models
-{
- public enum JellyfinMediaType
- {
- Movie = 0,
- Series = 1,
- Music = 2,
- Episode = 3
- }
-}
\ No newline at end of file
diff --git a/src/Ombi.Api.Jellyfin/Models/Media/JellyfinMediastream.cs b/src/Ombi.Api.Jellyfin/Models/Media/JellyfinMediastream.cs
index 89da2651a..e15a21e7b 100644
--- a/src/Ombi.Api.Jellyfin/Models/Media/JellyfinMediastream.cs
+++ b/src/Ombi.Api.Jellyfin/Models/Media/JellyfinMediastream.cs
@@ -2,35 +2,6 @@ namespace Ombi.Api.Jellyfin.Models.Movie
{
public class JellyfinMediastream
{
- public string Codec { get; set; }
- public string Language { get; set; }
- public string TimeBase { get; set; }
- public string CodecTimeBase { get; set; }
- public string NalLengthSize { get; set; }
- public bool IsInterlaced { get; set; }
- public bool IsAVC { get; set; }
- public int BitRate { get; set; }
- public int BitDepth { get; set; }
- public int RefFrames { get; set; }
- public bool IsDefault { get; set; }
- public bool IsForced { get; set; }
- public int Height { get; set; }
- public int Width { get; set; }
- public float AverageFrameRate { get; set; }
- public float RealFrameRate { get; set; }
- public string Profile { get; set; }
- public string Type { get; set; }
- public string AspectRatio { get; set; }
- public int Index { get; set; }
- public bool IsExternal { get; set; }
- public bool IsTextSubtitleStream { get; set; }
- public bool SupportsExternalStream { get; set; }
- public string PixelFormat { get; set; }
- public int Level { get; set; }
- public bool IsAnamorphic { get; set; }
public string DisplayTitle { get; set; }
- public string ChannelLayout { get; set; }
- public int Channels { get; set; }
- public int SampleRate { get; set; }
}
}
\ No newline at end of file
diff --git a/src/Ombi.Api.Jellyfin/Models/Media/JellyfinProviderids.cs b/src/Ombi.Api.Jellyfin/Models/Media/JellyfinProviderids.cs
index 9b47f9a1a..0896ec4e9 100644
--- a/src/Ombi.Api.Jellyfin/Models/Media/JellyfinProviderids.cs
+++ b/src/Ombi.Api.Jellyfin/Models/Media/JellyfinProviderids.cs
@@ -1,12 +1,10 @@
-namespace Ombi.Api.Jellyfin.Models.Movie
-{
- public class JellyfinProviderids
- {
- public string Tmdb { get; set; }
- public string Imdb { get; set; }
- public string TmdbCollection { get; set; }
+using Ombi.Api.MediaServer.Models;
- public string Tvdb { get; set; }
+namespace Ombi.Api.Jellyfin.Models.Movie
+{
+ public class JellyfinProviderids: BaseProviderids
+ {
+ public string TmdbCollection { get; set; }
public string Zap2It { get; set; }
public string TvRage { get; set; }
}
diff --git a/src/Ombi.Api.Jellyfin/Models/Media/Movie/JellyfinMovie.cs b/src/Ombi.Api.Jellyfin/Models/Media/Movie/JellyfinMovie.cs
index d86bf5047..a83e1f087 100644
--- a/src/Ombi.Api.Jellyfin/Models/Media/Movie/JellyfinMovie.cs
+++ b/src/Ombi.Api.Jellyfin/Models/Media/Movie/JellyfinMovie.cs
@@ -30,5 +30,6 @@ namespace Ombi.Api.Jellyfin.Models.Movie
public int CriticRating { get; set; }
public string Overview { get; set; }
public JellyfinProviderids ProviderIds { get; set; }
+ public JellyfinMediastream[] MediaStreams { get; set; }
}
}
\ No newline at end of file
diff --git a/src/Ombi.Api.Jellyfin/Ombi.Api.Jellyfin.csproj b/src/Ombi.Api.Jellyfin/Ombi.Api.Jellyfin.csproj
index 3008c9230..0c745556e 100644
--- a/src/Ombi.Api.Jellyfin/Ombi.Api.Jellyfin.csproj
+++ b/src/Ombi.Api.Jellyfin/Ombi.Api.Jellyfin.csproj
@@ -1,18 +1,19 @@
- net5.0
+ net6.0
3.0.0.0
3.0.0.0
- 8.0
+ latest
Debug;Release;NonUiBuild
+
\ No newline at end of file
diff --git a/src/Ombi.Api.Lidarr/Ombi.Api.Lidarr.csproj b/src/Ombi.Api.Lidarr/Ombi.Api.Lidarr.csproj
index 320c51076..89c47d251 100644
--- a/src/Ombi.Api.Lidarr/Ombi.Api.Lidarr.csproj
+++ b/src/Ombi.Api.Lidarr/Ombi.Api.Lidarr.csproj
@@ -1,8 +1,8 @@
- net5.0
- 8.0
+ net6.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.Mattermost/Ombi.Api.Mattermost.csproj b/src/Ombi.Api.Mattermost/Ombi.Api.Mattermost.csproj
index 5742fd3a5..16c3a8558 100644
--- a/src/Ombi.Api.Mattermost/Ombi.Api.Mattermost.csproj
+++ b/src/Ombi.Api.Mattermost/Ombi.Api.Mattermost.csproj
@@ -1,12 +1,12 @@
- net5.0
+ net6.0
3.0.0.0
3.0.0.0
- 8.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.MediaServer/Models/BaseProviderids.cs b/src/Ombi.Api.MediaServer/Models/BaseProviderids.cs
new file mode 100644
index 000000000..6044288c6
--- /dev/null
+++ b/src/Ombi.Api.MediaServer/Models/BaseProviderids.cs
@@ -0,0 +1,11 @@
+namespace Ombi.Api.MediaServer.Models
+{
+ public class BaseProviderids
+ {
+ public string Tmdb { get; set; }
+ public string Imdb { get; set; }
+ public string Tvdb { get; set; }
+ public bool Any() =>
+ !string.IsNullOrEmpty(Imdb) || !string.IsNullOrEmpty(Tmdb) || !string.IsNullOrEmpty(Tvdb);
+ }
+}
\ No newline at end of file
diff --git a/src/Ombi.Api.MediaServer/Ombi.Api.MediaServer.csproj b/src/Ombi.Api.MediaServer/Ombi.Api.MediaServer.csproj
new file mode 100644
index 000000000..a1b98b765
--- /dev/null
+++ b/src/Ombi.Api.MediaServer/Ombi.Api.MediaServer.csproj
@@ -0,0 +1,18 @@
+
+
+
+ net6.0
+ 3.0.0.0
+ 3.0.0.0
+
+
+ latest
+ Debug;Release;NonUiBuild
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Ombi.Api.MusicBrainz/Ombi.Api.MusicBrainz.csproj b/src/Ombi.Api.MusicBrainz/Ombi.Api.MusicBrainz.csproj
index 65b4175d4..c8a78e491 100644
--- a/src/Ombi.Api.MusicBrainz/Ombi.Api.MusicBrainz.csproj
+++ b/src/Ombi.Api.MusicBrainz/Ombi.Api.MusicBrainz.csproj
@@ -1,8 +1,8 @@
- net5.0
- 8.0
+ net6.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.Notifications/Ombi.Api.Notifications.csproj b/src/Ombi.Api.Notifications/Ombi.Api.Notifications.csproj
index 312aa49f2..6406ef9de 100644
--- a/src/Ombi.Api.Notifications/Ombi.Api.Notifications.csproj
+++ b/src/Ombi.Api.Notifications/Ombi.Api.Notifications.csproj
@@ -1,8 +1,8 @@
- net5.0
- 8.0
+ net6.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.Plex/IPlexApi.cs b/src/Ombi.Api.Plex/IPlexApi.cs
index a4597765e..746c85b77 100644
--- a/src/Ombi.Api.Plex/IPlexApi.cs
+++ b/src/Ombi.Api.Plex/IPlexApi.cs
@@ -1,4 +1,5 @@
using System;
+using System.Threading;
using System.Threading.Tasks;
using Ombi.Api.Plex.Models;
using Ombi.Api.Plex.Models.Friends;
@@ -16,9 +17,9 @@ namespace Ombi.Api.Plex
Task GetServer(string authToken);
Task GetLibrarySections(string authToken, string plexFullHost);
Task GetLibrary(string authToken, string plexFullHost, string libraryId);
- Task GetEpisodeMetaData(string authToken, string host, int ratingKey);
- Task GetMetadata(string authToken, string plexFullHost, int itemId);
- Task GetSeasons(string authToken, string plexFullHost, int ratingKey);
+ Task GetEpisodeMetaData(string authToken, string host, string ratingKey);
+ Task GetMetadata(string authToken, string plexFullHost, string itemId);
+ Task GetSeasons(string authToken, string plexFullHost, string ratingKey);
Task GetAllEpisodes(string authToken, string host, string section, int start, int retCount);
Task GetUsers(string authToken);
Task GetAccount(string authToken);
@@ -26,5 +27,7 @@ namespace Ombi.Api.Plex
Task GetPin(int pinId);
Task GetOAuthUrl(string code, string applicationUrl);
Task AddUser(string emailAddress, string serverId, string authToken, int[] libs);
+ Task GetWatchlist(string plexToken, CancellationToken cancellationToken);
+ Task GetWatchlistMetadata(string ratingKey, string plexToken, CancellationToken cancellationToken);
}
}
\ No newline at end of file
diff --git a/src/Ombi.Api.Plex/Models/Metadata.cs b/src/Ombi.Api.Plex/Models/Metadata.cs
index d0bb227ad..97cab391b 100644
--- a/src/Ombi.Api.Plex/Models/Metadata.cs
+++ b/src/Ombi.Api.Plex/Models/Metadata.cs
@@ -1,10 +1,11 @@
using System.Collections.Generic;
+using Newtonsoft.Json;
namespace Ombi.Api.Plex.Models
{
public class Metadata
{
- public int ratingKey { get; set; }
+ public string ratingKey { get; set; }
public string key { get; set; }
public string studio { get; set; }
public string type { get; set; }
@@ -12,26 +13,18 @@ namespace Ombi.Api.Plex.Models
public string contentRating { get; set; }
public string summary { get; set; }
public int index { get; set; }
- public float rating { get; set; }
- //public int viewCount { get; set; }
- //public int lastViewedAt { get; set; }
public int year { get; set; }
public string thumb { get; set; }
public string art { get; set; }
public string banner { get; set; }
public string theme { get; set; }
- //public string duration { get; set; }
- //public string originallyAvailableAt { get; set; }
public int leafCount { get; set; }
public int viewedLeafCount { get; set; }
public int childCount { get; set; }
- //public long addedAt { get; set; }
- //public int updatedAt { get; set; }
public Genre[] Genre { get; set; }
- //public Role[] Role { get; set; }
public string primaryExtraKey { get; set; }
- public int parentRatingKey { get; set; }
- public int grandparentRatingKey { get; set; }
+ public string parentRatingKey { get; set; }
+ public string grandparentRatingKey { get; set; }
public string guid { get; set; }
public int librarySectionID { get; set; }
public string librarySectionKey { get; set; }
@@ -47,12 +40,10 @@ namespace Ombi.Api.Plex.Models
public string chapterSource { get; set; }
public Medium[] Media { get; set; }
public List Guid { get; set; } = new List();
- // public Director[] Director { get; set; }
- // public Writer[] Writer { get; set; }
}
public class PlexGuids
{
public string Id { get; set; }
}
-}
\ No newline at end of file
+}
diff --git a/src/Ombi.Api.Plex/Models/PlexWatchlist.cs b/src/Ombi.Api.Plex/Models/PlexWatchlist.cs
new file mode 100644
index 000000000..52ca82cf9
--- /dev/null
+++ b/src/Ombi.Api.Plex/Models/PlexWatchlist.cs
@@ -0,0 +1,14 @@
+using System.Collections.Generic;
+
+namespace Ombi.Api.Plex.Models
+{
+ public class PlexWatchlist
+ {
+ public string librarySectionID { get; set; }
+ public string librarySectionTitle { get; set; }
+ public int offset { get; set; }
+ public int totalSize { get; set; }
+ public int size { get; set; }
+ public List Metadata { get; set; } = new List();
+ }
+}
\ No newline at end of file
diff --git a/src/Ombi.Api.Plex/Models/PlexWatchlistContainer.cs b/src/Ombi.Api.Plex/Models/PlexWatchlistContainer.cs
new file mode 100644
index 000000000..b208c189f
--- /dev/null
+++ b/src/Ombi.Api.Plex/Models/PlexWatchlistContainer.cs
@@ -0,0 +1,9 @@
+using System.Collections.Generic;
+
+namespace Ombi.Api.Plex.Models
+{
+ public class PlexWatchlistContainer
+ {
+ public PlexWatchlist MediaContainer { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Ombi.Api.Plex/Models/PlexWatchlistMetadataContainer.cs b/src/Ombi.Api.Plex/Models/PlexWatchlistMetadataContainer.cs
new file mode 100644
index 000000000..b582ca4e1
--- /dev/null
+++ b/src/Ombi.Api.Plex/Models/PlexWatchlistMetadataContainer.cs
@@ -0,0 +1,31 @@
+using System.Collections.Generic;
+
+namespace Ombi.Api.Plex.Models
+{
+ public class PlexWatchlistMetadataContainer
+ {
+ public PlexWatchlistMetadata MediaContainer { get; set; }
+ }
+
+
+ public class PlexWatchlistMetadata
+ {
+ public int offset { get; set; }
+ public int totalSize { get; set; }
+ public string identifier { get; set; }
+ public int size { get; set; }
+ public WatchlistMetadata[] Metadata { get; set; }
+ }
+
+ public class WatchlistMetadata
+ {
+ public string guid { get; set; }
+ public string key { get; set; }
+ public string primaryExtraKey { get; set; }
+ public string ratingKey { get; set; }
+ public string type { get; set; }
+ public string slug { get; set; }
+ public string title { get; set; }
+ public List Guid { get; set; } = new List();
+ }
+}
\ No newline at end of file
diff --git a/src/Ombi.Api.Plex/Ombi.Api.Plex.csproj b/src/Ombi.Api.Plex/Ombi.Api.Plex.csproj
index 20c8a9aef..70032d638 100644
--- a/src/Ombi.Api.Plex/Ombi.Api.Plex.csproj
+++ b/src/Ombi.Api.Plex/Ombi.Api.Plex.csproj
@@ -1,12 +1,12 @@
- net5.0
+ net6.0
3.0.0.0
3.0.0.0
- 8.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.Plex/PlexApi.cs b/src/Ombi.Api.Plex/PlexApi.cs
index 176af31ec..9f91c540c 100644
--- a/src/Ombi.Api.Plex/PlexApi.cs
+++ b/src/Ombi.Api.Plex/PlexApi.cs
@@ -1,5 +1,6 @@
using System;
using System.Net.Http;
+using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Ombi.Api.Plex.Models;
@@ -66,6 +67,7 @@ namespace Ombi.Api.Plex
private const string FriendsUri = "https://plex.tv/pms/friends/all";
private const string GetAccountUri = "https://plex.tv/users/account.json";
private const string ServerUri = "https://plex.tv/pms/servers.xml";
+ private const string WatchlistUri = "https://metadata.provider.plex.tv/";
///
/// Sign into the Plex API
@@ -145,21 +147,21 @@ namespace Ombi.Api.Plex
///
///
///
- public async Task GetEpisodeMetaData(string authToken, string plexFullHost, int ratingKey)
+ public async Task GetEpisodeMetaData(string authToken, string plexFullHost, string ratingKey)
{
var request = new Request($"/library/metadata/{ratingKey}", plexFullHost, HttpMethod.Get);
await AddHeaders(request, authToken);
return await Api.Request(request);
}
- public async Task GetMetadata(string authToken, string plexFullHost, int itemId)
+ public async Task GetMetadata(string authToken, string plexFullHost, string itemId)
{
var request = new Request($"library/metadata/{itemId}", plexFullHost, HttpMethod.Get);
await AddHeaders(request, authToken);
return await Api.Request(request);
}
- public async Task GetSeasons(string authToken, string plexFullHost, int ratingKey)
+ public async Task GetSeasons(string authToken, string plexFullHost, string ratingKey)
{
var request = new Request($"library/metadata/{ratingKey}/children", plexFullHost, HttpMethod.Get);
await AddHeaders(request, authToken);
@@ -288,6 +290,26 @@ namespace Ombi.Api.Plex
}
}
+ public async Task GetWatchlist(string plexToken, CancellationToken cancellationToken)
+ {
+ var request = new Request("library/sections/watchlist/all", WatchlistUri, HttpMethod.Get);
+ await AddHeaders(request, plexToken);
+
+ var result = await Api.Request(request, cancellationToken);
+
+ return result;
+ }
+
+ public async Task GetWatchlistMetadata(string ratingKey, string plexToken, CancellationToken cancellationToken)
+ {
+ var request = new Request($"library/metadata/{ratingKey}", WatchlistUri, HttpMethod.Get);
+ await AddHeaders(request, plexToken);
+
+ var result = await Api.Request(request, cancellationToken);
+
+ return result;
+ }
+
///
/// Adds the required headers and also the authorization header
diff --git a/src/Ombi.Api.Pushbullet/Ombi.Api.Pushbullet.csproj b/src/Ombi.Api.Pushbullet/Ombi.Api.Pushbullet.csproj
index 20c8a9aef..70032d638 100644
--- a/src/Ombi.Api.Pushbullet/Ombi.Api.Pushbullet.csproj
+++ b/src/Ombi.Api.Pushbullet/Ombi.Api.Pushbullet.csproj
@@ -1,12 +1,12 @@
- net5.0
+ net6.0
3.0.0.0
3.0.0.0
- 8.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.Pushover/Ombi.Api.Pushover.csproj b/src/Ombi.Api.Pushover/Ombi.Api.Pushover.csproj
index 7065a1e65..be32916f8 100644
--- a/src/Ombi.Api.Pushover/Ombi.Api.Pushover.csproj
+++ b/src/Ombi.Api.Pushover/Ombi.Api.Pushover.csproj
@@ -1,12 +1,12 @@
- net5.0
+ net6.0
3.0.0.0
3.0.0.0
- 8.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.Radarr/Models/V2/MovieResponse.cs b/src/Ombi.Api.Radarr/Models/V2/MovieResponse.cs
index 6eb2f1c5a..f40dfcd80 100644
--- a/src/Ombi.Api.Radarr/Models/V2/MovieResponse.cs
+++ b/src/Ombi.Api.Radarr/Models/V2/MovieResponse.cs
@@ -44,7 +44,10 @@ namespace Ombi.Api.Radarr.Models
public int id { get; set; }
}
-
+ public class MovieQuality
+ {
+ public V3.Quality quality { get; set; }
+ }
public class Moviefile
{
public int movieId { get; set; }
@@ -54,7 +57,7 @@ namespace Ombi.Api.Radarr.Models
public DateTime dateAdded { get; set; }
public string sceneName { get; set; }
public int indexerFlags { get; set; }
- public V3.Quality quality { get; set; }
+ public MovieQuality quality { get; set; }
public Mediainfo mediaInfo { get; set; }
public string originalFilePath { get; set; }
public bool qualityCutoffNotMet { get; set; }
@@ -74,13 +77,10 @@ namespace Ombi.Api.Radarr.Models
public class Mediainfo
{
public string audioAdditionalFeatures { get; set; }
- public int audioBitrate { get; set; }
public float audioChannels { get; set; }
public string audioCodec { get; set; }
public string audioLanguages { get; set; }
public int audioStreamCount { get; set; }
- public int videoBitDepth { get; set; }
- public int videoBitrate { get; set; }
public string videoCodec { get; set; }
public float videoFps { get; set; }
public string resolution { get; set; }
@@ -119,4 +119,4 @@ namespace Ombi.Api.Radarr.Models
public int id { get; set; }
public string name { get; set; }
}
-}
\ No newline at end of file
+}
diff --git a/src/Ombi.Api.Radarr/Models/V3/RadarrV3QualityProfile.cs b/src/Ombi.Api.Radarr/Models/V3/RadarrV3QualityProfile.cs
index d985da358..6eca4af87 100644
--- a/src/Ombi.Api.Radarr/Models/V3/RadarrV3QualityProfile.cs
+++ b/src/Ombi.Api.Radarr/Models/V3/RadarrV3QualityProfile.cs
@@ -25,5 +25,4 @@
public int resolution { get; set; }
public string modifier { get; set; }
}
-
}
diff --git a/src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj b/src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj
index c8ace891e..889aa0ea6 100644
--- a/src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj
+++ b/src/Ombi.Api.Radarr/Ombi.Api.Radarr.csproj
@@ -1,17 +1,17 @@
- net5.0
+ net6.0
3.0.0.0
3.0.0.0
- 8.0
+ latest
Debug;Release;NonUiBuild
-
+
diff --git a/src/Ombi.Api.RottenTomatoes/Ombi.Api.RottenTomatoes.csproj b/src/Ombi.Api.RottenTomatoes/Ombi.Api.RottenTomatoes.csproj
index 795629ea6..89c47d251 100644
--- a/src/Ombi.Api.RottenTomatoes/Ombi.Api.RottenTomatoes.csproj
+++ b/src/Ombi.Api.RottenTomatoes/Ombi.Api.RottenTomatoes.csproj
@@ -1,8 +1,8 @@
-
+
- net5.0
- 8.0
+ net6.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.Service/Ombi.Api.Service.csproj b/src/Ombi.Api.Service/Ombi.Api.Service.csproj
index 0b83f88e0..38bcd678a 100644
--- a/src/Ombi.Api.Service/Ombi.Api.Service.csproj
+++ b/src/Ombi.Api.Service/Ombi.Api.Service.csproj
@@ -1,19 +1,19 @@
- net5.0
+ net6.0
3.0.0.0
3.0.0.0
Ombi.Api.Service
Ombi.Api.Service
- 8.0
+ latest
Debug;Release;NonUiBuild
-
+
diff --git a/src/Ombi.Api.SickRage/Models/SickRageEpisodeStatus.cs b/src/Ombi.Api.SickRage/Models/SickRageEpisodeStatus.cs
index 4f131d5e3..9142e2b42 100644
--- a/src/Ombi.Api.SickRage/Models/SickRageEpisodeStatus.cs
+++ b/src/Ombi.Api.SickRage/Models/SickRageEpisodeStatus.cs
@@ -9,7 +9,7 @@
public class SickRageEpisodeSetStatus
{
- public Data data { get; set; }
+ public Data[] data { get; set; }
public string message { get; set; }
public string result { get; set; }
}
diff --git a/src/Ombi.Api.SickRage/Ombi.Api.SickRage.csproj b/src/Ombi.Api.SickRage/Ombi.Api.SickRage.csproj
index 320c51076..89c47d251 100644
--- a/src/Ombi.Api.SickRage/Ombi.Api.SickRage.csproj
+++ b/src/Ombi.Api.SickRage/Ombi.Api.SickRage.csproj
@@ -1,8 +1,8 @@
- net5.0
- 8.0
+ net6.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.Slack/Ombi.Api.Slack.csproj b/src/Ombi.Api.Slack/Ombi.Api.Slack.csproj
index 20c8a9aef..70032d638 100644
--- a/src/Ombi.Api.Slack/Ombi.Api.Slack.csproj
+++ b/src/Ombi.Api.Slack/Ombi.Api.Slack.csproj
@@ -1,12 +1,12 @@
- net5.0
+ net6.0
3.0.0.0
3.0.0.0
- 8.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.Sonarr/Ombi.Api.Sonarr.csproj b/src/Ombi.Api.Sonarr/Ombi.Api.Sonarr.csproj
index 20c8a9aef..70032d638 100644
--- a/src/Ombi.Api.Sonarr/Ombi.Api.Sonarr.csproj
+++ b/src/Ombi.Api.Sonarr/Ombi.Api.Sonarr.csproj
@@ -1,12 +1,12 @@
- net5.0
+ net6.0
3.0.0.0
3.0.0.0
- 8.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.Sonarr/SonarrApi.cs b/src/Ombi.Api.Sonarr/SonarrApi.cs
index d2df50cd9..50e4f04ff 100644
--- a/src/Ombi.Api.Sonarr/SonarrApi.cs
+++ b/src/Ombi.Api.Sonarr/SonarrApi.cs
@@ -19,7 +19,7 @@ namespace Ombi.Api.Sonarr
protected IApi Api { get; }
protected virtual string ApiBaseUrl => "/api/";
- public async Task> GetProfiles(string apiKey, string baseUrl)
+ public virtual async Task> GetProfiles(string apiKey, string baseUrl)
{
var request = new Request($"{ApiBaseUrl}profile", baseUrl, HttpMethod.Get);
request.AddHeader("X-Api-Key", apiKey);
diff --git a/src/Ombi.Api.Sonarr/SonarrV3Api.cs b/src/Ombi.Api.Sonarr/SonarrV3Api.cs
index 64377ee4a..71c230f35 100644
--- a/src/Ombi.Api.Sonarr/SonarrV3Api.cs
+++ b/src/Ombi.Api.Sonarr/SonarrV3Api.cs
@@ -1,6 +1,8 @@
using System.Net.Http;
using System.Collections.Generic;
using System.Threading.Tasks;
+
+using Ombi.Api.Sonarr.Models;
using Ombi.Api.Sonarr.Models.V3;
namespace Ombi.Api.Sonarr
@@ -21,5 +23,12 @@ namespace Ombi.Api.Sonarr
return await Api.Request>(request);
}
+
+ public override async Task> GetProfiles(string apiKey, string baseUrl)
+ {
+ var request = new Request($"{ApiBaseUrl}qualityprofile", baseUrl, HttpMethod.Get);
+ request.AddHeader("X-Api-Key", apiKey);
+ return await Api.Request>(request);
+ }
}
}
diff --git a/src/Ombi.Api.Telegram/Ombi.Api.Telegram.csproj b/src/Ombi.Api.Telegram/Ombi.Api.Telegram.csproj
index 320c51076..89c47d251 100644
--- a/src/Ombi.Api.Telegram/Ombi.Api.Telegram.csproj
+++ b/src/Ombi.Api.Telegram/Ombi.Api.Telegram.csproj
@@ -1,8 +1,8 @@
- net5.0
- 8.0
+ net6.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.Trakt/Ombi.Api.Trakt.csproj b/src/Ombi.Api.Trakt/Ombi.Api.Trakt.csproj
index f499f594e..fd9632e56 100644
--- a/src/Ombi.Api.Trakt/Ombi.Api.Trakt.csproj
+++ b/src/Ombi.Api.Trakt/Ombi.Api.Trakt.csproj
@@ -1,12 +1,12 @@
- net5.0
+ net6.0
3.0.0.0
3.0.0.0
- 8.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.TvMaze/ITvMazeApi.cs b/src/Ombi.Api.TvMaze/ITvMazeApi.cs
index 819051d83..983858810 100644
--- a/src/Ombi.Api.TvMaze/ITvMazeApi.cs
+++ b/src/Ombi.Api.TvMaze/ITvMazeApi.cs
@@ -8,10 +8,8 @@ namespace Ombi.Api.TvMaze
public interface ITvMazeApi
{
Task> EpisodeLookup(int showId);
- Task> GetSeasons(int id);
Task> Search(string searchTerm);
Task ShowLookup(int showId);
Task ShowLookupByTheTvDbId(int theTvDbId);
- Task GetTvFullInformation(int id);
}
}
\ No newline at end of file
diff --git a/src/Ombi.Api.TvMaze/Ombi.Api.TvMaze.csproj b/src/Ombi.Api.TvMaze/Ombi.Api.TvMaze.csproj
index 3008c9230..a1b98b765 100644
--- a/src/Ombi.Api.TvMaze/Ombi.Api.TvMaze.csproj
+++ b/src/Ombi.Api.TvMaze/Ombi.Api.TvMaze.csproj
@@ -1,12 +1,12 @@
- net5.0
+ net6.0
3.0.0.0
3.0.0.0
- 8.0
+ latest
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.TvMaze/TvMazeApi.cs b/src/Ombi.Api.TvMaze/TvMazeApi.cs
index 5d761da47..3f37d7488 100644
--- a/src/Ombi.Api.TvMaze/TvMazeApi.cs
+++ b/src/Ombi.Api.TvMaze/TvMazeApi.cs
@@ -64,27 +64,5 @@ namespace Ombi.Api.TvMaze
return null;
}
}
-
- public async Task> GetSeasons(int id)
- {
- var request = new Request($"shows/{id}/seasons", Uri, HttpMethod.Get);
-
- request.AddContentHeader("Content-Type", "application/json");
-
- return await Api.Request>(request);
- }
-
- public async Task GetTvFullInformation(int id)
- {
- var request = new Request($"shows/{id}", Uri, HttpMethod.Get);
-
- request.AddQueryString("embed[]", "cast");
- request.AddQueryString("embed[]", "crew");
- request.AddQueryString("embed[]", "episodes");
-
- request.AddContentHeader("Content-Type", "application/json");
-
- return await Api.Request(request);
- }
}
}
diff --git a/src/Ombi.Api.Twilio/Ombi.Api.Twilio.csproj b/src/Ombi.Api.Twilio/Ombi.Api.Twilio.csproj
index a5bb9ea19..8e12c7c67 100644
--- a/src/Ombi.Api.Twilio/Ombi.Api.Twilio.csproj
+++ b/src/Ombi.Api.Twilio/Ombi.Api.Twilio.csproj
@@ -1,7 +1,7 @@
- net5.0
+ net6.0
Debug;Release;NonUiBuild
diff --git a/src/Ombi.Api.Webhook/Ombi.Api.Webhook.csproj b/src/Ombi.Api.Webhook/Ombi.Api.Webhook.csproj
index 109e3e3f1..7748aad45 100644
--- a/src/Ombi.Api.Webhook/Ombi.Api.Webhook.csproj
+++ b/src/Ombi.Api.Webhook/Ombi.Api.Webhook.csproj
@@ -1,7 +1,7 @@
- net5.0
+ net6.0
3.0.0.0
3.0.0.0
diff --git a/src/Ombi.Api/ApiHelper.cs b/src/Ombi.Api/ApiHelper.cs
index fa9d3e7ab..f88525869 100644
--- a/src/Ombi.Api/ApiHelper.cs
+++ b/src/Ombi.Api/ApiHelper.cs
@@ -66,6 +66,8 @@ namespace Ombi.Api
startingTag = builder.Query.Contains("?") ? "&" : "?";
}
+ value = Uri.EscapeDataString(value);
+
builder.Query = hasQuery
? $"{builder.Query}{startingTag}{parameter}={value}"
: $"{startingTag}{parameter}={value}";
diff --git a/src/Ombi.Api/Ombi.Api.csproj b/src/Ombi.Api/Ombi.Api.csproj
index 02969e665..7670d4d14 100644
--- a/src/Ombi.Api/Ombi.Api.csproj
+++ b/src/Ombi.Api/Ombi.Api.csproj
@@ -1,18 +1,18 @@
- net5.0
+ net6.0
3.0.0.0
3.0.0.0
- 8.0
+ latest
Debug;Release;NonUiBuild
-
-
+
+
diff --git a/src/Ombi.Core.Tests/Engine/CalendarEngineTests.cs b/src/Ombi.Core.Tests/Engine/CalendarEngineTests.cs
index b922a21c0..0a85fd058 100644
--- a/src/Ombi.Core.Tests/Engine/CalendarEngineTests.cs
+++ b/src/Ombi.Core.Tests/Engine/CalendarEngineTests.cs
@@ -10,6 +10,7 @@ using Ombi.Core.Authentication;
using Ombi.Core.Engine.V2;
using Ombi.Store.Entities.Requests;
using Ombi.Store.Repository.Requests;
+using Ombi.Core.Helpers;
namespace Ombi.Core.Tests.Engine
{
@@ -25,7 +26,7 @@ namespace Ombi.Core.Tests.Engine
{
MovieRepo = new Mock();
TvRepo = new Mock();
- var principle = new Mock();
+ var principle = new Mock();
var identity = new Mock();
identity.Setup(x => x.Name).Returns("UnitTest");
principle.Setup(x => x.Identity).Returns(identity.Object);
diff --git a/src/Ombi.Core.Tests/Engine/MovieRequestEngineTests.cs b/src/Ombi.Core.Tests/Engine/MovieRequestEngineTests.cs
index 9b12e0b01..f8ced161f 100644
--- a/src/Ombi.Core.Tests/Engine/MovieRequestEngineTests.cs
+++ b/src/Ombi.Core.Tests/Engine/MovieRequestEngineTests.cs
@@ -1,135 +1,520 @@
-//using System.Collections.Generic;
-//using System.Linq;
-//using System.Threading.Tasks;
-//using Moq;
-//using NUnit.Framework;
-//using Ombi.Core.Engine;
-//using Ombi.Core.Models.Requests;
-//using Ombi.Store.Entities.Requests;
-//using Ombi.Store.Repository;
-//using Assert = Xunit.Assert;
+using MockQueryable.Moq;
+using Moq;
+using Moq.AutoMock;
+using NUnit.Framework;
+using Ombi.Core.Authentication;
+using Ombi.Core.Engine;
+using Ombi.Core.Helpers;
+using Ombi.Core.Models.Requests;
+using Ombi.Store.Entities;
+using Ombi.Store.Entities.Requests;
+using Ombi.Store.Repository;
+using Ombi.Store.Repository.Requests;
+using Ombi.Test.Common;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security.Principal;
+using System.Threading.Tasks;
-//namespace Ombi.Core.Tests.Engine
-//{
-// [TestFixture]
-// public class MovieRequestEngineTests
-// {
-// public MovieRequestEngineTests()
-// {
-// RequestService = new Mock();
-// var requestService = new RequestService(null, RequestService.Object);
-// Engine = new MovieRequestEngine(null, requestService, null, null, null, null, null, null);
-// }
+namespace Ombi.Core.Tests.Engine
+{
+ [TestFixture]
+ public class MovieRequestEngineTests
+ {
+ private MovieRequestEngine _subject;
+ private Mock _repoMock;
+ private AutoMocker _mocker;
-// private MovieRequestEngine Engine { get; }
-// private Mock RequestService { get; }
+ [SetUp]
+ public void Setup()
+ {
+ _mocker = new AutoMocker();
+ var userManager = MockHelper.MockUserManager(new List { new OmbiUser { NormalizedUserName = "TEST", Id = "a" } });
+ userManager.Setup(x => x.IsInRoleAsync(It.IsAny(), It.IsAny())).ReturnsAsync(true);
+ var principle = new Mock();
+ var identity = new Mock();
+ identity.Setup(x => x.Name).Returns("Test");
+ principle.Setup(x => x.Identity).Returns(identity.Object);
+ var currentUser = new Mock();
+ currentUser.Setup(x => x.Identity).Returns(identity.Object);
+ currentUser.Setup(x => x.Username).Returns("Test");
+ currentUser.Setup(x => x.GetUser()).ReturnsAsync(new OmbiUser { NormalizedUserName = "TEST", Id = "a" });
-// [Test]
-// public async Task GetNewRequests_Should_ReturnEmpty_WhenThereAreNoNewRequests()
-// {
-// var requests = new List
-// {
-// new MovieRequests { Available = true },
-// new MovieRequests { Approved = true },
-// };
+ _repoMock = new Mock();
+ var requestServiceMock = new Mock();
+ requestServiceMock.Setup(x => x.MovieRequestService).Returns(_repoMock.Object);
-// var r = DbHelper.GetQueryable(requests[0], requests[1]);
-// RequestService.Setup(x => x.Get()).Returns(r);
+ _mocker.Use(principle.Object);
+ _mocker.Use(currentUser.Object);
+ _mocker.Use(userManager.Object);
+ _mocker.Use(requestServiceMock);
-// var result = await Engine.GetNewRequests();
+ _subject = _mocker.CreateInstance();
+ var list = DbHelper.GetQueryableMockDbSet(new RequestSubscription());
+ _mocker.Setup, IQueryable>(x => x.GetAll()).Returns(new List().AsQueryable().BuildMock().Object);
+ }
-// Assert.False(result.Any());
-// }
+ [Test]
+ public async Task GetRequestByStatus_PendingRequests_Non4K()
+ {
+ var movies = RegularRequestData();
+ _repoMock.Setup(x => x.GetWithUser()).Returns(movies.AsQueryable());
-// [Test]
-// public async Task GetNewRequests_Should_ReturnOnlyNewRequests_WhenThereAreMultipleRequests()
-// {
-// var requests = new List
-// {
-// new MovieRequests { Available = true },
-// new MovieRequests { Approved = true },
-// new MovieRequests(),
-// };
-// RequestService.Setup(x => x.Get()).Returns(requests.AsQueryable);
+ var result = await _subject.GetRequestsByStatus(10, 0, "id", "asc", Models.Requests.RequestStatus.PendingApproval);
-// var result = await Engine.GetNewRequests();
+ Assert.That(result.Total, Is.EqualTo(1));
+ Assert.That(result.Collection.First().Id, Is.EqualTo(4));
+ }
-// Assert.Single(result);
-// Assert.All(result, x =>
-// {
-// Assert.False(x.Available);
-// Assert.False(x.Approved);
-// });
-// }
+ [Test]
+ public async Task GetRequestByStatus_PendingRequests_4K()
+ {
+ var movies = new List
+ {
+ new MovieRequests
+ {
+ Id= 1,
+ Approved4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 2,
+ Approved4K = false,
+ Available4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 3,
+ Denied4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 4,
+ Has4KRequest = true,
+ Approved4K = false,
+ Available4K = false,
+ Denied4K = false,
+ RequestedDate = DateTime.MinValue
+ }
+ };
+ _repoMock.Setup(x => x.GetWithUser()).Returns(movies.AsQueryable());
-// [Test]
-// public async Task GetApprovedRequests_Should_ReturnEmpty_WhenThereAreNoApprovedRequests()
-// {
-// var requests = new List
-// {
-// new MovieRequests { Available = true },
-// };
-// RequestService.Setup(x => x.Get()).Returns(requests.AsQueryable);
+ var result = await _subject.GetRequestsByStatus(10, 0, "id", "asc", RequestStatus.PendingApproval);
-// var result = await Engine.GetApprovedRequests();
+ Assert.That(result.Total, Is.EqualTo(1));
+ Assert.That(result.Collection.First().Id, Is.EqualTo(4));
+ }
-// Assert.False(result.Any());
-// }
-// [Test]
-// public async Task GetApprovedRequests_Should_ReturnOnlyApprovedRequests_WhenThereAreMultipleRequests()
-// {
-// var requests = new List
-// {
-// new MovieRequests { Available = true },
-// new MovieRequests { Approved = true },
-// new MovieRequests(),
-// };
-// RequestService.Setup(x => x.Get()).Returns(requests.AsQueryable);
+ [Test]
+ public async Task GetRequestByStatus_PendingRequests_Both4K_And_Regular()
+ {
+ var movies = new List
+ {
+ new MovieRequests
+ {
+ Id= 1,
+ Approved = false,
+ Approved4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.Now
+ },
+ new MovieRequests
+ {
+ Id = 2,
+ Approved4K = false,
+ Available4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 3,
+ Denied4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 4,
+ Has4KRequest = true,
+ Approved4K = false,
+ Available4K = false,
+ Denied4K = false,
+ RequestedDate = DateTime.MinValue
+ }
+ };
+ _repoMock.Setup(x => x.GetWithUser()).Returns(movies.AsQueryable());
-// var result = await Engine.GetApprovedRequests();
+ var result = await _subject.GetRequestsByStatus(10, 0, "id", "asc", RequestStatus.PendingApproval);
-// Assert.Single(result);
-// Assert.All(result, x =>
-// {
-// Assert.False(x.Available);
-// Assert.True(x.Approved);
-// });
-// }
+ Assert.That(result.Total, Is.EqualTo(2));
+ Assert.That(result.Collection.First().Id, Is.EqualTo(1));
+ Assert.That(result.Collection.ToArray()[1].Id, Is.EqualTo(4));
+ }
-// [Test]
-// public async Task GetAvailableRequests_Should_ReturnEmpty_WhenThereAreNoAvailableRequests()
-// {
-// var requests = new List
-// {
-// new MovieRequests { Approved = true },
-// };
-// RequestService.Setup(x => x.Get()).Returns(requests.AsQueryable);
-// var result = await Engine.GetAvailableRequests();
+ [Test]
+ public async Task GetRequestByStatus_ProcessingRequests_Non4K()
+ {
+ var movies = RegularRequestData();
+ _repoMock.Setup(x => x.GetWithUser()).Returns(movies.AsQueryable());
-// Assert.False(result.Any());
-// }
+ var result = await _subject.GetRequestsByStatus(10, 0, "id", "asc", Models.Requests.RequestStatus.ProcessingRequest);
-// [Test]
-// public async Task GetAvailableRequests_Should_ReturnOnlyAvailableRequests_WhenThereAreMultipleRequests()
-// {
-// var requests = new List
-// {
-// new MovieRequests { Available = true },
-// new MovieRequests { Approved = true },
-// new MovieRequests(),
-// };
-// RequestService.Setup(x => x.Get()).Returns(requests.AsQueryable);
+ Assert.That(result.Total, Is.EqualTo(1));
+ Assert.That(result.Collection.First().Id, Is.EqualTo(1));
+ }
-// var result = await Engine.GetAvailableRequests();
+ [Test]
+ public async Task GetRequestByStatus_ProcessingRequests_4K()
+ {
+ var movies = new List
+ {
+ new MovieRequests
+ {
+ Id= 1,
+ Approved4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 2,
+ Approved4K = false,
+ Available4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 3,
+ Denied4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 4,
+ Has4KRequest = true,
+ Approved4K = false,
+ Available4K = false,
+ Denied4K = false,
+ RequestedDate = DateTime.MinValue
+ }
+ };
+ _repoMock.Setup(x => x.GetWithUser()).Returns(movies.AsQueryable());
-// Assert.Single(result);
-// Assert.All(result, x =>
-// {
-// Assert.True(x.Available);
-// Assert.False(x.Approved);
-// });
-// }
-// }
-//}
\ No newline at end of file
+ var result = await _subject.GetRequestsByStatus(10, 0, "id", "asc", RequestStatus.ProcessingRequest);
+
+ Assert.That(result.Total, Is.EqualTo(1));
+ Assert.That(result.Collection.First().Id, Is.EqualTo(1));
+ }
+
+
+ [Test]
+ public async Task GetRequestByStatus_ProcessingRequests_Both4K_And_Regular()
+ {
+ var movies = new List
+ {
+ new MovieRequests
+ {
+ Id= 1,
+ Approved = false,
+ Approved4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.Now
+ },
+ new MovieRequests
+ {
+ Id = 2,
+ Approved4K = false,
+ Available4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 3,
+ Denied4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 4,
+ Has4KRequest = true,
+ Approved4K = false,
+ Approved = true,
+ Available4K = false,
+ Denied4K = false,
+ RequestedDate = DateTime.Now
+ }
+ };
+ _repoMock.Setup(x => x.GetWithUser()).Returns(movies.AsQueryable());
+
+ var result = await _subject.GetRequestsByStatus(10, 0, "id", "asc", RequestStatus.ProcessingRequest);
+
+ Assert.That(result.Total, Is.EqualTo(2));
+ Assert.That(result.Collection.First().Id, Is.EqualTo(1));
+ Assert.That(result.Collection.ToArray()[1].Id, Is.EqualTo(4));
+ }
+
+
+ [Test]
+ public async Task GetRequestByStatus_AvailableRequests_Non4K()
+ {
+ List movies = RegularRequestData();
+ _repoMock.Setup(x => x.GetWithUser()).Returns(movies.AsQueryable());
+
+ var result = await _subject.GetRequestsByStatus(10, 0, "id", "asc", Models.Requests.RequestStatus.Available);
+
+ Assert.That(result.Total, Is.EqualTo(1));
+ Assert.That(result.Collection.First().Id, Is.EqualTo(2));
+ }
+
+
+
+ [Test]
+ public async Task GetRequestByStatus_AvailableRequests_4K()
+ {
+ var movies = new List
+ {
+ new MovieRequests
+ {
+ Id= 1,
+ Approved4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 2,
+ Approved4K = false,
+ Available4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 3,
+ Denied4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 4,
+ Has4KRequest = true,
+ Approved4K = false,
+ Available4K = false,
+ Denied4K = false,
+ RequestedDate = DateTime.MinValue
+ }
+ };
+ _repoMock.Setup(x => x.GetWithUser()).Returns(movies.AsQueryable());
+
+ var result = await _subject.GetRequestsByStatus(10, 0, "id", "asc", RequestStatus.Available);
+
+ Assert.That(result.Total, Is.EqualTo(1));
+ Assert.That(result.Collection.First().Id, Is.EqualTo(2));
+ }
+
+
+ [Test]
+ public async Task GetRequestByStatus_AvailableRequests_Both4K_And_Regular()
+ {
+ var movies = new List
+ {
+ new MovieRequests
+ {
+ Id= 1,
+ Available = true,
+ Approved = false,
+ Approved4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.Now
+ },
+ new MovieRequests
+ {
+ Id = 2,
+ Approved4K = false,
+ Available4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 3,
+ Denied4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 4,
+ Has4KRequest = true,
+ Approved4K = false,
+ Approved = true,
+ Available4K = false,
+ Denied4K = false,
+ RequestedDate = DateTime.Now
+ }
+ };
+ _repoMock.Setup(x => x.GetWithUser()).Returns(movies.AsQueryable());
+
+ var result = await _subject.GetRequestsByStatus(10, 0, "id", "asc", RequestStatus.Available);
+
+ Assert.That(result.Total, Is.EqualTo(2));
+ Assert.That(result.Collection.First().Id, Is.EqualTo(1));
+ Assert.That(result.Collection.ToArray()[1].Id, Is.EqualTo(2));
+ }
+
+ [Test]
+ public async Task GetRequestByStatus_DeniedRequests_Non4K()
+ {
+ List movies = RegularRequestData();
+ _repoMock.Setup(x => x.GetWithUser()).Returns(movies.AsQueryable());
+
+ var result = await _subject.GetRequestsByStatus(10, 0, "id", "asc", Models.Requests.RequestStatus.Denied);
+
+ Assert.That(result.Total, Is.EqualTo(1));
+ Assert.That(result.Collection.First().Id, Is.EqualTo(3));
+ }
+
+ [Test]
+ public async Task GetRequestByStatus_DeniedRequests_4K()
+ {
+ var movies = new List
+ {
+ new MovieRequests
+ {
+ Id= 1,
+ Approved4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 2,
+ Approved4K = false,
+ Available4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 3,
+ Denied4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 4,
+ Has4KRequest = true,
+ Approved4K = false,
+ Available4K = false,
+ Denied4K = false,
+ RequestedDate = DateTime.MinValue
+ }
+ };
+ _repoMock.Setup(x => x.GetWithUser()).Returns(movies.AsQueryable());
+
+ var result = await _subject.GetRequestsByStatus(10, 0, "id", "asc", RequestStatus.Denied);
+
+ Assert.That(result.Total, Is.EqualTo(1));
+ Assert.That(result.Collection.First().Id, Is.EqualTo(3));
+ }
+
+
+ [Test]
+ public async Task GetRequestByStatus_DeniedRequests_Both4K_And_Regular()
+ {
+ var movies = new List
+ {
+ new MovieRequests
+ {
+ Id= 1,
+ Available = true,
+ Approved = false,
+ Approved4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.Now
+ },
+ new MovieRequests
+ {
+ Id = 2,
+ Approved4K = false,
+ Available4K = true,
+ Denied = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 3,
+ Denied4K = true,
+ Has4KRequest = true,
+ RequestedDate = DateTime.MinValue
+ },
+ new MovieRequests
+ {
+ Id = 4,
+ Has4KRequest = true,
+ Approved4K = false,
+ Approved = true,
+ Available4K = false,
+ Denied4K = false,
+ RequestedDate = DateTime.Now
+ }
+ };
+ _repoMock.Setup(x => x.GetWithUser()).Returns(movies.AsQueryable());
+
+ var result = await _subject.GetRequestsByStatus(10, 0, "id", "asc", RequestStatus.Denied);
+
+ Assert.That(result.Total, Is.EqualTo(2));
+ Assert.That(result.Collection.First().Id, Is.EqualTo(2));
+ Assert.That(result.Collection.ToArray()[1].Id, Is.EqualTo(3));
+ }
+
+ private static List RegularRequestData()
+ {
+ return new List
+ {
+ new MovieRequests
+ {
+ Id= 1,
+ Approved = true,
+ RequestedDate = DateTime.Now
+ },
+ new MovieRequests
+ {
+ Id = 2,
+ Approved = false,
+ Available = true,
+ RequestedDate = DateTime.Now
+ },
+ new MovieRequests
+ {
+ Id = 3,
+ Denied = true,
+ RequestedDate = DateTime.Now
+ },
+ new MovieRequests
+ {
+ Id = 4,
+ Approved = false,
+ RequestedDate = DateTime.Now
+ }
+ };
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Ombi.Core.Tests/Engine/MovieRequestLimitsTests.cs b/src/Ombi.Core.Tests/Engine/MovieRequestLimitsTests.cs
index a28081ebc..88e1c75d2 100644
--- a/src/Ombi.Core.Tests/Engine/MovieRequestLimitsTests.cs
+++ b/src/Ombi.Core.Tests/Engine/MovieRequestLimitsTests.cs
@@ -4,6 +4,7 @@ using Moq.AutoMock;
using NUnit.Framework;
using Ombi.Core.Authentication;
using Ombi.Core.Engine;
+using Ombi.Core.Helpers;
using Ombi.Core.Models;
using Ombi.Core.Services;
using Ombi.Helpers;
@@ -36,6 +37,13 @@ namespace Ombi.Core.Tests.Engine
var identityMock = new Mock();
identityMock.SetupGet(x => x.Name).Returns("Test");
principleMock.SetupGet(x => x.Identity).Returns(identityMock.Object);
+
+ var currentUser = new Mock();
+ currentUser.Setup(x => x.Identity).Returns(identityMock.Object);
+ currentUser.Setup(x => x.Username).Returns("Test");
+ currentUser.Setup(x => x.GetUser()).ReturnsAsync(new OmbiUser { UserName = "Test", NormalizedUserName = "TEST", Id = "a" });
+
+ _mocker.Use(currentUser.Object);
_mocker.Use(principleMock.Object);
_subject = _mocker.CreateInstance();
@@ -429,6 +437,7 @@ namespace Ombi.Core.Tests.Engine
Id = "id1"
};
var lastWeek = new DateTime(2020, 09, 05).AddMonths(-1).AddDays(-1);
+ var today = new DateTime(2020, 09, 15, 13, 0, 0);
var log = new List
{
new RequestLog
@@ -441,7 +450,7 @@ namespace Ombi.Core.Tests.Engine
var repoMock = _mocker.GetMock>();
repoMock.Setup(x => x.GetAll()).Returns(log.AsQueryable().BuildMock().Object);
- var result = await _subject.GetRemainingMovieRequests(user);
+ var result = await _subject.GetRemainingMovieRequests(user, today);
Assert.That(result, Is.InstanceOf()
.With.Property(nameof(RequestQuotaCountModel.HasLimit)).EqualTo(true)
@@ -474,7 +483,7 @@ namespace Ombi.Core.Tests.Engine
var repoMock = _mocker.GetMock>();
repoMock.Setup(x => x.GetAll()).Returns(log.AsQueryable().BuildMock().Object);
- var result = await _subject.GetRemainingMovieRequests(user);
+ var result = await _subject.GetRemainingMovieRequests(user, today);
Assert.That(result, Is.InstanceOf()
.With.Property(nameof(RequestQuotaCountModel.HasLimit)).EqualTo(true)
@@ -494,7 +503,7 @@ namespace Ombi.Core.Tests.Engine
MovieRequestLimitType = RequestLimitType.Month,
Id = "id1"
};
- var today = DateTime.UtcNow;
+ var today = new DateTime(2022,2,2,13,0,0);
var firstDayOfMonth = new DateTime(today.Year, today.Month, 1);
var log = new List
{
@@ -514,7 +523,7 @@ namespace Ombi.Core.Tests.Engine
var repoMock = _mocker.GetMock>();
repoMock.Setup(x => x.GetAll()).Returns(log.AsQueryable().BuildMock().Object);
- var result = await _subject.GetRemainingMovieRequests(user);
+ var result = await _subject.GetRemainingMovieRequests(user, today);
Assert.That(result, Is.InstanceOf()
.With.Property(nameof(RequestQuotaCountModel.HasLimit)).EqualTo(true)
diff --git a/src/Ombi.Core.Tests/Engine/MusicRequestLimitTests.cs b/src/Ombi.Core.Tests/Engine/MusicRequestLimitTests.cs
index d79e70322..93dd5050d 100644
--- a/src/Ombi.Core.Tests/Engine/MusicRequestLimitTests.cs
+++ b/src/Ombi.Core.Tests/Engine/MusicRequestLimitTests.cs
@@ -4,6 +4,7 @@ using Moq.AutoMock;
using NUnit.Framework;
using Ombi.Core.Authentication;
using Ombi.Core.Engine;
+using Ombi.Core.Helpers;
using Ombi.Core.Models;
using Ombi.Core.Services;
using Ombi.Helpers;
@@ -36,7 +37,12 @@ namespace Ombi.Core.Tests.Engine
var identityMock = new Mock();
identityMock.SetupGet(x => x.Name).Returns("Test");
principleMock.SetupGet(x => x.Identity).Returns(identityMock.Object);
+ var currentUser = new Mock();
+ currentUser.Setup(x => x.Identity).Returns(identityMock.Object);
+ currentUser.Setup(x => x.Username).Returns("Test");
+ currentUser.Setup(x => x.GetUser()).ReturnsAsync(new OmbiUser { UserName = "Test", NormalizedUserName = "TEST", Id = "a" });
_mocker.Use(principleMock.Object);
+ _mocker.Use(currentUser.Object);
_subject = _mocker.CreateInstance();
}
@@ -494,7 +500,7 @@ namespace Ombi.Core.Tests.Engine
MusicRequestLimitType = RequestLimitType.Month,
Id = "id1"
};
- var today = DateTime.UtcNow;
+ var today = new DateTime(2022, 2, 2, 13, 0, 0);
var firstDayOfMonth = new DateTime(today.Year, today.Month, 1);
var log = new List
{
@@ -514,7 +520,7 @@ namespace Ombi.Core.Tests.Engine
var repoMock = _mocker.GetMock>();
repoMock.Setup(x => x.GetAll()).Returns(log.AsQueryable().BuildMock().Object);
- var result = await _subject.GetRemainingMusicRequests(user);
+ var result = await _subject.GetRemainingMusicRequests(user, today);
Assert.That(result, Is.InstanceOf()
.With.Property(nameof(RequestQuotaCountModel.HasLimit)).EqualTo(true)
diff --git a/src/Ombi.Core.Tests/Engine/TvRequestLimitsTests.cs b/src/Ombi.Core.Tests/Engine/TvRequestLimitsTests.cs
index e601ab84d..ba383da6c 100644
--- a/src/Ombi.Core.Tests/Engine/TvRequestLimitsTests.cs
+++ b/src/Ombi.Core.Tests/Engine/TvRequestLimitsTests.cs
@@ -4,6 +4,7 @@ using Moq.AutoMock;
using NUnit.Framework;
using Ombi.Core.Authentication;
using Ombi.Core.Engine;
+using Ombi.Core.Helpers;
using Ombi.Core.Models;
using Ombi.Core.Services;
using Ombi.Helpers;
@@ -33,7 +34,12 @@ namespace Ombi.Core.Tests.Engine
var identityMock = new Mock();
identityMock.SetupGet(x => x.Name).Returns("Test");
principleMock.SetupGet(x => x.Identity).Returns(identityMock.Object);
+ var currentUser = new Mock();
+ currentUser.Setup(x => x.Identity).Returns(identityMock.Object);
+ currentUser.Setup(x => x.Username).Returns("Test");
+ currentUser.Setup(x => x.GetUser()).ReturnsAsync(new OmbiUser { UserName = "Test", NormalizedUserName = "TEST", Id = "a" });
_mocker.Use(principleMock.Object);
+ _mocker.Use(currentUser.Object);
_subject = _mocker.CreateInstance();
}
diff --git a/src/Ombi.Core.Tests/Engine/V2/MovieRequestEngineTests.cs b/src/Ombi.Core.Tests/Engine/V2/MovieRequestEngineTests.cs
index 3c651b167..16b7cb811 100644
--- a/src/Ombi.Core.Tests/Engine/V2/MovieRequestEngineTests.cs
+++ b/src/Ombi.Core.Tests/Engine/V2/MovieRequestEngineTests.cs
@@ -7,8 +7,10 @@ using Moq;
using NUnit.Framework;
using Ombi.Api.TheMovieDb;
using Ombi.Core.Engine;
+using Ombi.Core.Helpers;
using Ombi.Core.Models.Requests;
using Ombi.Core.Rule.Interfaces;
+using Ombi.Core.Services;
using Ombi.Core.Settings;
using Ombi.Helpers;
using Ombi.Settings.Settings.Models;
@@ -32,7 +34,7 @@ namespace Ombi.Core.Tests.Engine.V2
var requestService = new Mock();
_movieRequestRepository = new Mock();
requestService.Setup(x => x.MovieRequestService).Returns(_movieRequestRepository.Object);
- var user = new Mock();
+ var user = new Mock();
var notificationHelper = new Mock();
var rules = new Mock();
var movieSender = new Mock();
@@ -43,8 +45,9 @@ namespace Ombi.Core.Tests.Engine.V2
var ombiSettings = new Mock>();
var requestSubs = new Mock>();
var mediaCache = new Mock();
+ var featureService = new Mock();
_engine = new MovieRequestEngine(movieApi.Object, requestService.Object, user.Object, notificationHelper.Object, rules.Object, movieSender.Object,
- logger.Object, userManager.Object, requestLogRepo.Object, cache.Object, ombiSettings.Object, requestSubs.Object, mediaCache.Object);
+ logger.Object, userManager.Object, requestLogRepo.Object, cache.Object, ombiSettings.Object, requestSubs.Object, mediaCache.Object, featureService.Object);
}
[Test]
diff --git a/src/Ombi.Core.Tests/Engine/V2/MusicSearchEngineV2Tests.cs b/src/Ombi.Core.Tests/Engine/V2/MusicSearchEngineV2Tests.cs
index 50ab63346..1b773f060 100644
--- a/src/Ombi.Core.Tests/Engine/V2/MusicSearchEngineV2Tests.cs
+++ b/src/Ombi.Core.Tests/Engine/V2/MusicSearchEngineV2Tests.cs
@@ -23,6 +23,7 @@ using Ombi.Store.Entities;
using Ombi.Store.Repository;
using Ombi.Test.Common;
using Artist = Hqub.MusicBrainz.API.Entities.Artist;
+using Ombi.Core.Helpers;
namespace Ombi.Core.Tests.Engine.V2
{
@@ -45,7 +46,7 @@ namespace Ombi.Core.Tests.Engine.V2
.ForEach(b => F.Behaviors.Remove(b));
F.Behaviors.Add(new OmitOnRecursionBehavior());
- var principle = new Mock();
+ var principle = new Mock();
var requestService = new Mock();
var ruleEval = new Mock();
var um = MockHelper.MockUserManager(new List());
diff --git a/src/Ombi.Core.Tests/Engine/VoteEngineTests.cs b/src/Ombi.Core.Tests/Engine/VoteEngineTests.cs
index be874669c..4194ae0ea 100644
--- a/src/Ombi.Core.Tests/Engine/VoteEngineTests.cs
+++ b/src/Ombi.Core.Tests/Engine/VoteEngineTests.cs
@@ -9,6 +9,7 @@ using NUnit.Framework;
using Ombi.Core.Authentication;
using Ombi.Core.Engine;
using Ombi.Core.Engine.Interfaces;
+using Ombi.Core.Helpers;
using Ombi.Core.Models;
using Ombi.Core.Rule.Interfaces;
using Ombi.Core.Settings;
@@ -32,8 +33,9 @@ namespace Ombi.Core.Tests.Engine
TvRequestEngine = new Mock();
MovieRequestEngine = new Mock();
MovieRequestEngine = new Mock();
- User = new Mock();
- User.Setup(x => x.Identity.Name).Returns("abc");
+ User = new Mock();
+ User.Setup(x => x.GetUser()).ReturnsAsync(new OmbiUser { UserName = "abc", NormalizedUserName = "ABC", Id = "abc" });
+
UserManager = MockHelper.MockUserManager(new List { new OmbiUser { Id = "abc", UserName = "abc", NormalizedUserName = "ABC" } });
Rule = new Mock();
Engine = new VoteEngine(VoteRepository.Object, User.Object, UserManager.Object, Rule.Object, VoteSettings.Object, MusicRequestEngine.Object,
@@ -48,7 +50,7 @@ namespace Ombi.Core.Tests.Engine
public Fixture F { get; set; }
public VoteEngine Engine { get; set; }
- public Mock User { get; set; }
+ public Mock User { get; set; }
public Mock UserManager { get; set; }
public Mock Rule { get; set; }
public Mock> VoteRepository { get; set; }
@@ -83,7 +85,7 @@ namespace Ombi.Core.Tests.Engine
Assert.That(result.Result, Is.True);
VoteRepository.Verify(x => x.Add(It.Is(c => c.UserId == "abc" && c.VoteType == type)), Times.Once);
VoteRepository.Verify(x => x.Delete(It.IsAny()), Times.Never);
- MovieRequestEngine.Verify(x => x.ApproveMovieById(1), Times.Never);
+ MovieRequestEngine.Verify(x => x.ApproveMovieById(1, false), Times.Never);
}
public static IEnumerable VoteData
{
@@ -129,7 +131,7 @@ namespace Ombi.Core.Tests.Engine
Assert.That(result.Result, Is.False);
VoteRepository.Verify(x => x.Delete(It.IsAny()), Times.Never);
- MovieRequestEngine.Verify(x => x.ApproveMovieById(1), Times.Never);
+ MovieRequestEngine.Verify(x => x.ApproveMovieById(1, false), Times.Never);
}
public static IEnumerable AttemptedTwiceData
{
@@ -175,7 +177,7 @@ namespace Ombi.Core.Tests.Engine
Assert.That(result.Result, Is.True);
VoteRepository.Verify(x => x.Delete(It.IsAny()), Times.Once);
VoteRepository.Verify(x => x.Add(It.Is(v => v.VoteType == type)), Times.Once);
- MovieRequestEngine.Verify(x => x.ApproveMovieById(1), Times.Never);
+ MovieRequestEngine.Verify(x => x.ApproveMovieById(1, false), Times.Never);
}
public static IEnumerable VoteConvertData
{
diff --git a/src/Ombi.Core.Tests/Ombi.Core.Tests.csproj b/src/Ombi.Core.Tests/Ombi.Core.Tests.csproj
index fcbdab967..4e01e32cd 100644
--- a/src/Ombi.Core.Tests/Ombi.Core.Tests.csproj
+++ b/src/Ombi.Core.Tests/Ombi.Core.Tests.csproj
@@ -1,7 +1,7 @@
- net5.0
+ net6.0
true
true
Debug;Release;NonUiBuild
@@ -9,7 +9,7 @@
-
+
diff --git a/src/Ombi.Core.Tests/Rule/Request/AutoApproveRuleTests.cs b/src/Ombi.Core.Tests/Rule/Request/AutoApproveRuleTests.cs
index 595ba39e0..c73237097 100644
--- a/src/Ombi.Core.Tests/Rule/Request/AutoApproveRuleTests.cs
+++ b/src/Ombi.Core.Tests/Rule/Request/AutoApproveRuleTests.cs
@@ -10,6 +10,8 @@ using Ombi.Test.Common;
using System.Collections.Generic;
using Ombi.Store.Entities;
using System;
+using Ombi.Core.Services;
+using Ombi.Core.Helpers;
namespace Ombi.Core.Tests.Rule.Request
{
@@ -26,23 +28,26 @@ namespace Ombi.Core.Tests.Rule.Request
public void Setup()
{
- PrincipalMock = new Mock();
- PrincipalMock.Setup(x => x.Identity.Name).Returns("abc");
+ FeatureService = new Mock();
+
+ PrincipalMock = new Mock();
+ PrincipalMock.Setup(x => x.Username).Returns("abc");
+ PrincipalMock.Setup(x => x.GetUser()).ReturnsAsync(new OmbiUser { UserName = "abc", NormalizedUserName = "ABC", Id = "a" });
UserManager = MockHelper.MockUserManager(_users);
- Rule = new AutoApproveRule(PrincipalMock.Object, UserManager.Object);
+ Rule = new AutoApproveRule(PrincipalMock.Object, UserManager.Object, FeatureService.Object);
}
-
private AutoApproveRule Rule { get; set; }
- private Mock PrincipalMock { get; set; }
+ private Mock PrincipalMock { get; set; }
private Mock UserManager { get; set; }
+ private Mock FeatureService { get; set; }
[Test]
public async Task Should_ReturnSuccess_WhenAdminAndRequestMovie()
{
UserManager.Setup(x => x.IsInRoleAsync(It.IsAny(), OmbiRoles.Admin)).ReturnsAsync(true);
- var request = new BaseRequest() { RequestType = Store.Entities.RequestType.Movie };
+ var request = new MovieRequests() { RequestType = Store.Entities.RequestType.Movie };
var result = await Rule.Execute(request);
Assert.True(result.Success);
@@ -64,7 +69,7 @@ namespace Ombi.Core.Tests.Rule.Request
public async Task Should_ReturnSuccess_WhenAutoApproveMovieAndRequestMovie()
{
UserManager.Setup(x => x.IsInRoleAsync(It.IsAny(), OmbiRoles.AutoApproveMovie)).ReturnsAsync(true);
- var request = new BaseRequest() { RequestType = Store.Entities.RequestType.Movie };
+ var request = new MovieRequests() { RequestType = Store.Entities.RequestType.Movie };
var result = await Rule.Execute(request);
Assert.True(result.Success);
@@ -96,7 +101,8 @@ namespace Ombi.Core.Tests.Rule.Request
[Test]
public async Task Should_ReturnSuccess_WhenSystemUserAndRequestTV()
{
- PrincipalMock.Setup(x => x.Identity.Name).Returns("sys");
+ PrincipalMock.Setup(x => x.GetUser()).ReturnsAsync(new OmbiUser { UserName = "sys", NormalizedUserName = "SYS", Id = "a" });
+
UserManager.Setup(x => x.IsInRoleAsync(It.IsAny(), OmbiRoles.AutoApproveTv)).ReturnsAsync(false);
var request = new BaseRequest() { RequestType = Store.Entities.RequestType.TvShow };
var result = await Rule.Execute(request);
@@ -137,5 +143,17 @@ namespace Ombi.Core.Tests.Rule.Request
Assert.True(result.Success);
Assert.False(request.Approved);
}
+
+ [Test]
+ public async Task Should_ReturnFail_When4kRequestAndFeatureNotEnabled()
+ {
+ UserManager.Setup(x => x.IsInRoleAsync(It.IsAny(), It.IsAny())).ReturnsAsync(false);
+ var request = new MovieRequests() { RequestType = Store.Entities.RequestType.Movie, Is4kRequest = true };
+ var result = await Rule.Execute(request);
+
+ Assert.True(result.Success);
+ Assert.False(request.Approved);
+ Assert.False(request.Approved4K);
+ }
}
}
diff --git a/src/Ombi.Core.Tests/Rule/Request/CanRequestRuleTests.cs b/src/Ombi.Core.Tests/Rule/Request/CanRequestRuleTests.cs
index 03dc6f68c..9d8db25d1 100644
--- a/src/Ombi.Core.Tests/Rule/Request/CanRequestRuleTests.cs
+++ b/src/Ombi.Core.Tests/Rule/Request/CanRequestRuleTests.cs
@@ -5,6 +5,7 @@ using System.Threading.Tasks;
using Moq;
using NUnit.Framework;
using Ombi.Core.Authentication;
+using Ombi.Core.Helpers;
using Ombi.Core.Rule.Rules;
using Ombi.Core.Rule.Rules.Request;
using Ombi.Helpers;
@@ -26,8 +27,9 @@ namespace Ombi.Core.Tests.Rule.Request
public void Setup()
{
- PrincipalMock = new Mock();
- PrincipalMock.Setup(x => x.Identity.Name).Returns("abc");
+ PrincipalMock = new Mock();
+ PrincipalMock.Setup(x => x.GetUser()).ReturnsAsync(new OmbiUser { UserName = "abc", NormalizedUserName = "ABC", Id = "a" });
+
UserManager = MockHelper.MockUserManager(_users);
Rule = new CanRequestRule(PrincipalMock.Object, UserManager.Object);
@@ -35,14 +37,49 @@ namespace Ombi.Core.Tests.Rule.Request
private CanRequestRule Rule { get; set; }
- private Mock PrincipalMock { get; set; }
+ private Mock PrincipalMock { get; set; }
private Mock UserManager { get; set; }
[Test]
public async Task Should_ReturnSuccess_WhenRequestingMovieWithMovieRole()
{
UserManager.Setup(x => x.IsInRoleAsync(It.IsAny(), OmbiRoles.RequestMovie)).ReturnsAsync(true);
- var request = new BaseRequest() { RequestType = Store.Entities.RequestType.Movie };
+ var request = new MovieRequests() { RequestType = Store.Entities.RequestType.Movie };
+ var result = await Rule.Execute(request);
+
+ Assert.True(result.Success);
+ }
+
+ [Test]
+ public async Task Should_ReturnSuccess_WhenRequestingMovie4KWithMovieRole()
+ {
+ UserManager.Setup(x => x.IsInRoleAsync(It.IsAny(), OmbiRoles.RequestMovie)).ReturnsAsync(true);
+ UserManager.Setup(x => x.IsInRoleAsync(It.IsAny(), OmbiRoles.Request4KMovie)).ReturnsAsync(true);
+ var request = new MovieRequests() { RequestType = Store.Entities.RequestType.Movie, Has4KRequest = true };
+ var result = await Rule.Execute(request);
+
+ Assert.True(result.Success);
+ }
+
+ [Test]
+ public async Task Should_ReturnFailure_WhenRequestingMovie4KWithMovieRole()
+ {
+ UserManager.Setup(x => x.IsInRoleAsync(It.IsAny(), OmbiRoles.RequestMovie)).ReturnsAsync(true);
+ UserManager.Setup(x => x.IsInRoleAsync(It.IsAny(), OmbiRoles.Request4KMovie)).ReturnsAsync(false);
+ var request = new MovieRequests() { RequestType = Store.Entities.RequestType.Movie, Is4kRequest = true };
+ var result = await Rule.Execute(request);
+
+ Assert.False(result.Success);
+ Assert.False(string.IsNullOrEmpty(result.Message));
+ }
+
+ [Test]
+ public async Task Should_ReturnSuccess_WhenRequestingMovie4KWithAutoApprove()
+ {
+ UserManager.Setup(x => x.IsInRoleAsync(It.IsAny(), OmbiRoles.RequestMovie)).ReturnsAsync(true);
+ UserManager.Setup(x => x.IsInRoleAsync(It.IsAny(), OmbiRoles.AutoApproveMovie)).ReturnsAsync(true);
+ UserManager.Setup(x => x.IsInRoleAsync(It.IsAny(), OmbiRoles.Request4KMovie)).ReturnsAsync(false);
+ var request = new MovieRequests() { RequestType = Store.Entities.RequestType.Movie, Has4KRequest = true };
var result = await Rule.Execute(request);
Assert.True(result.Success);
@@ -52,7 +89,7 @@ namespace Ombi.Core.Tests.Rule.Request
public async Task Should_ReturnFail_WhenRequestingMovieWithoutMovieRole()
{
UserManager.Setup(x => x.IsInRoleAsync(It.IsAny(), OmbiRoles.RequestMovie)).ReturnsAsync(false);
- var request = new BaseRequest() { RequestType = Store.Entities.RequestType.Movie };
+ var request = new MovieRequests() { RequestType = Store.Entities.RequestType.Movie };
var result = await Rule.Execute(request);
Assert.False(result.Success);
@@ -72,7 +109,8 @@ namespace Ombi.Core.Tests.Rule.Request
[Test]
public async Task Should_ReturnSuccess_WhenRequestingMovieWithSystemRole()
{
- PrincipalMock.Setup(x => x.Identity.Name).Returns("sys");
+ PrincipalMock.Setup(x => x.GetUser()).ReturnsAsync(new OmbiUser { UserName = "sys", NormalizedUserName = "SYS", Id = "a" });
+
UserManager.Setup(x => x.IsInRoleAsync(It.IsAny(), OmbiRoles.Admin)).ReturnsAsync(false);
var request = new BaseRequest() { RequestType = Store.Entities.RequestType.Movie };
var result = await Rule.Execute(request);
diff --git a/src/Ombi.Core.Tests/Rule/Request/ExistingMovieRequestRuleTests.cs b/src/Ombi.Core.Tests/Rule/Request/ExistingMovieRequestRuleTests.cs
index 7ff69c9f2..682d4bf4d 100644
--- a/src/Ombi.Core.Tests/Rule/Request/ExistingMovieRequestRuleTests.cs
+++ b/src/Ombi.Core.Tests/Rule/Request/ExistingMovieRequestRuleTests.cs
@@ -9,7 +9,9 @@ using NUnit.Framework;
using Ombi.Core.Authentication;
using Ombi.Core.Rule.Rules;
using Ombi.Core.Rule.Rules.Request;
+using Ombi.Core.Services;
using Ombi.Helpers;
+using Ombi.Settings.Settings.Models;
using Ombi.Store.Entities;
using Ombi.Store.Entities.Requests;
using Ombi.Store.Repository.Requests;
@@ -24,12 +26,14 @@ namespace Ombi.Core.Tests.Rule.Request
public void Setup()
{
ContextMock = new Mock();
- Rule = new ExistingMovieRequestRule(ContextMock.Object);
+ FeatureService = new Mock();
+ Rule = new ExistingMovieRequestRule(ContextMock.Object, FeatureService.Object);
}
private ExistingMovieRequestRule Rule { get; set; }
private Mock ContextMock { get; set; }
+ private Mock FeatureService { get; set; }
[Test]
public async Task ExistingRequestRule_Movie_Has_Been_Requested_With_TheMovieDBId()
@@ -96,5 +100,82 @@ namespace Ombi.Core.Tests.Rule.Request
Assert.That(result.Success, Is.True);
Assert.That(result.Message, Is.Null.Or.Empty);
}
+
+ [Test]
+ public async Task ExistingRequestRule_Movie_HasAlready4K_Request()
+ {
+ ContextMock.Setup(x => x.GetAll()).Returns(new List
+ {
+ new MovieRequests
+ {
+ TheMovieDbId = 2,
+ ImdbId = "2",
+ RequestType = RequestType.Movie,
+ Is4kRequest = true
+ }
+ }.AsQueryable().BuildMock().Object);
+ var o = new MovieRequests
+ {
+ TheMovieDbId = 2,
+ ImdbId = "1",
+ Has4KRequest = true
+ };
+ var result = await Rule.Execute(o);
+
+ Assert.That(result.Success, Is.False);
+ Assert.That(result.Message, Is.Not.Empty);
+ }
+
+ [Test]
+ public async Task ExistingRequestRule_Movie_4K_Request()
+ {
+ FeatureService.Setup(x => x.FeatureEnabled(FeatureNames.Movie4KRequests)).ReturnsAsync(true);
+ ContextMock.Setup(x => x.GetAll()).Returns(new List
+ {
+ new MovieRequests
+ {
+ TheMovieDbId = 2,
+ ImdbId = "2",
+ RequestType = RequestType.Movie,
+ Is4kRequest = false
+ }
+ }.AsQueryable().BuildMock().Object);
+ var o = new MovieRequests
+ {
+ TheMovieDbId = 2,
+ ImdbId = "1",
+ Is4kRequest = true
+ };
+ var result = await Rule.Execute(o);
+
+ Assert.That(result.Success, Is.True);
+ Assert.That(result.Message, Is.Null.Or.Empty);
+ }
+
+ [Test]
+ public async Task ExistingRequestRule_Movie_4K_Request_FeatureNotEnabled()
+ {
+ FeatureService.Setup(x => x.FeatureEnabled(FeatureNames.Movie4KRequests)).ReturnsAsync(false);
+ ContextMock.Setup(x => x.GetAll()).Returns(new List
+ {
+ new MovieRequests
+ {
+ TheMovieDbId = 2,
+ ImdbId = "2",
+ RequestType = RequestType.Movie,
+ Is4kRequest = false
+ }
+ }.AsQueryable().BuildMock().Object);
+ var o = new MovieRequests
+ {
+ TheMovieDbId = 2,
+ ImdbId = "1",
+ Is4kRequest = true
+ };
+ var result = await Rule.Execute(o);
+
+ Assert.That(result.Success, Is.False);
+ Assert.That(result.Message, Is.Not.Null);
+ }
}
}
diff --git a/src/Ombi.Core.Tests/Rule/Request/ExistingPlexRequestRuleTests.cs b/src/Ombi.Core.Tests/Rule/Request/ExistingPlexRequestRuleTests.cs
index f5a362303..314b543b8 100644
--- a/src/Ombi.Core.Tests/Rule/Request/ExistingPlexRequestRuleTests.cs
+++ b/src/Ombi.Core.Tests/Rule/Request/ExistingPlexRequestRuleTests.cs
@@ -1,6 +1,7 @@
using MockQueryable.Moq;
using Moq;
using NUnit.Framework;
+using Ombi.Core.Engine;
using Ombi.Core.Rule.Rules.Request;
using Ombi.Store.Entities;
using Ombi.Store.Entities.Requests;
@@ -176,17 +177,58 @@ namespace Ombi.Core.Tests.Rule.Request
Assert.That(result.Success, Is.True);
}
+ [Test]
+ public async Task RequestMovie_IsSuccessful()
+ {
+ SetupMockData();
+
+ var req = new MovieRequests
+ {
+ RequestType = RequestType.Movie,
+ TheMovieDbId = 123,
+ Id = 1,
+ };
+ var result = await Rule.Execute(req);
+
+
+ Assert.That(result.Success, Is.True);
+ }
+
+ [Test]
+ public async Task RequestMovie_IsAlreadyAvailable()
+ {
+ var content = new List {
+ new PlexServerContent
+ {
+ TheMovieDbId = 123.ToString(),
+ }
+ };
+ PlexContentRepo.Setup(x => x.GetAll()).Returns(content.AsQueryable().BuildMock().Object);
+
+ var req = new MovieRequests
+ {
+ RequestType = RequestType.Movie,
+ TheMovieDbId = 123,
+ Id = 1,
+ };
+ var result = await Rule.Execute(req);
+
+
+ Assert.That(result.Success, Is.False);
+ Assert.That(result.ErrorCode, Is.EqualTo(ErrorCode.AlreadyRequested));
+ }
+
private void SetupMockData()
{
var childRequests = new List
{
new PlexServerContent
{
- Type = PlexMediaTypeEntity.Show,
+ Type = MediaType.Series,
TheMovieDbId = "1",
Title = "Test",
ReleaseYear = "2001",
- Episodes = new List
+ Episodes = new List
{
new PlexEpisode
{
diff --git a/src/Ombi.Core.Tests/Rule/Search/EmbyAvailabilityRuleTests.cs b/src/Ombi.Core.Tests/Rule/Search/EmbyAvailabilityRuleTests.cs
index 132f51e49..484e872e2 100644
--- a/src/Ombi.Core.Tests/Rule/Search/EmbyAvailabilityRuleTests.cs
+++ b/src/Ombi.Core.Tests/Rule/Search/EmbyAvailabilityRuleTests.cs
@@ -1,11 +1,14 @@
using System.Collections.Generic;
using System.Threading.Tasks;
+using Microsoft.Extensions.Logging;
using Moq;
using NUnit.Framework;
using Ombi.Core.Models.Search;
using Ombi.Core.Rule.Rules.Search;
+using Ombi.Core.Services;
using Ombi.Core.Settings;
using Ombi.Core.Settings.Models.External;
+using Ombi.Settings.Settings.Models;
using Ombi.Store.Entities;
using Ombi.Store.Repository;
using Ombi.Store.Repository.Requests;
@@ -18,21 +21,23 @@ namespace Ombi.Core.Tests.Rule.Search
public void Setup()
{
ContextMock = new Mock();
- SettingsMock = new Mock>();
- Rule = new EmbyAvailabilityRule(ContextMock.Object, SettingsMock.Object);
+ LoggerMock = new Mock>();
+ FeatureMock = new Mock |