feat(stream): add streaming endpoint and indicator

This commit is contained in:
2026-06-20 16:21:18 +01:00
parent 2b1f8ce710
commit a0efa3eb8c
9 changed files with 82 additions and 12 deletions

View File

@@ -85,9 +85,14 @@ public class StreamService {
streamRepository.saveAndFlush(stream);
}
public Optional<Stream> getActiveStream(String streamKey) {
User user = resolveUser(streamKey);
return streamRepository.findByUserAndEndDateIsNull(user);
public Optional<Stream> getActiveStream() {
Optional<User> user = userService.getLoggedInUser();
if (user.isEmpty()) {
throw new NotAuthenticated("Log in to see user streams");
}
return streamRepository.findByUserAndEndDateIsNull(user.get());
}
public List<Stream> getStreamHistory(Long userId) {

View File

@@ -28,7 +28,6 @@ public class UserService {
private final UserRepository userRepository;
private final JwtService jwtService;
public UserService(UserRepository userRepository,
JwtService jwtService,
@Value("${google.client.id}") String googleClientId) {