mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 23:55:10 -05:00
Split monolithic MusicModels.cs (177 lines) into separate files: - Models/Settings/ (DeezerSettings, QobuzSettings, SubsonicSettings) - Models/Domain/ (Song, Album, Artist) - Models/Search/ (SearchResult) - Models/Download/ (DownloadInfo, DownloadStatus) - Models/Subsonic/ (ScanStatus) Updated namespaces and imports across 22 files. Improves navigation and separates models by business context.
50 lines
2.1 KiB
C#
50 lines
2.1 KiB
C#
using octo_fiesta.Models.Domain;
|
|
using octo_fiesta.Models.Settings;
|
|
using octo_fiesta.Models.Download;
|
|
using octo_fiesta.Models.Search;
|
|
using octo_fiesta.Models.Subsonic;
|
|
|
|
namespace octo_fiesta.Services;
|
|
|
|
/// <summary>
|
|
/// Interface for the music download service (Deezspot or other)
|
|
/// </summary>
|
|
public interface IDownloadService
|
|
{
|
|
/// <summary>
|
|
/// Downloads a song from an external provider
|
|
/// </summary>
|
|
/// <param name="externalProvider">The provider (deezer, spotify)</param>
|
|
/// <param name="externalId">The ID on the external provider</param>
|
|
/// <param name="cancellationToken">Cancellation token</param>
|
|
/// <returns>The path to the downloaded file</returns>
|
|
Task<string> DownloadSongAsync(string externalProvider, string externalId, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Downloads a song and streams the result progressively
|
|
/// </summary>
|
|
/// <param name="externalProvider">The provider (deezer, spotify)</param>
|
|
/// <param name="externalId">The ID on the external provider</param>
|
|
/// <param name="cancellationToken">Cancellation token</param>
|
|
/// <returns>A stream of the audio file</returns>
|
|
Task<Stream> DownloadAndStreamAsync(string externalProvider, string externalId, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Downloads remaining tracks from an album in background (excluding the specified track)
|
|
/// </summary>
|
|
/// <param name="externalProvider">The provider (deezer, spotify)</param>
|
|
/// <param name="albumExternalId">The album ID on the external provider</param>
|
|
/// <param name="excludeTrackExternalId">The track ID to exclude (already downloaded)</param>
|
|
void DownloadRemainingAlbumTracksInBackground(string externalProvider, string albumExternalId, string excludeTrackExternalId);
|
|
|
|
/// <summary>
|
|
/// Checks if a song is currently being downloaded
|
|
/// </summary>
|
|
DownloadInfo? GetDownloadStatus(string songId);
|
|
|
|
/// <summary>
|
|
/// Checks if the service is properly configured and functional
|
|
/// </summary>
|
|
Task<bool> IsAvailableAsync();
|
|
}
|