-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1577 from mregni/develop
New release
- Loading branch information
Showing
413 changed files
with
35,305 additions
and
27,327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: nuget | ||
directory: "/EmbyStat.Web" | ||
schedule: | ||
interval: daily | ||
time: "04:00" | ||
open-pull-requests-limit: 10 | ||
ignore: | ||
- dependency-name: MediaBrowser.Common | ||
versions: | ||
- "> 3.3.10, < 4" | ||
- dependency-name: Hangfire.AspNetCore | ||
versions: | ||
- 1.7.19 | ||
- 1.7.20 | ||
- 1.7.21 | ||
- dependency-name: Swashbuckle.AspNetCore | ||
versions: | ||
- 5.6.3 | ||
- 6.0.2 | ||
- 6.0.4 | ||
- 6.0.5 | ||
- 6.0.7 | ||
- 6.1.0 | ||
- 6.1.1 | ||
- 6.1.2 | ||
- dependency-name: Rollbar.PlugIns.NLog | ||
versions: | ||
- 3.14.1 | ||
- 4.0.0 | ||
- 4.0.1 | ||
- 4.0.2 | ||
- dependency-name: Rollbar.NetCore.AspNet | ||
versions: | ||
- 3.14.1 | ||
- 4.0.0 | ||
- 4.0.1 | ||
- 4.0.2 | ||
- dependency-name: DevExtreme.AspNet.Data | ||
versions: | ||
- 2.8.0 | ||
- 2.8.1 | ||
- dependency-name: Microsoft.AspNetCore.Authentication.JwtBearer | ||
versions: | ||
- 5.0.2 | ||
- 5.0.3 | ||
- 5.0.4 | ||
- dependency-name: Microsoft.AspNetCore.SpaServices.Extensions | ||
versions: | ||
- 5.0.2 | ||
- 5.0.3 | ||
- 5.0.4 | ||
- package-ecosystem: nuget | ||
directory: "/Updater" | ||
schedule: | ||
interval: daily | ||
time: "04:00" | ||
open-pull-requests-limit: 10 | ||
ignore: | ||
- dependency-name: NLog.Web.AspNetCore | ||
versions: | ||
- 4.10.0 | ||
- 4.11.0 | ||
- package-ecosystem: nuget | ||
directory: "/Tests.Unit" | ||
schedule: | ||
interval: daily | ||
time: "04:00" | ||
open-pull-requests-limit: 10 | ||
ignore: | ||
- dependency-name: MediaBrowser.Common | ||
versions: | ||
- "> 3.3.10, < 4" | ||
- dependency-name: Hangfire.AspNetCore | ||
versions: | ||
- 1.7.19 | ||
- 1.7.20 | ||
- 1.7.21 | ||
- dependency-name: Swashbuckle.AspNetCore | ||
versions: | ||
- 5.6.3 | ||
- 6.0.2 | ||
- 6.0.4 | ||
- 6.0.5 | ||
- 6.0.7 | ||
- 6.1.0 | ||
- 6.1.1 | ||
- 6.1.2 | ||
- dependency-name: Rollbar.NetCore.AspNet | ||
versions: | ||
- 3.14.1 | ||
- 4.0.0 | ||
- 4.0.1 | ||
- 4.0.2 | ||
- dependency-name: Rollbar.PlugIns.NLog | ||
versions: | ||
- 3.14.1 | ||
- 4.0.0 | ||
- 4.0.1 | ||
- 4.0.2 | ||
- dependency-name: DevExtreme.AspNet.Data | ||
versions: | ||
- 2.8.0 | ||
- 2.8.1 | ||
- dependency-name: Microsoft.AspNetCore.Authentication.JwtBearer | ||
versions: | ||
- 5.0.2 | ||
- 5.0.3 | ||
- 5.0.4 | ||
- dependency-name: Microsoft.AspNetCore.SpaServices.Extensions | ||
versions: | ||
- 5.0.2 | ||
- 5.0.3 | ||
- 5.0.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Diagnostics; | ||
using System.Net; | ||
using System.Net.Sockets; | ||
using System.Text; | ||
using EmbyStat.Common.Models; | ||
using Newtonsoft.Json; | ||
|
||
namespace EmbyStat.Clients.Base.Http | ||
{ | ||
public class ServerSearcher : IDisposable | ||
{ | ||
private readonly UdpClient _client; | ||
public bool isDisposed { get; set; } | ||
private IPEndPoint _to; | ||
public event EventHandler<MediaServerUdpBroadcast> MediaServerFound; | ||
|
||
public ServerSearcher(IPEndPoint to) | ||
{ | ||
isDisposed = false; | ||
_to = to; | ||
var from = new IPEndPoint(0, 0); | ||
_client = new UdpClient { EnableBroadcast = true, MulticastLoopback = true }; | ||
_client.Client.Bind(from); | ||
_client.BeginReceive(OnMessageReceived, null); | ||
} | ||
|
||
public void Send(string message) | ||
{ | ||
var requestData = Encoding.ASCII.GetBytes(message); | ||
try | ||
{ | ||
_client.Send(requestData, requestData.Length, _to); | ||
} | ||
catch (Exception) | ||
{ | ||
//swallowing failed calls | ||
} | ||
|
||
} | ||
|
||
private void OnMessageReceived(IAsyncResult ar) | ||
{ | ||
if (!isDisposed) | ||
{ | ||
var receiveBytes = _client.EndReceive(ar, ref _to); | ||
var receiveString = Encoding.ASCII.GetString(receiveBytes); | ||
|
||
var udpBroadcastResult = JsonConvert.DeserializeObject<MediaServerUdpBroadcast>(receiveString); | ||
|
||
MediaServerFound?.Invoke(this, udpBroadcastResult); | ||
_client.BeginReceive(OnMessageReceived, null); | ||
} | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
isDisposed = true; | ||
_client?.Dispose(); | ||
} | ||
} | ||
} |
Oops, something went wrong.