Fix for bug where subscriptions can't be fetched on fresh accounts. (#205)

This commit is contained in:
Kavin 2022-03-01 21:02:35 +00:00 committed by GitHub
parent 597e861159
commit 3d8d592768
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -26,7 +26,7 @@ public class DatabaseHelper {
CriteriaBuilder cb = s.getCriteriaBuilder();
CriteriaQuery<User> cr = cb.createQuery(User.class);
Root<User> root = cr.from(User.class);
root.fetch("subscribed_ids", JoinType.INNER);
root.fetch("subscribed_ids", JoinType.LEFT);
cr.select(root).where(cb.equal(root.get("sessionId"), session));
return s.createQuery(cr).uniqueResult();

View file

@ -628,7 +628,7 @@ public class ResponseHelper {
Multithreading.runAsync(() -> {
Session sess = DatabaseSessionFactory.createSession();
me.kavin.piped.utils.obj.db.Channel channel = DatabaseHelper.getChannelFromId(sess, channelId);
var channel = DatabaseHelper.getChannelFromId(sess, channelId);
if (channel == null) {
ChannelInfo info = null;
@ -866,7 +866,7 @@ public class ResponseHelper {
Session sess = DatabaseSessionFactory.createSession();
me.kavin.piped.utils.obj.db.Channel channel = DatabaseHelper.getChannelFromId(sess, channelId);
var channel = DatabaseHelper.getChannelFromId(sess, channelId);
if (channel == null) {
ChannelInfo info;