Skip to content

Commit dd0871b

Browse files
committed
Update 1.5.0.1
• Fixed missing insert value GotifyUrl • Updated Libs • Optimized Code
1 parent 3781dd7 commit dd0871b

File tree

7 files changed

+35
-20
lines changed

7 files changed

+35
-20
lines changed

.github/workflows/publish.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ jobs:
2727
uses: docker/setup-buildx-action@v3
2828
with:
2929
version: latest
30+
- name: Get version informations
31+
id: infos
32+
run: |
33+
versionGit=${{ steps.get-latest-tag.outputs.tag }}
34+
versionProject=v$(grep '<Version>' 'iGotify Notification Assist.csproj' | cut -d '>' -f2 | cut -d '<' -f1 | xargs)
35+
if [ "$versionGit" != "$versionProject" -a $(git tag | grep -c "$versionProject") -eq 0 ]; then
36+
echo "version=$versionProject" >> $GITHUB_OUTPUT
37+
echo "createtag=true" >> $GITHUB_OUTPUT
38+
exit 0
39+
fi
40+
echo "version=$versionGit" >> $GITHUB_OUTPUT
41+
echo "createtag=false" >> $GITHUB_OUTPUT
3042
- name: Login to GitHub Container Registry
3143
uses: docker/login-action@v1
3244
with:
@@ -36,11 +48,11 @@ jobs:
3648
- name: Run Buildx & Push Multi Arch for dev
3749
if: steps.extract_branch.outputs.branch == 'dev'
3850
run: |
39-
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t ghcr.io/androidseb25/igotify-notification-assist-dev:latest -f ./Dockerfile --provenance=false --sbom=false --output type=image,push=true .
51+
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t ghcr.io/androidseb25/igotify-notification-assist-dev:latest -t ghcr.io/androidseb25/igotify-notification-assist-dev:${{ steps.infos.outputs.version }} -f ./Dockerfile --provenance=false --sbom=false --output type=image,push=true .
4052
- name: Run Buildx & Push Multi Arch for public
4153
if: steps.extract_branch.outputs.branch != 'dev'
4254
run: |
43-
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t ghcr.io/androidseb25/igotify-notification-assist:latest -f ./Dockerfile --provenance=false --sbom=false --output type=image,push=true .
55+
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t ghcr.io/androidseb25/igotify-notification-assist:latest -t ghcr.io/androidseb25/igotify-notification-assist:${{ steps.infos.outputs.version }} -f ./Dockerfile --provenance=false --sbom=false --output type=image,push=true .
4456
- name: Gotify Notification SUCCESS
4557
if: success()
4658
uses: eikendev/gotify-action@master

Models/CustomHeaders.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ namespace iGotify_Notification_Assist.Models;
22

33
public class CustomHeaders
44
{
5-
public string Key { get; set; }
6-
public string Value { get; set; }
5+
public string? Key { get; set; }
6+
public string? Value { get; set; }
77
}

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[![Donate with PayPal](https://raw.githubusercontent.com/androidseb25/iGotify-Notification-Assistent/main/paypal-donate-icon-7_20.png)](https://www.paypal.com/donate/?hosted_button_id=VFSL9ZECRD6D6)
22
![Stars](https://img.shields.io/github/stars/androidseb25/iGotify-Notification-Assistent?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAEsWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS41LjAiPgogPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICB4bWxuczpleGlmPSJodHRwOi8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mprWV7qOQhSwSMOXF3gABy4D/RuXmxDhHcEUQQ+6d+2T+GA+JIjdYCT/1GoYwiWEVidh2PUjFt/yl+IiNMhcLEojdzwJERmR6BD4GpFdf63z6m2IhIeSFIoFMZ+0qVrwM4RlVbkKAeGDc9BMnk0YmmuOtKGoFkLtNebmJj4R3gDsdt6T8W+vnEAAAAASUVORK5CYII=)
33
[![Crowdin](https://badges.crowdin.net/igotify/localized.svg)](https://crowdin.com/project/igotify)
4-
[![Qodana](https://github.com/androidseb25/iGotify-Notification-Assistent/actions/workflows/code_quality.yml/badge.svg?branch=main)](https://github.com/androidseb25/iGotify-Notification-Assistent/actions/workflows/code_quality.yml)
54

65
# iGotify
76

Services/DatabaseService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static bool CreateDatebase(string path)
2525

2626
// Create a sample table
2727
const string createTableQuery =
28-
"create table if not exists Users (Uid integer primary key, ClientToken text not null, DeviceToken text not null, Headers text not null);";
28+
"create table if not exists Users (Uid integer primary key, ClientToken text not null, DeviceToken text not null, GotifyUrl text not null, Headers text not null);";
2929
dbConnection.Execute(createTableQuery);
3030

3131
// Perform other database operations as needed

Services/GotifySocketService.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void Init()
3737
isInit = isDbFileExists;
3838
}
3939

40-
public static async void KillWsThread(string clientToken)
40+
public static void KillWsThread(string clientToken)
4141
{
4242
if (_threadSockets != null)
4343
{
@@ -47,24 +47,24 @@ public static async void KillWsThread(string clientToken)
4747
try
4848
{
4949
// 1) Signal termination
50-
threadSocket.cts.Cancel();
50+
threadSocket.cts?.Cancel();
5151

5252
// 2) If you have a WebSocket, close it actively so that blocking reads wake up
5353
threadSocket.ws!.Stop();
5454

5555
// 3) Wait for thread end (short timeout so nothing hangs)
56-
if (threadSocket.thread.IsAlive)
56+
if (threadSocket.thread!.IsAlive)
5757
threadSocket.thread.Join(millisecondsTimeout: 500);
5858
}
5959
finally
6060
{
61-
threadSocket.cts.Dispose();
61+
threadSocket.cts?.Dispose();
6262
_threadSockets.Remove(threadSocket);
6363
}
6464
}
6565
}
6666

67-
public static async void KillAllWsThread()
67+
public static void KillAllWsThread()
6868
{
6969
if (_threadSockets != null)
7070
{
@@ -73,13 +73,13 @@ public static async void KillAllWsThread()
7373
try
7474
{
7575
// 1) Signal termination
76-
threadSocket.cts.Cancel();
76+
threadSocket.cts?.Cancel();
7777

7878
// 2) If you have a WebSocket, close it actively so that blocking reads wake up
7979
threadSocket.ws!.Stop();
8080

8181
// 3) Wait for thread end (short timeout so nothing hangs)
82-
if (threadSocket.thread.IsAlive)
82+
if (threadSocket.thread!.IsAlive)
8383
threadSocket.thread.Join(millisecondsTimeout: 500);
8484
}
8585
catch (Exception e)
@@ -88,7 +88,7 @@ public static async void KillAllWsThread()
8888
}
8989
finally
9090
{
91-
threadSocket.cts.Dispose();
91+
threadSocket.cts?.Dispose();
9292
}
9393
}
9494

@@ -136,7 +136,7 @@ public static void StartWsThread(Users user)
136136

137137
private static void StartWsConn(ThreadSocket threadSocket, Users user)
138138
{
139-
while (!threadSocket.cts.IsCancellationRequested)
139+
while (!threadSocket.cts!.IsCancellationRequested)
140140
{
141141
try
142142
{
@@ -170,7 +170,7 @@ private static void StartWsConn(ThreadSocket threadSocket, Users user)
170170

171171
private static void StartWsConn(ThreadSocket threadSocket, string gotifyServerUrl, string clientToken)
172172
{
173-
while (!threadSocket.cts.IsCancellationRequested)
173+
while (!threadSocket.cts!.IsCancellationRequested)
174174
{
175175
try
176176
{

Services/WebSockClient.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public void Start(string clientToken, bool isRestart = false)
3030
var client = new ClientWebSocket();
3131
foreach (var header in customHeaders)
3232
{
33+
if (header.Key == null || header.Value == null)
34+
continue;
3335
client.Options.SetRequestHeader(header.Key, header.Value);
3436
}
3537

iGotify Notification Assist.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<ImplicitUsings>enable</ImplicitUsings>
77
<InvariantGlobalization>true</InvariantGlobalization>
88
<RootNamespace>iGotify_Notification_Assist</RootNamespace>
9-
<AssemblyVersion>1.5.0.0</AssemblyVersion>
10-
<FileVersion>1.5.0.0</FileVersion>
11-
<Version>1.5.0.0</Version>
9+
<AssemblyVersion>1.5.0.1</AssemblyVersion>
10+
<FileVersion>1.5.0.1</FileVersion>
11+
<Version>1.5.0.1</Version>
1212
<LangVersion>default</LangVersion>
1313
</PropertyGroup>
1414

@@ -19,8 +19,10 @@
1919
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.8" />
2020
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.8" />
2121
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
22-
<PackageReference Include="Scalar.AspNetCore" Version="2.7.0" />
22+
<PackageReference Include="Scalar.AspNetCore" Version="2.7.2" />
2323
<PackageReference Include="secntfy.nuget" Version="1.0.5" />
24+
<PackageReference Include="System.Net.Http" Version="4.3.4" />
25+
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
2426
<PackageReference Include="Websocket.Client" Version="5.2.0" />
2527
</ItemGroup>
2628

0 commit comments

Comments
 (0)