mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-27 10:07:10 +00:00
25 lines
No EOL
739 B
C#
25 lines
No EOL
739 B
C#
using System.IO;
|
|
using NzbDrone.Common;
|
|
|
|
namespace NzbDrone.Api.Frontend
|
|
{
|
|
public class MediaCoverMapper : IMapHttpRequestsToDisk
|
|
{
|
|
private readonly IEnvironmentProvider _environmentProvider;
|
|
|
|
public MediaCoverMapper(IEnvironmentProvider environmentProvider)
|
|
{
|
|
_environmentProvider = environmentProvider;
|
|
}
|
|
|
|
public string Map(string resourceUrl)
|
|
{
|
|
var path = resourceUrl.Replace('/', Path.DirectorySeparatorChar);
|
|
path = path.Trim(Path.DirectorySeparatorChar).ToLower();
|
|
|
|
return Path.Combine(_environmentProvider.GetAppDataPath(), path);
|
|
}
|
|
|
|
public RequestType IHandle { get { return RequestType.MediaCovers; } }
|
|
}
|
|
} |