mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-22 05:30:46 +02:00
add EndPointInfo class
This commit is contained in:
parent
b5bfb46760
commit
d05f32d1b6
|
@ -13,6 +13,7 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using CommonIO;
|
using CommonIO;
|
||||||
|
using MediaBrowser.Model.Net;
|
||||||
|
|
||||||
namespace MediaBrowser.Api.System
|
namespace MediaBrowser.Api.System
|
||||||
{
|
{
|
||||||
|
@ -65,7 +66,7 @@ namespace MediaBrowser.Api.System
|
||||||
|
|
||||||
[Route("/System/Endpoint", "GET", Summary = "Gets information about the request endpoint")]
|
[Route("/System/Endpoint", "GET", Summary = "Gets information about the request endpoint")]
|
||||||
[Authenticated]
|
[Authenticated]
|
||||||
public class GetEndpointInfo : IReturn<EndpointInfo>
|
public class GetEndpointInfo : IReturn<EndPointInfo>
|
||||||
{
|
{
|
||||||
public string Endpoint { get; set; }
|
public string Endpoint { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -210,17 +211,11 @@ namespace MediaBrowser.Api.System
|
||||||
|
|
||||||
public object Get(GetEndpointInfo request)
|
public object Get(GetEndpointInfo request)
|
||||||
{
|
{
|
||||||
return ToOptimizedResult(new EndpointInfo
|
return ToOptimizedResult(new EndPointInfo
|
||||||
{
|
{
|
||||||
IsLocal = Request.IsLocal,
|
IsLocal = Request.IsLocal,
|
||||||
IsInNetwork = _network.IsInLocalNetwork(request.Endpoint ?? Request.RemoteIp)
|
IsInNetwork = _network.IsInLocalNetwork(request.Endpoint ?? Request.RemoteIp)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class EndpointInfo
|
|
||||||
{
|
|
||||||
public bool IsLocal { get; set; }
|
|
||||||
public bool IsInNetwork { get; set; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -827,6 +827,9 @@
|
||||||
<Compile Include="..\MediaBrowser.Model\MediaInfo\VideoCodec.cs">
|
<Compile Include="..\MediaBrowser.Model\MediaInfo\VideoCodec.cs">
|
||||||
<Link>MediaInfo\VideoCodec.cs</Link>
|
<Link>MediaInfo\VideoCodec.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="..\MediaBrowser.Model\Net\EndPointInfo.cs">
|
||||||
|
<Link>Net\EndPointInfo.cs</Link>
|
||||||
|
</Compile>
|
||||||
<Compile Include="..\MediaBrowser.Model\Net\HttpException.cs">
|
<Compile Include="..\MediaBrowser.Model\Net\HttpException.cs">
|
||||||
<Link>Net\HttpException.cs</Link>
|
<Link>Net\HttpException.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|
|
@ -783,6 +783,9 @@
|
||||||
<Compile Include="..\MediaBrowser.Model\MediaInfo\VideoCodec.cs">
|
<Compile Include="..\MediaBrowser.Model\MediaInfo\VideoCodec.cs">
|
||||||
<Link>MediaInfo\VideoCodec.cs</Link>
|
<Link>MediaInfo\VideoCodec.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="..\MediaBrowser.Model\Net\EndPointInfo.cs">
|
||||||
|
<Link>Net\EndPointInfo.cs</Link>
|
||||||
|
</Compile>
|
||||||
<Compile Include="..\MediaBrowser.Model\Net\HttpException.cs">
|
<Compile Include="..\MediaBrowser.Model\Net\HttpException.cs">
|
||||||
<Link>Net\HttpException.cs</Link>
|
<Link>Net\HttpException.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|
|
@ -162,6 +162,7 @@
|
||||||
<Compile Include="MediaInfo\MediaProtocol.cs" />
|
<Compile Include="MediaInfo\MediaProtocol.cs" />
|
||||||
<Compile Include="MediaInfo\SubtitleTrackEvent.cs" />
|
<Compile Include="MediaInfo\SubtitleTrackEvent.cs" />
|
||||||
<Compile Include="MediaInfo\SubtitleTrackInfo.cs" />
|
<Compile Include="MediaInfo\SubtitleTrackInfo.cs" />
|
||||||
|
<Compile Include="Net\EndPointInfo.cs" />
|
||||||
<Compile Include="Net\HttpResponse.cs" />
|
<Compile Include="Net\HttpResponse.cs" />
|
||||||
<Compile Include="Net\MimeTypes.cs" />
|
<Compile Include="Net\MimeTypes.cs" />
|
||||||
<Compile Include="Notifications\NotificationOption.cs" />
|
<Compile Include="Notifications\NotificationOption.cs" />
|
||||||
|
|
8
MediaBrowser.Model/Net/EndPointInfo.cs
Normal file
8
MediaBrowser.Model/Net/EndPointInfo.cs
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
namespace MediaBrowser.Model.Net
|
||||||
|
{
|
||||||
|
public class EndPointInfo
|
||||||
|
{
|
||||||
|
public bool IsLocal { get; set; }
|
||||||
|
public bool IsInNetwork { get; set; }
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue