mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
Add documentation to AudioResolver class
This commit is contained in:
parent
7b50048020
commit
6bbfcf1906
@ -18,12 +18,21 @@ using MediaBrowser.Model.MediaInfo;
|
|||||||
|
|
||||||
namespace MediaBrowser.Providers.MediaInfo
|
namespace MediaBrowser.Providers.MediaInfo
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Resolves external audios for videos.
|
||||||
|
/// </summary>
|
||||||
public class AudioResolver
|
public class AudioResolver
|
||||||
{
|
{
|
||||||
private readonly ILocalizationManager _localizationManager;
|
private readonly ILocalizationManager _localizationManager;
|
||||||
private readonly IMediaEncoder _mediaEncoder;
|
private readonly IMediaEncoder _mediaEncoder;
|
||||||
private readonly NamingOptions _namingOptions;
|
private readonly NamingOptions _namingOptions;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="AudioResolver"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="localizationManager">The localization manager.</param>
|
||||||
|
/// <param name="mediaEncoder">The media encoder.</param>
|
||||||
|
/// <param name="namingOptions">The naming options.</param>
|
||||||
public AudioResolver(
|
public AudioResolver(
|
||||||
ILocalizationManager localizationManager,
|
ILocalizationManager localizationManager,
|
||||||
IMediaEncoder mediaEncoder,
|
IMediaEncoder mediaEncoder,
|
||||||
@ -34,6 +43,15 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
_namingOptions = namingOptions;
|
_namingOptions = namingOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the audio streams found in the external audio files for the given video.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="video">The video to get the external audio streams from.</param>
|
||||||
|
/// <param name="startIndex">The stream index to start adding audio streams at.</param>
|
||||||
|
/// <param name="directoryService">The directory service to search for files.</param>
|
||||||
|
/// <param name="clearCache">True if the directory service cache should be cleared before searching.</param>
|
||||||
|
/// <param name="cancellationToken">The cancellation token to cancel operation.</param>
|
||||||
|
/// <returns>A list of external audio streams.</returns>
|
||||||
public async IAsyncEnumerable<MediaStream> GetExternalAudioStreams(
|
public async IAsyncEnumerable<MediaStream> GetExternalAudioStreams(
|
||||||
Video video,
|
Video video,
|
||||||
int startIndex,
|
int startIndex,
|
||||||
@ -83,6 +101,13 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the external audio file paths for the given video.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="video">The video to get the external audio file paths from.</param>
|
||||||
|
/// <param name="directoryService">The directory service to search for files.</param>
|
||||||
|
/// <param name="clearCache">True if the directory service cache should be cleared before searching.</param>
|
||||||
|
/// <returns>A list of external audio file paths.</returns>
|
||||||
public IEnumerable<string> GetExternalAudioFiles(
|
public IEnumerable<string> GetExternalAudioFiles(
|
||||||
Video video,
|
Video video,
|
||||||
IDirectoryService directoryService,
|
IDirectoryService directoryService,
|
||||||
@ -123,6 +148,12 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the media info of the given audio file.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The path to the audio file.</param>
|
||||||
|
/// <param name="cancellationToken">The cancellation token to cancel operation.</param>
|
||||||
|
/// <returns>The media info for the given audio file.</returns>
|
||||||
private Task<Model.MediaInfo.MediaInfo> GetMediaInfo(string path, CancellationToken cancellationToken)
|
private Task<Model.MediaInfo.MediaInfo> GetMediaInfo(string path, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
Loading…
Reference in New Issue
Block a user