Add editorconfig and analyzers, format backend code

This commit is contained in:
2026-09-24 04:54:17 +02:00
parent 87c3f97529
commit c8fe28b07b
367 changed files with 12179 additions and 12459 deletions
@@ -1,4 +1,3 @@
namespace Musify.Application.Contracts
{
public record AudioTranscodeResult(int StatusCode, TimeSpan Duration);
}
namespace Musify.Application.Contracts;
public record AudioTranscodeResult(int StatusCode, TimeSpan Duration);
@@ -1,9 +1,8 @@
namespace Musify.Application.Contracts
{
public interface IAudioTranscoderService
{
Task<AudioTranscodeResult> TranscodeToAudioFileAsync(Stream audioStream, string destinationPath, CancellationToken cancellationToken);
namespace Musify.Application.Contracts;
Task<bool> IsValidAudioFileAsync(string filePath, CancellationToken cancellationToken);
}
}
public interface IAudioTranscoderService
{
public Task<AudioTranscodeResult> TranscodeToAudioFileAsync(Stream audioStream, string destinationPath, CancellationToken cancellationToken);
public Task<bool> IsValidAudioFileAsync(string filePath, CancellationToken cancellationToken);
}
@@ -1,42 +1,41 @@
using Microsoft.EntityFrameworkCore;
using Musify.Domain.Entities;
namespace Musify.Application.Contracts
namespace Musify.Application.Contracts;
public interface IDatabase
{
public interface IDatabase
{
DbSet<User> Users { get; }
public DbSet<User> Users { get; }
DbSet<PlayList> PlayLists { get; }
public DbSet<PlayList> PlayLists { get; }
DbSet<Album> Albums { get; }
public DbSet<Album> Albums { get; }
DbSet<AlbumHasTrack> AlbumHasTracks { get; }
public DbSet<AlbumHasTrack> AlbumHasTracks { get; }
DbSet<Track> Tracks { get; }
public DbSet<Track> Tracks { get; }
DbSet<UserHasTrack> UserHasTracks { get; }
public DbSet<UserHasTrack> UserHasTracks { get; }
DbSet<PlayListHasTrack> PlayListHasTracks { get; }
public DbSet<PlayListHasTrack> PlayListHasTracks { get; }
DbSet<Mix> Mixes { get; }
public DbSet<Mix> Mixes { get; }
DbSet<MixItem> MixItems { get; }
public DbSet<MixItem> MixItems { get; }
DbSet<Upload> Uploads { get; }
public DbSet<Upload> Uploads { get; }
DbSet<UploadIntent> UploadIntents { get; }
public DbSet<UploadIntent> UploadIntents { get; }
DbSet<ListeningHistory> ListeningHistories { get; }
public DbSet<ListeningHistory> ListeningHistories { get; }
DbSet<TrackLike> TrackLikes { get; }
public DbSet<TrackLike> TrackLikes { get; }
DbSet<TrackTag> TrackTags { get; }
public DbSet<TrackTag> TrackTags { get; }
DbSet<UserFollow> UserFollows { get; }
public DbSet<UserFollow> UserFollows { get; }
Task<IDatabaseTransaction> BeginTransactionAsync(System.Data.IsolationLevel isolationLevel, CancellationToken cancellationToken);
public Task<IDatabaseTransaction> BeginTransactionAsync(System.Data.IsolationLevel isolationLevel, CancellationToken cancellationToken);
Task<int> SaveChangesAsync(CancellationToken cancellationToken);
}
}
public Task<int> SaveChangesAsync(CancellationToken cancellationToken);
}
@@ -1,7 +1,6 @@
namespace Musify.Application.Contracts
namespace Musify.Application.Contracts;
public interface IDatabaseTransaction : IAsyncDisposable
{
public interface IDatabaseTransaction : IAsyncDisposable
{
Task CommitAsync(CancellationToken cancellationToken = default);
}
public Task CommitAsync(CancellationToken cancellationToken = default);
}
@@ -1,7 +1,6 @@
namespace Musify.Application.Contracts
namespace Musify.Application.Contracts;
public interface IEventBus
{
public interface IEventBus
{
Task PublishAsync<T>(T message, CancellationToken cancellationToken) where T : class;
}
}
public Task PublishAsync<T>(T message, CancellationToken cancellationToken) where T : class;
}
@@ -1,7 +1,6 @@
namespace Musify.Application.Contracts
namespace Musify.Application.Contracts;
public interface IPictureService
{
public interface IPictureService
{
Task<Stream> ResizePictureAsWebpAsync(Stream pictureStream, int width, int height, CancellationToken cancellationToken);
}
}
public Task<Stream> ResizePictureAsWebpAsync(Stream pictureStream, int width, int height, CancellationToken cancellationToken);
}
@@ -1,28 +1,27 @@
namespace Musify.Application.Contracts
namespace Musify.Application.Contracts;
public interface IStorageService
{
public interface IStorageService
{
Task<Stream> GetFileAsync(string bucket, string key, CancellationToken cancellationToken);
public Task<Stream> GetFileAsync(string bucket, string key, CancellationToken cancellationToken);
Task<ObjectMetaData?> HeadObjectAsync(string bucket, string key, CancellationToken cancellationToken);
public Task<ObjectMetaData?> HeadObjectAsync(string bucket, string key, CancellationToken cancellationToken);
Task<string> GetUrlAsync(string bucket, string key, TimeSpan ExpirationTime, CancellationToken cancellationToken);
public Task<string> GetUrlAsync(string bucket, string key, TimeSpan ExpirationTime, CancellationToken cancellationToken);
Task<string> GetUploadUrlAsync(string bucket, string key, string contentType, TimeSpan expirationTime, CancellationToken cancellationToken, bool preventOverwrite = true);
public Task<string> GetUploadUrlAsync(string bucket, string key, string contentType, TimeSpan expirationTime, CancellationToken cancellationToken, bool preventOverwrite = true);
Task UploadFileAsync(string filePath, string bucket, string key, CancellationToken cancellationToken);
public Task UploadFileAsync(string filePath, string bucket, string key, CancellationToken cancellationToken);
Task UploadFileAsync(Stream sourceStream, string contentType, string bucket, string key, CancellationToken cancellationToken);
public Task UploadFileAsync(Stream sourceStream, string contentType, string bucket, string key, CancellationToken cancellationToken);
Task<IReadOnlyList<string>> TransferFilesAsync(string sourceDirectory, string bucket, string route, CancellationToken cancellationToken);
public Task<IReadOnlyList<string>> TransferFilesAsync(string sourceDirectory, string bucket, string route, CancellationToken cancellationToken);
Task RemoveFileAsync(string bucket, string key, CancellationToken cancellationToken);
public Task RemoveFileAsync(string bucket, string key, CancellationToken cancellationToken);
Task CopyFileAsync(string sourceBucket, string sourceKey, string destinationBucket, string destinationKey,
CancellationToken cancellationToken);
public Task CopyFileAsync(string sourceBucket, string sourceKey, string destinationBucket, string destinationKey,
CancellationToken cancellationToken);
Task RemoveFolderAsync(string bucket, string folderKey, CancellationToken cancellationToken);
IAsyncEnumerable<StorageObject> ListObjectsAsync(string bucket, string prefix, CancellationToken cancellationToken);
}
}
public Task RemoveFolderAsync(string bucket, string folderKey, CancellationToken cancellationToken);
public IAsyncEnumerable<StorageObject> ListObjectsAsync(string bucket, string prefix, CancellationToken cancellationToken);
}
@@ -1,10 +1,8 @@
namespace Musify.Application.Contracts
namespace Musify.Application.Contracts;
public interface IStreamTicketService
{
public interface IStreamTicketService
{
StreamTicket IssueTicket(long? userId, string keyPrefix, long? maxBytes = null);
}
public record StreamTicket(string Token, int ExpiresInSeconds);
public StreamTicket IssueTicket(long? userId, string keyPrefix, long? maxBytes = null);
}
public record StreamTicket(string Token, int ExpiresInSeconds);
@@ -1,4 +1,3 @@
namespace Musify.Application.Contracts
{
public record ObjectMetaData(string ContentType, long ContentLength);
}
namespace Musify.Application.Contracts;
public record ObjectMetaData(string ContentType, long ContentLength);
@@ -1,4 +1,3 @@
namespace Musify.Application.Contracts
{
public record StorageObject(string Key, DateTime LastModifiedUtc);
}
namespace Musify.Application.Contracts;
public record StorageObject(string Key, DateTime LastModifiedUtc);