a fork of iceshrimp.net but a tweaked frontend to my personal liking. waow
fediverse social-media social iceshrimp fedi
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[backend/core] Refactor home timeline heuristic helper function

+8 -9
+8 -9
Iceshrimp.Backend/Core/Extensions/QueryableExtensions.cs
··· 241 241 // Determined empirically in 2023. Ask zotan for the spreadsheet if you're curious. 242 242 const int cutoff = 250; 243 243 244 - if (heuristic < cutoff) 245 - return query.Where(note => db.Users 246 - .First(p => p == user) 247 - .Following 248 - .Select(p => p.Id) 249 - .Concat(new[] { user.Id }) 250 - .Contains(note.UserId)); 251 - 252 - return query.Where(note => note.User == user || note.User.IsFollowedBy(user)); 244 + return heuristic < cutoff 245 + ? query.Where(note => db.Users 246 + .First(p => p == user) 247 + .Following 248 + .Select(p => p.Id) 249 + .Concat(new[] { user.Id }) 250 + .Contains(note.UserId)) 251 + : query.Where(note => note.User == user || note.User.IsFollowedBy(user)); 253 252 } 254 253 255 254 //TODO: move this into another class where it makes more sense