diff --git a/src/Http/IRequest.cs b/src/Http/IRequest.cs
index a71fd7b..0172802 100644
--- a/src/Http/IRequest.cs
+++ b/src/Http/IRequest.cs
@@ -3,10 +3,33 @@
namespace SubDBSharp.Models
{
+ ///
+ /// Represents an HTTP request with a specified endpoint, method, and optional body content.
+ ///
public interface IRequest
{
+ ///
+ /// Gets or sets the HTTP content to be sent as the body of an HTTP request.
+ ///
+ ///
+ /// Typically used to include serialized data or other payloads in HTTP requests such as POST or PUT.
+ ///
HttpContent Body { get; }
+
+ ///
+ /// Gets or sets the URI that represents the target endpoint of the HTTP request.
+ ///
+ ///
+ /// Used to specify the destination URL for the HTTP operation being executed.
+ ///
Uri EndPoint { get; }
+
+ ///
+ /// Gets or sets the HTTP method to be used for the request.
+ ///
+ ///
+ /// Specifies the action to be performed by the request, such as GET, POST, PUT, or DELETE.
+ ///
HttpMethod Method { get; }
}
}
\ No newline at end of file
diff --git a/src/Http/IResponse.cs b/src/Http/IResponse.cs
index 8d9b007..b646894 100644
--- a/src/Http/IResponse.cs
+++ b/src/Http/IResponse.cs
@@ -3,10 +3,38 @@
namespace SubDBSharp.Http
{
+ ///
+ /// Represents a response received from an HTTP request.
+ ///
public interface IResponse
{
+ ///
+ /// Gets the content of the response body.
+ ///
+ ///
+ /// The body contains the data returned by the HTTP request, which may be in various formats such as plain text,
+ /// JSON object, or binary data, depending on the nature of the response.
+ /// This property is represented as an object and may require casting to the expected type.
+ ///
object Body { get; }
+
+ ///
+ /// Gets the collection of HTTP headers included in the response as key-value pairs.
+ ///
+ ///
+ /// The headers provide metadata about the response, such as content type, server, and other relevant information.
+ /// This property is represented as a read-only dictionary where the keys are the header names
+ /// and the values are the corresponding header values.
+ ///
IReadOnlyDictionary Headers { get; }
+
+ ///
+ /// Gets the HTTP status code associated with the response.
+ ///
+ ///
+ /// The status code indicates the outcome of the HTTP request, such as success, client error, or server error.
+ /// It conforms to the standardized status codes as defined in the enumeration.
+ ///
HttpStatusCode StatusCode { get; }
}
}
\ No newline at end of file
diff --git a/src/Http/ISubDBApi.cs b/src/Http/ISubDBApi.cs
index 5351883..6c07ff9 100644
--- a/src/Http/ISubDBApi.cs
+++ b/src/Http/ISubDBApi.cs
@@ -3,11 +3,39 @@
namespace SubDBSharp
{
+ ///
+ /// Interface for interacting with the SubDB API to perform operations related to subtitle management.
+ ///
public interface ISubDBApi
{
+ ///
+ /// Downloads a subtitle file based on the provided video hash and language preferences.
+ ///
+ /// A unique hash representing the video file, generated using a specific hash function.
+ /// A list of language codes indicating the preferred languages for the subtitle. The first matching language is returned.
+ /// A Task representing the asynchronous operation, containing the server's response to the subtitle download request.
Task DownloadSubtitle(string hash, params string[] languages);
+
+ ///
+ /// Retrieves a list of available languages supported by the SubDB API for subtitles.
+ ///
+ /// A Task representing the asynchronous operation, containing the server's response with the list of available languages.
Task GetAvailableLanguagesAsync();
+
+ ///
+ /// Searches for subtitles based on the hash of a video file, optionally returning the number of subtitle versions available per language.
+ ///
+ /// The hash of the video file, uniquely identifying it in the subtitle database.
+ /// Optional parameter to indicate whether to include the number of versions available for each subtitle language.
+ /// A Task representing the asynchronous operation, containing the server's response to the subtitle search request.
Task SearchSubtitle(string hash, bool getVersions = false);
+
+ ///
+ /// Uploads a subtitle file for a specific movie to the server.
+ ///
+ /// The content of the subtitle file being uploaded.
+ /// The movie identifier or hash that the subtitle is associated with.
+ /// A Task representing the asynchronous operation, containing the server's response to the upload request.
Task UploadSubtitle(string subtitle, string movie);
}
}
\ No newline at end of file
diff --git a/src/ISubDBClient.cs b/src/ISubDBClient.cs
index d3ffcec..efb6cf2 100644
--- a/src/ISubDBClient.cs
+++ b/src/ISubDBClient.cs
@@ -3,11 +3,46 @@
namespace SubDBSharp
{
+ ///
+ /// Defines methods for interacting with the SubDB API,
+ /// including operations for downloading, uploading, searching subtitles,
+ /// and retrieving available subtitle languages.
+ ///
public interface ISubDBClient
{
+ ///
+ /// Downloads the subtitle for a given video file based on its hash and specified language preferences.
+ ///
+ /// The hash of the video file, used to uniquely identify the video.
+ /// An array of language codes specifying the preferred subtitle language(s).
+ /// If multiple language codes are provided, the first available subtitle will be returned in the specified order.
+ /// A task that represents the asynchronous operation. The task result contains the server response,
+ /// including the subtitle content and its associated metadata.
Task DownloadSubtitleAsync(string hash, params string[] languages);
+
+ ///
+ /// Retrieves the list of all available subtitle languages currently supported in the SubDB database.
+ ///
+ /// A task that represents the asynchronous operation. The task result contains the server response,
+ /// including the list of available language codes.
Task GetAvailableLanguagesAsync();
+
+ ///
+ /// Searches for subtitles for a given video file based on its hash.
+ /// Optionally, retrieves additional information about the subtitle versions available.
+ ///
+ /// The hash of the video file used to uniquely identify the video.
+ /// A boolean indicating whether to return information about the number of subtitle versions per language available in the database.
+ /// A task that represents the asynchronous operation. The task result contains the server response, including available subtitles and their metadata if found.
Task SearchSubtitleAsync(string hash, bool getVersions);
+
+ ///
+ /// Uploads a subtitle file for a specific movie to the SubDB server.
+ ///
+ /// The subtitle content to be uploaded.
+ /// The movie name or identifier associated with the subtitle.
+ /// A task that represents the asynchronous operation. The task result contains the server response,
+ /// including status and any additional metadata related to the upload operation.
Task UploadSubtitleAsync(string subtitle, string movie);
}
}
\ No newline at end of file