diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index bccdb2b1..665f3f19 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -3,7 +3,7 @@
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
If it fixes a bug or resolves a feature request, be sure to link to that issue.
-## Informations
+## Information
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] New public API added
- [ ] Non-breaking changes
diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml
index 333672da..01ef1a22 100644
--- a/.github/workflows/analysis.yml
+++ b/.github/workflows/analysis.yml
@@ -34,11 +34,18 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: bash
run: |
+ dotnet test \
+ '-p:CollectCoverage=true;CoverletOutputFormat=opencover' \
+ '-p:SkipTranscoder=true;SkipWebApp=true' || echo "Test failed. Skipping..."
+
+ dotnet build-server shutdown
+
./.sonar/scanner/dotnet-sonarscanner begin \
- -k:"AnonymusRaccoon_Kyoo" \
- -o:"anonymus-raccoon" \
- -d:sonar.login="${{ secrets.SONAR_TOKEN }}" \
- -d:sonar.host.url="https://sonarcloud.io"
+ -k:"AnonymusRaccoon_Kyoo" \
+ -o:"anonymus-raccoon" \
+ -d:sonar.login="${{ secrets.SONAR_TOKEN }}" \
+ -d:sonar.host.url="https://sonarcloud.io" \
+ -d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml"
dotnet build --no-incremental '-p:SkipTranscoder=true;SkipWebApp=true'
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 5969ea76..bd06596b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -21,8 +21,8 @@ jobs:
artifact: macos
steps:
- uses: actions/checkout@v1
- - name: Checkout submodules
- run: git submodule update --init --recursive
+ with:
+ submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
diff --git a/Kyoo.Common/Controllers/ILibraryManager.cs b/Kyoo.Common/Controllers/ILibraryManager.cs
index ae1d0ccb..d15987de 100644
--- a/Kyoo.Common/Controllers/ILibraryManager.cs
+++ b/Kyoo.Common/Controllers/ILibraryManager.cs
@@ -5,284 +5,532 @@ using System.Runtime.InteropServices;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Kyoo.Models;
+using Kyoo.Models.Exceptions;
namespace Kyoo.Controllers
{
- public interface ILibraryManager : IDisposable, IAsyncDisposable
+ ///
+ /// An interface to interract with the database. Every repository is mapped through here.
+ ///
+ public interface ILibraryManager
{
- // Repositories
+ ///
+ /// Get the repository corresponding to the T item.
+ ///
+ /// The type you want
+ /// If the item is not found
+ /// The repository corresponding
+ IRepository GetRepository() where T : class, IResource;
+
+ ///
+ /// The repository that handle libraries.
+ ///
ILibraryRepository LibraryRepository { get; }
+
+ ///
+ /// The repository that handle libraries's items (a wrapper arround shows & collections).
+ ///
ILibraryItemRepository LibraryItemRepository { get; }
+
+ ///
+ /// The repository that handle collections.
+ ///
ICollectionRepository CollectionRepository { get; }
+
+ ///
+ /// The repository that handle shows.
+ ///
IShowRepository ShowRepository { get; }
+
+ ///
+ /// The repository that handle seasons.
+ ///
ISeasonRepository SeasonRepository { get; }
+
+ ///
+ /// The repository that handle episodes.
+ ///
IEpisodeRepository EpisodeRepository { get; }
+
+ ///
+ /// The repository that handle tracks.
+ ///
ITrackRepository TrackRepository { get; }
+
+ ///
+ /// The repository that handle people.
+ ///
IPeopleRepository PeopleRepository { get; }
+
+ ///
+ /// The repository that handle studios.
+ ///
IStudioRepository StudioRepository { get; }
+
+ ///
+ /// The repository that handle genres.
+ ///
IGenreRepository GenreRepository { get; }
+
+ ///
+ /// The repository that handle providers.
+ ///
IProviderRepository ProviderRepository { get; }
- // Get by id
- Task GetLibrary(int id);
- Task GetCollection(int id);
- Task GetShow(int id);
- Task GetSeason(int id);
- Task GetSeason(int showID, int seasonNumber);
- Task GetEpisode(int id);
- Task GetEpisode(int showID, int seasonNumber, int episodeNumber);
- Task GetGenre(int id);
- Task