Skip to content

Commit a6b5a56

Browse files
Merge Dev stuff onto master. (#374)
* Update dependency io.sentry:sentry-spring-boot-starter-jakarta to v7.15.0 * Bump SQL * Start with v5 * Fix everything except Guild stuff I ain't fixing 1,7k lines of code rn gang. * Starts * Continues work on the silly async stuff for backend. * Continues work on the silly async stuff for backend. * ASYNC DONE LETS GO * Revert "Svelte 5" This reverts commit b1bd4f0. * Reapply "Svelte 5" This reverts commit e19eb10. * V5 should be done now. * Bump version * Bump version --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
1 parent b1bd4f0 commit a6b5a56

File tree

14 files changed

+1773
-1361
lines changed

14 files changed

+1773
-1361
lines changed

Backend/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<groupId>de.presti.ree6</groupId>
1414
<artifactId>Webinterface-Backend</artifactId>
15-
<version>4.0.17</version>
15+
<version>5.0.0</version>
1616
<name>Webinterface-Backend</name>
1717
<description>The Backend for the Webinterface</description>
1818

@@ -68,7 +68,7 @@
6868
<dependency>
6969
<groupId>de.ree6</groupId>
7070
<artifactId>Ree6-SQL</artifactId>
71-
<version>da620ec7a5</version>
71+
<version>3.0.0</version>
7272
</dependency>
7373

7474
<!-- Discord -->
@@ -88,7 +88,7 @@
8888
<dependency>
8989
<groupId>io.sentry</groupId>
9090
<artifactId>sentry-spring-boot-starter-jakarta</artifactId>
91-
<version>7.14.0</version>
91+
<version>7.15.0</version>
9292
</dependency>
9393

9494
<!-- Utilities -->

Backend/src/main/java/de/presti/ree6/backend/Server.java

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public Server(String[] args) {
8282
instance = this;
8383

8484
String tempVersion = getInstance().getClass().getPackage().getImplementationVersion();
85-
backendVersion = tempVersion == null ? "4.0.11" : tempVersion;
85+
backendVersion = tempVersion == null ? "5.0.0" : tempVersion;
8686
load(args);
8787
}
8888

@@ -178,32 +178,33 @@ public void load(String[] args) {
178178
Runtime.getRuntime().addShutdownHook(new Thread(this::onShutdown));
179179

180180
ThreadUtil.createNewThread(x -> {
181-
List<Recording> recordings = SQLSession.getSqlConnector().getSqlWorker().getEntityList(new Recording(), "FROM Recording", null);
182-
183-
if (recordings != null && !recordings.isEmpty()) {
184-
for (Recording recording : recordings) {
185-
if (recording.getCreation() < System.currentTimeMillis() - Duration.ofDays(1).toMillis()) {
186-
SQLSession.getSqlConnector().getSqlWorker().deleteEntity(recording);
181+
SQLSession.getSqlConnector().getSqlWorker().getEntityList(new Recording(), "FROM Recording", null).subscribe(recordings -> {
182+
if (recordings != null && !recordings.isEmpty()) {
183+
for (Recording recording : recordings) {
184+
if (recording.getCreation() < System.currentTimeMillis() - Duration.ofDays(1).toMillis()) {
185+
SQLSession.getSqlConnector().getSqlWorker().deleteEntity(recording).block();
186+
}
187187
}
188188
}
189-
}
189+
});
190190

191-
List<TwitchIntegration> twitchIntegrations = SQLSession.getSqlConnector().getSqlWorker().getEntityList(new TwitchIntegration(), "FROM TwitchIntegration", null);
192-
twitchIntegrations.forEach(twitchIntegration -> {
193-
if (twitchIntegration.getLastUpdated().getTime() + (twitchIntegration.getExpiresIn() * 1000L) - Duration.ofMinutes(10).toMillis() <= System.currentTimeMillis()) {
194-
Optional<OAuth2Credential> cred = twitchIdentityProvider.refreshCredential(CustomOAuth2Util.convertToOriginal(twitchIntegration));
191+
SQLSession.getSqlConnector().getSqlWorker().getEntityList(new TwitchIntegration(), "FROM TwitchIntegration", null).subscribe(twitchIntegrations -> {
192+
twitchIntegrations.forEach(twitchIntegration -> {
193+
if (twitchIntegration.getLastUpdated().getTime() + (twitchIntegration.getExpiresIn() * 1000L) - Duration.ofMinutes(10).toMillis() <= System.currentTimeMillis()) {
194+
Optional<OAuth2Credential> cred = twitchIdentityProvider.refreshCredential(CustomOAuth2Util.convertToOriginal(twitchIntegration));
195195

196-
credentialManager.getCredentials().removeIf(credential -> {
197-
if (credential instanceof CustomOAuth2Credential customOAuth2CredentialLocal) {
198-
return customOAuth2CredentialLocal.getDiscordId() == twitchIntegration.getUserId();
199-
}
200-
return false;
201-
});
196+
credentialManager.getCredentials().removeIf(credential -> {
197+
if (credential instanceof CustomOAuth2Credential customOAuth2CredentialLocal) {
198+
return customOAuth2CredentialLocal.getDiscordId() == twitchIntegration.getUserId();
199+
}
200+
return false;
201+
});
202202

203-
cred.ifPresent(oAuth2Credential -> credentialManager.addCredential("twitch", CustomOAuth2Util.convert(twitchIntegration.getUserId(), oAuth2Credential)));
204-
}
203+
cred.ifPresent(oAuth2Credential -> credentialManager.addCredential("twitch", CustomOAuth2Util.convert(twitchIntegration.getUserId(), oAuth2Credential)));
204+
}
205+
});
206+
credentialManager.save();
205207
});
206-
credentialManager.save();
207208
}, throwable -> log.error("Failed running Data clear Thread", throwable), Duration.ofMinutes(5), true, false);
208209
}
209210

Backend/src/main/java/de/presti/ree6/backend/WebConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class WebConfig implements WebMvcConfigurer {
1616
public void addCorsMappings(CorsRegistry registry) {
1717
log.info("Setting up CORS");
1818
String allowedDomain = Data.getAllowedDomains();
19-
log.info("Allowed Domain: " + allowedDomain);
19+
log.info("Allowed Domain: {}", allowedDomain);
2020
registry.addMapping("/**").allowedOriginPatterns(allowedDomain);
2121
}
2222
}

0 commit comments

Comments
 (0)