mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-27 10:07:10 +00:00
21 lines
No EOL
518 B
C#
21 lines
No EOL
518 B
C#
using System.IO;
|
|
|
|
namespace NzbDrone.Api.Frontend
|
|
{
|
|
public interface IMapHttpRequestsToDisk
|
|
{
|
|
string Map(string resourceUrl);
|
|
}
|
|
|
|
public class StaticResourceMapper : IMapHttpRequestsToDisk
|
|
{
|
|
public string Map(string resourceUrl)
|
|
{
|
|
var path = resourceUrl.Replace('/', Path.DirectorySeparatorChar);
|
|
path = path.Trim(Path.DirectorySeparatorChar).ToLower();
|
|
|
|
|
|
return Path.Combine(Directory.GetCurrentDirectory(), "ui", path);
|
|
}
|
|
}
|
|
} |