Release Lunaris 2.0 customization update

This commit is contained in:
2026-05-26 12:45:46 +03:00
parent 9cff9e5307
commit f65efe7cf7
21 changed files with 514 additions and 189 deletions
+13 -12
View File
@@ -210,23 +210,24 @@ class ProviderManager {
Set<String> seen,
) {
final posts = <Post>[];
var index = 0;
while (true) {
var added = false;
for (final providerPosts in results) {
if (index >= providerPosts.length) continue;
final post = providerPosts[index];
if (seen.add(post.cacheKey)) {
posts.add(post);
added = true;
}
for (final providerPosts in results) {
for (final post in providerPosts) {
if (seen.add(post.cacheKey)) posts.add(post);
}
if (!added && results.every((items) => index >= items.length)) break;
index++;
}
posts.sort((a, b) => _mixKey(a).compareTo(_mixKey(b)));
return posts;
}
int _mixKey(Post post) {
var hash = 0x811c9dc5;
for (final code in post.cacheKey.codeUnits) {
hash ^= code;
hash = (hash * 0x01000193) & 0x7fffffff;
}
return hash;
}
Future<Result<List<PostComment>>> getComments(
String providerId,
String postId,