From 15bf43e3adc69fc0ec5413e81a20b1f0d5dccd5c Mon Sep 17 00:00:00 2001
From: JPVenson <6794763+JPVenson@users.noreply.github.com>
Date: Tue, 8 Oct 2024 19:53:26 +0000
Subject: Removed BaseSqliteRepository
---
.../Persistence/IItemRepository.cs | 200 ++++++++-------------
.../Persistence/IMediaAttachmentManager.cs | 29 +++
.../Persistence/IMediaStreamManager.cs | 28 +++
.../Persistence/IPeopleManager.cs | 34 ++++
4 files changed, 165 insertions(+), 126 deletions(-)
create mode 100644 MediaBrowser.Controller/Persistence/IMediaAttachmentManager.cs
create mode 100644 MediaBrowser.Controller/Persistence/IMediaStreamManager.cs
create mode 100644 MediaBrowser.Controller/Persistence/IPeopleManager.cs
(limited to 'MediaBrowser.Controller/Persistence')
diff --git a/MediaBrowser.Controller/Persistence/IItemRepository.cs b/MediaBrowser.Controller/Persistence/IItemRepository.cs
index 21b9ee4b7e..313b1459ab 100644
--- a/MediaBrowser.Controller/Persistence/IItemRepository.cs
+++ b/MediaBrowser.Controller/Persistence/IItemRepository.cs
@@ -7,135 +7,83 @@ using System.Collections.Generic;
using System.Threading;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Dto;
-using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying;
-namespace MediaBrowser.Controller.Persistence
+namespace MediaBrowser.Controller.Persistence;
+
+///
+/// Provides an interface to implement an Item repository.
+///
+public interface IItemRepository : IDisposable
{
///
- /// Provides an interface to implement an Item repository.
+ /// Deletes the item.
+ ///
+ /// The identifier.
+ void DeleteItem(Guid id);
+
+ ///
+ /// Saves the items.
+ ///
+ /// The items.
+ /// The cancellation token.
+ void SaveItems(IReadOnlyList items, CancellationToken cancellationToken);
+
+ void SaveImages(BaseItem item);
+
+ ///
+ /// Retrieves the item.
+ ///
+ /// The id.
+ /// BaseItem.
+ BaseItem RetrieveItem(Guid id);
+
+ ///
+ /// Gets the items.
+ ///
+ /// The query.
+ /// QueryResult<BaseItem>.
+ QueryResult GetItems(InternalItemsQuery filter);
+
+ ///
+ /// Gets the item ids list.
+ ///
+ /// The query.
+ /// List<Guid>.
+ IReadOnlyList GetItemIdsList(InternalItemsQuery filter);
+
+
+ ///
+ /// Gets the item list.
+ ///
+ /// The query.
+ /// List<BaseItem>.
+ IReadOnlyList GetItemList(InternalItemsQuery filter);
+
+ ///
+ /// Updates the inherited values.
///
- public interface IItemRepository : IDisposable
- {
- ///
- /// Deletes the item.
- ///
- /// The identifier.
- void DeleteItem(Guid id);
-
- ///
- /// Saves the items.
- ///
- /// The items.
- /// The cancellation token.
- void SaveItems(IReadOnlyList items, CancellationToken cancellationToken);
-
- void SaveImages(BaseItem item);
-
- ///
- /// Retrieves the item.
- ///
- /// The id.
- /// BaseItem.
- BaseItem RetrieveItem(Guid id);
-
- ///
- /// Gets the media streams.
- ///
- /// The query.
- /// IEnumerable{MediaStream}.
- List GetMediaStreams(MediaStreamQuery query);
-
- ///
- /// Saves the media streams.
- ///
- /// The identifier.
- /// The streams.
- /// The cancellation token.
- void SaveMediaStreams(Guid id, IReadOnlyList streams, CancellationToken cancellationToken);
-
- ///
- /// Gets the media attachments.
- ///
- /// The query.
- /// IEnumerable{MediaAttachment}.
- List GetMediaAttachments(MediaAttachmentQuery query);
-
- ///
- /// Saves the media attachments.
- ///
- /// The identifier.
- /// The attachments.
- /// The cancellation token.
- void SaveMediaAttachments(Guid id, IReadOnlyList attachments, CancellationToken cancellationToken);
-
- ///
- /// Gets the items.
- ///
- /// The query.
- /// QueryResult<BaseItem>.
- QueryResult GetItems(InternalItemsQuery query);
-
- ///
- /// Gets the item ids list.
- ///
- /// The query.
- /// List<Guid>.
- List GetItemIdsList(InternalItemsQuery query);
-
- ///
- /// Gets the people.
- ///
- /// The query.
- /// List<PersonInfo>.
- List GetPeople(InternalPeopleQuery query);
-
- ///
- /// Updates the people.
- ///
- /// The item identifier.
- /// The people.
- void UpdatePeople(Guid itemId, List people);
-
- ///
- /// Gets the people names.
- ///
- /// The query.
- /// List<System.String>.
- List GetPeopleNames(InternalPeopleQuery query);
-
- ///
- /// Gets the item list.
- ///
- /// The query.
- /// List<BaseItem>.
- List GetItemList(InternalItemsQuery query);
-
- ///
- /// Updates the inherited values.
- ///
- void UpdateInheritedValues();
-
- int GetCount(InternalItemsQuery query);
-
- QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetGenres(InternalItemsQuery query);
-
- QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetMusicGenres(InternalItemsQuery query);
-
- QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetStudios(InternalItemsQuery query);
-
- QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetArtists(InternalItemsQuery query);
-
- QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetAlbumArtists(InternalItemsQuery query);
-
- QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetAllArtists(InternalItemsQuery query);
-
- List GetMusicGenreNames();
-
- List GetStudioNames();
-
- List GetGenreNames();
-
- List GetAllArtistNames();
- }
+ void UpdateInheritedValues();
+
+ int GetCount(InternalItemsQuery filter);
+
+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetGenres(InternalItemsQuery filter);
+
+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetMusicGenres(InternalItemsQuery filter);
+
+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetStudios(InternalItemsQuery filter);
+
+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetArtists(InternalItemsQuery filter);
+
+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetAlbumArtists(InternalItemsQuery filter);
+
+ QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetAllArtists(InternalItemsQuery filter);
+
+ IReadOnlyList GetMusicGenreNames();
+
+ IReadOnlyList GetStudioNames();
+
+ IReadOnlyList GetGenreNames();
+
+ IReadOnlyList GetAllArtistNames();
}
diff --git a/MediaBrowser.Controller/Persistence/IMediaAttachmentManager.cs b/MediaBrowser.Controller/Persistence/IMediaAttachmentManager.cs
new file mode 100644
index 0000000000..210d80afa2
--- /dev/null
+++ b/MediaBrowser.Controller/Persistence/IMediaAttachmentManager.cs
@@ -0,0 +1,29 @@
+#nullable disable
+
+#pragma warning disable CS1591
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using MediaBrowser.Model.Entities;
+
+namespace MediaBrowser.Controller.Persistence;
+
+public interface IMediaAttachmentManager
+{
+
+ ///
+ /// Gets the media attachments.
+ ///
+ /// The query.
+ /// IEnumerable{MediaAttachment}.
+ IReadOnlyList GetMediaAttachments(MediaAttachmentQuery filter);
+
+ ///
+ /// Saves the media attachments.
+ ///
+ /// The identifier.
+ /// The attachments.
+ /// The cancellation token.
+ void SaveMediaAttachments(Guid id, IReadOnlyList attachments, CancellationToken cancellationToken);
+}
diff --git a/MediaBrowser.Controller/Persistence/IMediaStreamManager.cs b/MediaBrowser.Controller/Persistence/IMediaStreamManager.cs
new file mode 100644
index 0000000000..ec7c72935b
--- /dev/null
+++ b/MediaBrowser.Controller/Persistence/IMediaStreamManager.cs
@@ -0,0 +1,28 @@
+#nullable disable
+
+#pragma warning disable CS1591
+
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using MediaBrowser.Model.Entities;
+
+namespace MediaBrowser.Controller.Persistence;
+
+public interface IMediaStreamManager
+{
+ ///
+ /// Gets the media streams.
+ ///
+ /// The query.
+ /// IEnumerable{MediaStream}.
+ List GetMediaStreams(MediaStreamQuery filter);
+
+ ///
+ /// Saves the media streams.
+ ///
+ /// The identifier.
+ /// The streams.
+ /// The cancellation token.
+ void SaveMediaStreams(Guid id, IReadOnlyList streams, CancellationToken cancellationToken);
+}
diff --git a/MediaBrowser.Controller/Persistence/IPeopleManager.cs b/MediaBrowser.Controller/Persistence/IPeopleManager.cs
new file mode 100644
index 0000000000..84e503fefb
--- /dev/null
+++ b/MediaBrowser.Controller/Persistence/IPeopleManager.cs
@@ -0,0 +1,34 @@
+#nullable disable
+
+#pragma warning disable CS1591
+
+using System;
+using System.Collections.Generic;
+using MediaBrowser.Controller.Entities;
+
+namespace MediaBrowser.Controller.Persistence;
+
+public interface IPeopleManager
+{
+ ///
+ /// Gets the people.
+ ///
+ /// The query.
+ /// List<PersonInfo>.
+ IReadOnlyList GetPeople(InternalPeopleQuery filter);
+
+ ///
+ /// Updates the people.
+ ///
+ /// The item identifier.
+ /// The people.
+ void UpdatePeople(Guid itemId, IReadOnlyList people);
+
+ ///
+ /// Gets the people names.
+ ///
+ /// The query.
+ /// List<System.String>.
+ IReadOnlyList GetPeopleNames(InternalPeopleQuery filter);
+
+}
--
cgit v1.2.3