feat: basic initial implementation of spotify client link validator and song submission form refs: NOISSUE
Some checks failed
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 1m3s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been skipped
SonarQube Scan / SonarQube Trigger (push) Failing after 4m47s

This commit is contained in:
Simon Diesenreiter
2025-05-30 22:51:44 +02:00
parent 010316aa70
commit dbd83ebb6a
24 changed files with 485 additions and 35 deletions

View File

@@ -7,8 +7,13 @@ public class SignalIntegration
{
public static SignalIntegration? Instance;
private readonly ILogger logger;
public SignalIntegration(string uri, int port, string phoneNumber)
{
using ILoggerFactory factory = LoggerFactory.Create(builder => builder.AddConsole().SetMinimumLevel(LogLevel.Information));
this.logger = factory.CreateLogger("SignalIntegration");
var http = new HttpClient()
{
BaseAddress = new Uri(uri + ":" + port)
@@ -24,17 +29,19 @@ public class SignalIntegration
public async Task ListGroupsAsync()
{
logger.LogDebug("Listing all groups for phone number: {PhoneNumber}", this.phoneNumber);
try
{
ICollection<song_of_the_day.GroupEntry> groupEntries = await apiClient.GroupsAllAsync(this.phoneNumber);
foreach (var group in groupEntries)
{
Console.WriteLine($"{group.Name} {group.Id}");
logger.LogDebug($" {group.Name} {group.Id}");
}
}
catch (Exception ex)
{
Console.WriteLine("Exception (ListGroupsAsync): " + ex.Message);
logger.LogError("Exception (ListGroupsAsync): " + ex.Message);
}
}
@@ -52,7 +59,7 @@ public class SignalIntegration
}
catch (Exception ex)
{
Console.WriteLine("Exception (SendMessageToGroupAsync): " + ex.Message);
logger.LogError("Exception (SendMessageToGroupAsync): " + ex.Message);
}
}
@@ -70,7 +77,7 @@ public class SignalIntegration
}
catch (Exception ex)
{
Console.WriteLine("Exception (SendMessageToUserAsync): " + ex.Message);
logger.LogError("Exception (SendMessageToUserAsync): " + ex.Message);
}
}
@@ -97,7 +104,7 @@ public class SignalIntegration
}
catch (Exception ex)
{
Console.WriteLine("Exception (GetMemberListAsync): " + ex.Message);
logger.LogError("Exception (GetMemberListAsync): " + ex.Message);
}
return new List<string>();
}
@@ -117,7 +124,7 @@ public class SignalIntegration
}
catch (Exception ex)
{
Console.WriteLine("Exception (GetContactAsync): " + ex.Message);
logger.LogError("Exception (GetContactAsync): " + ex.Message);
return new ListContactsResponse();
}
}