mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-17 06:23:03 +03:00
Remove use of AddParts. Cleanup use of Lyric vs Lyrics.
This commit is contained in:
@@ -1,37 +1,23 @@
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Providers;
|
||||
|
||||
namespace MediaBrowser.Controller.Lyrics
|
||||
{
|
||||
public interface ILyricManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds the parts.
|
||||
/// </summary>
|
||||
/// <param name="lyricProviders">The lyric providers.</param>
|
||||
void AddParts(IEnumerable<ILyricProvider> lyricProviders);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the lyrics.
|
||||
/// </summary>
|
||||
/// <param name="item">The media item.</param>
|
||||
/// <returns>Lyrics for passed item.</returns>
|
||||
LyricResponse GetLyric(BaseItem item);
|
||||
LyricResponse GetLyrics(BaseItem item);
|
||||
|
||||
/// <summary>
|
||||
/// Checks if requested item has a matching local lyric file.
|
||||
/// </summary>
|
||||
/// <param name="item">The media item.</param>
|
||||
/// <returns>True if item has a matching lyrics file; otherwise false.</returns>
|
||||
/// <returns>True if item has a matching lyric file; otherwise false.</returns>
|
||||
bool HasLyricFile(BaseItem item);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ namespace MediaBrowser.Controller.Lyrics
|
||||
/// <summary>
|
||||
/// Gets the lyrics.
|
||||
/// </summary>
|
||||
/// <param name="item">The item to to process.</param>
|
||||
/// <returns>Task{LyricResponse}.</returns>
|
||||
/// <param name="item">The media item.</param>
|
||||
/// <returns>If found, returns lyrics for passed item; otherwise, null.</returns>
|
||||
LyricResponse? GetLyrics(BaseItem item);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
namespace MediaBrowser.Controller.Lyrics
|
||||
{
|
||||
/// <summary>
|
||||
/// Lyric dto.
|
||||
/// Lyric model.
|
||||
/// </summary>
|
||||
public class Lyric
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the start time (ticks).
|
||||
/// Gets or sets the start time in ticks.
|
||||
/// </summary>
|
||||
public double? Start { get; set; }
|
||||
|
||||
|
||||
@@ -11,16 +11,16 @@ using Microsoft.AspNetCore.Mvc;
|
||||
namespace MediaBrowser.Controller.Lyrics
|
||||
{
|
||||
/// <summary>
|
||||
/// Item helper.
|
||||
/// Lyric helper methods.
|
||||
/// </summary>
|
||||
public static class LyricInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Checks if requested item has a matching lyric file.
|
||||
/// Gets matching lyric file for a requested item.
|
||||
/// </summary>
|
||||
/// <param name="lyricProvider">The current lyricProvider interface.</param>
|
||||
/// <param name="lyricProvider">The lyricProvider interface to use.</param>
|
||||
/// <param name="itemPath">Path of requested item.</param>
|
||||
/// <returns>True if item has a matching lyrics file.</returns>
|
||||
/// <returns>Lyric file path if passed lyric provider's supported media type is found; otherwise, null.</returns>
|
||||
public static string? GetLyricFilePath(ILyricProvider lyricProvider, string itemPath)
|
||||
{
|
||||
if (lyricProvider.SupportedMediaTypes.Any())
|
||||
|
||||
@@ -6,10 +6,19 @@ using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Controller.Lyrics
|
||||
{
|
||||
/// <summary>
|
||||
/// LyricResponse model.
|
||||
/// </summary>
|
||||
public class LyricResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets MetaData.
|
||||
/// </summary>
|
||||
public IDictionary<string, object> MetaData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets Lyrics.
|
||||
/// </summary>
|
||||
public IEnumerable<Lyric> Lyrics { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user