//using Modules.Library.Application.Models.Anime;
//using Modules.Library.Domain.Models;

//namespace Modules.Library.Application.Queries.Converters;

//internal class AnimeEpisodeConverter
//{
//    private readonly CommonPropertiesConverter _commonPropertiesConverter;

//    internal AnimeEpisodeConverter(CommonPropertiesConverter commonPropertiesConverter)
//    {
//        _commonPropertiesConverter = commonPropertiesConverter;
//    }
//    /*
//    internal async Task<AnimeEpisodeBuilder> GetBuilder(AnimeEpisode episode)
//    {
//        var episodeBuilder = new AnimeEpisodeBuilder();
//        episodeBuilder
//            .SetType((Domain.Entities.MediaContent.Items.Anime.AnimeEpisodeType)episode.Type)
//            .SetVariant(episode.Variant)
//            .SetOrder(episode.Order)
//            .SetNumber(episode.Number)
//            .SetCommonProperties(await _commonPropertiesConverter.GetBuilder(episode.CommonProperties))
//            .SetExpirationTime(episode.ExpirationTime);
//        if (episode.Deleted) episodeBuilder.Deleted();
//        if (episode.Completed) episodeBuilder.Completed();
//        if (!episode.IsTransient()) episodeBuilder.SetId(episode.Id);
//        return episodeBuilder;
//    }
//    */
//    internal async Task<Episode> Convert(AnimeEpisode episode)
//    {
//        return new Domain.Models.AnimeEpisode
//        {
//            Id = episode.Id,
//            Deleted = episode.Deleted,
//            Completed = episode.Completed,

//            CommonProperties = await _commonPropertiesConverter.Convert(episode.CommonProperties),
//            Number = episode.Number,
//            Order = episode.Order,
//            Variant = episode.Variant,
//            ExpirationTime = episode.ExpirationTime,

//            Type = (Domain.Entities.MediaContent.Items.Anime.AnimeEpisodeType)episode.Type,
//            Duration = episode.Duration,
//        };
//    }

//    internal AnimeEpisode Convert(Domain.Entities.MediaContent.Items.Anime.AnimeEpisode episode)
//    {
//        var dbEpisode = new AnimeEpisode
//        {
//            Type = (AnimeEpisodeType)episode.Type,
//            CommonProperties = _commonPropertiesConverter.Convert(episode.CommonProperties),
//            Order = episode.Order,
//            Variant = episode.Variant,
//            Number = episode.Number,
//            Completed = episode.Completed,
//            Deleted = episode.Deleted,
//            ExpirationTime = episode.ExpirationTime,
//        };
//        if (!episode.IsTransient()) dbEpisode.Id = episode.Id;
//        return dbEpisode;

//    }
//}