mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Posters/Banners/Fanart served from App_Data
This commit is contained in:
parent
16e00d77ca
commit
16e13e0c24
7 changed files with 72 additions and 28 deletions
25
NzbDrone.Api/Frontend/MediaCoverMapper.cs
Normal file
25
NzbDrone.Api/Frontend/MediaCoverMapper.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
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; } }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue