diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 5063b28..8356db9 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -114,11 +114,11 @@ jobs: build-project: - if: github.event.pull_request.merged == true + #if: github.event.pull_request.merged == true name: Build dotNet strategy: matrix: - dotnet-version: [ '9.x' ] + dotnet-version: [ '10.x' ] kind: [ 'amd64', 'arm64', 'armv7' ] include: - kind: amd64 diff --git a/Models/DeviceModel.cs b/Models/DeviceModel.cs index 366708b..b08be2d 100644 --- a/Models/DeviceModel.cs +++ b/Models/DeviceModel.cs @@ -1,4 +1,5 @@ using iGotify_Notification_Assist.Services; +using Newtonsoft.Json; using SecNtfyNuGet; using Websocket.Client; using Environments = iGotify_Notification_Assist.Services.Environments; @@ -59,6 +60,6 @@ public async Task SendNotifications(GotifyMessage iGotifyMessage, WebsocketClien var ntfy = new SecNtfy(Environments.secNtfyUrl); var response = await ntfy.SendNotification(usr.DeviceToken, title, msg, iGotifyMessage.priority == 10, imageUrl, iGotifyMessage.priority); - Console.WriteLine(response); + Console.WriteLine(response != null ? JsonConvert.SerializeObject(response) : "Notification response is null"); } } \ No newline at end of file diff --git a/Services/GotifySocketService.cs b/Services/GotifySocketService.cs index a261973..1e0d112 100644 --- a/Services/GotifySocketService.cs +++ b/Services/GotifySocketService.cs @@ -261,7 +261,7 @@ public async void Start() var statusNtfyList = secntfyTokenList.Count == 0 ? "empty" : "filled"; Console.WriteLine($"SecNtfy Token list is: {statusNtfyList}"); Console.WriteLine( - $"If one or more lists are empty please check the environment variable! GOTIFY_SERVERS or GOTIFY_CLIENTS or NTFY_TOKENS"); + $"If one or more lists are empty please check the environment variable! GOTIFY_URLS or GOTIFY_CLIENT_TOKENS or SECNTFY_TOKENS"); Console.WriteLine( $"If all lists are empty do nothing, you will configure the gotify server over the iGotify app."); } @@ -271,7 +271,7 @@ public async void Start() StartConnection(userList, secntfyUrl); } - private void StartConnection(List userList, string secntfyUrl) + private async void StartConnection(List userList, string secntfyUrl) { foreach (var user in userList) { @@ -279,7 +279,7 @@ private void StartConnection(List userList, string secntfyUrl) string isSecNtfyAvailable; try { - isGotifyAvailable = SecNtfy.CheckIfUrlReachable(user.GotifyUrl) ? "yes" : "no"; + isGotifyAvailable = await SecNtfy.CheckIfUrlReachable(user.GotifyUrl) ? "yes" : "no"; if (isGotifyAvailable == "no") { @@ -296,7 +296,7 @@ private void StartConnection(List userList, string secntfyUrl) try { - bool isSecNtfyAvailableBool = SecNtfy.CheckIfUrlReachable(secntfyUrl); + bool isSecNtfyAvailableBool = await SecNtfy.CheckIfUrlReachable(secntfyUrl); isSecNtfyAvailable = isSecNtfyAvailableBool ? "yes" : "no"; if (!isSecNtfyAvailableBool) diff --git a/iGotify Notification Assist.csproj b/iGotify Notification Assist.csproj index 389b8a9..a2ea6c5 100644 --- a/iGotify Notification Assist.csproj +++ b/iGotify Notification Assist.csproj @@ -6,20 +6,20 @@ enable true iGotify_Notification_Assist - 1.5.1.2 - 1.5.1.2 - 1.5.1.2 + 1.5.1.3 + 1.5.1.3 + 1.5.1.3 default - - + + - - + +