You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Radarr/src/Radarr.Api.V3/Movies/RenameMovieResource.cs

40 lines
1.1 KiB

using System.Collections.Generic;
using System.Linq;
using NzbDrone.Core.MediaFiles;
using Radarr.Http.REST;
namespace Radarr.Api.V3.Movies
{
public class RenameMovieResource : RestResource
{
public int MovieId { get; set; }
public int MovieFileId { get; set; }
public string ExistingPath { get; set; }
public string NewPath { get; set; }
}
public static class RenameMovieResourceMapper
{
public static RenameMovieResource ToResource(this RenameMovieFilePreview model)
{
if (model == null)
{
return null;
}
return new RenameMovieResource
{
MovieId = model.MovieId,
MovieFileId = model.MovieFileId,
ExistingPath = model.ExistingPath,
NewPath = model.NewPath
};
}
public static List<RenameMovieResource> ToResource(this IEnumerable<RenameMovieFilePreview> models)
{
return models.Select(ToResource).ToList();
}
}
}