mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-10 07:58:39 -05:00
- Add MusicModels (Song, Artist, Album, SearchResult, DownloadInfo) - Add IMusicMetadataService and DeezerMetadataService for external search - Add IDownloadService and DeezspotDownloadService for downloads - Add LocalLibraryService for managing downloaded songs cache - Add custom endpoints: search3, stream, getSong, getAlbum, getCoverArt - Configure dependency injection for all services
38 lines
1.5 KiB
C#
38 lines
1.5 KiB
C#
using octo_fiesta.Models;
|
|
|
|
namespace octo_fiesta.Services;
|
|
|
|
/// <summary>
|
|
/// Interface pour le service de téléchargement de musique (Deezspot ou autre)
|
|
/// </summary>
|
|
public interface IDownloadService
|
|
{
|
|
/// <summary>
|
|
/// Télécharge une chanson depuis un provider externe
|
|
/// </summary>
|
|
/// <param name="externalProvider">Le provider (deezer, spotify)</param>
|
|
/// <param name="externalId">L'ID sur le provider externe</param>
|
|
/// <param name="cancellationToken">Token d'annulation</param>
|
|
/// <returns>Le chemin du fichier téléchargé</returns>
|
|
Task<string> DownloadSongAsync(string externalProvider, string externalId, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Télécharge une chanson et stream le résultat au fur et à mesure
|
|
/// </summary>
|
|
/// <param name="externalProvider">Le provider (deezer, spotify)</param>
|
|
/// <param name="externalId">L'ID sur le provider externe</param>
|
|
/// <param name="cancellationToken">Token d'annulation</param>
|
|
/// <returns>Un stream du fichier audio</returns>
|
|
Task<Stream> DownloadAndStreamAsync(string externalProvider, string externalId, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Vérifie si une chanson est en cours de téléchargement
|
|
/// </summary>
|
|
DownloadInfo? GetDownloadStatus(string songId);
|
|
|
|
/// <summary>
|
|
/// Vérifie si le service est correctement configuré et fonctionnel
|
|
/// </summary>
|
|
Task<bool> IsAvailableAsync();
|
|
}
|