111 lines
4.5 KiB
C#
111 lines
4.5 KiB
C#
using Modules.Library.Domain.Gateways;
|
|
|
|
namespace Modules.Library.Application.Services.MediaContent.CommonProperties;
|
|
|
|
public class CommonPropertiesService(ICommonPropertiesGateway commonPropertiesGateway, IGenreGateway genreGateway)
|
|
{
|
|
/*
|
|
|
|
public async Task SetNameValue(Guid commonPropertiesId, Guid nameId, string value)
|
|
{
|
|
var commonProperties = await GetCommonProperties(commonPropertiesId);
|
|
commonProperties.SetNameValue(nameId, value);
|
|
}
|
|
public async Task RemoveName(Guid commonPropertiesId, Guid nameId)
|
|
{
|
|
var commonProperties = await GetCommonProperties(commonPropertiesId);
|
|
commonProperties.RemoveName(nameId);
|
|
}
|
|
|
|
|
|
public async Task AddPreview(Guid commonPropertiesId, string url, MediaInfoType type)
|
|
{
|
|
var commonProperties = await GetCommonProperties(commonPropertiesId);
|
|
commonProperties.SetPreview(url, type);
|
|
}
|
|
public async Task EditPreview(Guid commonPropertiesId, string url, MediaInfoType type) =>
|
|
await AddPreview(commonPropertiesId, url, type);
|
|
public async Task DeletePreview(Guid commonPropertiesId)
|
|
{
|
|
var commonProperties = await GetCommonProperties(commonPropertiesId);
|
|
commonProperties.DeletePreview();
|
|
}
|
|
|
|
public async Task AddDescription(Guid commonPropertiesId, string value, bool isOriginal = false)
|
|
{
|
|
var commonProperties = await GetCommonProperties(commonPropertiesId);
|
|
switch (isOriginal)
|
|
{
|
|
case true:
|
|
commonProperties.AddOriginalDescription(value);
|
|
break;
|
|
default:
|
|
commonProperties.AddNotOriginalDescription(value);
|
|
break;
|
|
}
|
|
}
|
|
public async Task SetDescriptionValue(Guid commonPropertiesId, Guid descriptionId, string value)
|
|
{
|
|
var commonProperties = await GetCommonProperties(commonPropertiesId);
|
|
commonProperties.SetDescriptionValue(descriptionId, value);
|
|
}
|
|
public async Task RemoveDescription(Guid commonPropertiesId, Guid descriptionId)
|
|
{
|
|
var commonProperties = await GetCommonProperties(commonPropertiesId);
|
|
commonProperties.RemoveDescription(descriptionId);
|
|
}
|
|
|
|
public async Task AddGenre(Guid commonPropertiesId, Guid genreId, decimal? value = null)
|
|
{
|
|
var commonProperties = await GetCommonProperties(commonPropertiesId);
|
|
commonProperties.AddGenre(genreId, value);
|
|
}
|
|
public async Task SetGenreProportion(Guid commonPropertiesId, Guid genreProportionItemId, decimal? value = null)
|
|
{
|
|
var commonProperties = await GetCommonProperties(commonPropertiesId);
|
|
commonProperties.SetGenreProportion(genreProportionItemId, value);
|
|
}
|
|
public async Task RemoveGenre(Guid commonPropertiesId, Guid genreId)
|
|
{
|
|
var commonProperties = await GetCommonProperties(commonPropertiesId);
|
|
commonProperties.RemoveGenre(genreId);
|
|
}
|
|
|
|
public async Task AddRelatedContent(Guid commonPropertiesId, string url, MediaInfoType type)
|
|
{
|
|
var commonProperties = await GetCommonProperties(commonPropertiesId);
|
|
commonProperties.AddRelatedContent(url, type);
|
|
}
|
|
public async Task EditRelatedContent(Guid commonPropertiesId, Guid relatedContentId, string url, MediaInfoType type)
|
|
{
|
|
var commonProperties = await GetCommonProperties(commonPropertiesId);
|
|
commonProperties.EditRelatedContent(relatedContentId, url, type);
|
|
}
|
|
public async Task RemoveRelatedContent(Guid commonPropertiesId, Guid relatedContentId)
|
|
{
|
|
var commonProperties = await GetCommonProperties(commonPropertiesId);
|
|
commonProperties.RemoveRelatedContent(relatedContentId);
|
|
}
|
|
|
|
public async Task SetAnnouncementDate(Guid commonPropertiesId, DateTimeOffset value)
|
|
{
|
|
var commonProperties = await GetCommonProperties(commonPropertiesId);
|
|
commonProperties.SetAnnouncementDate(value);
|
|
}
|
|
public async Task SetEstimatedReleaseDate(Guid commonPropertiesId, DateTimeOffset value)
|
|
{
|
|
var commonProperties = await GetCommonProperties(commonPropertiesId);
|
|
commonProperties.SetEstimatedReleaseDate(value);
|
|
}
|
|
public async Task SetReleaseDate(Guid commonPropertiesId, DateTimeOffset value)
|
|
{
|
|
var commonProperties = await GetCommonProperties(commonPropertiesId);
|
|
commonProperties.SetReleaseDate(value);
|
|
}
|
|
|
|
private async Task<Domain.Entities.MediaContent.CommonProperties.CommonProperties> GetCommonProperties(string commonPropertiesId)
|
|
{
|
|
return await commonPropertiesGateway.GetByMediaContentItemId(commonPropertiesId);
|
|
}
|
|
*/
|
|
} |