[backend/api] Rename recommended timeline to bubble timeline for improved clarity
This commit is contained in:
parent
2c3a9d49b1
commit
f1a1ed9039
6 changed files with 67 additions and 20 deletions
|
@ -80,13 +80,13 @@ public class TimelineController(DatabaseContext db, NoteRenderer noteRenderer, C
|
||||||
Filter.FilterContext.Public);
|
Filter.FilterContext.Public);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("recommended")]
|
[HttpGet("bubble")]
|
||||||
[ProducesResults(HttpStatusCode.OK)]
|
[ProducesResults(HttpStatusCode.OK)]
|
||||||
public async Task<IEnumerable<NoteResponse>> GetRecommendedTimeline(PaginationQuery pq)
|
public async Task<IEnumerable<NoteResponse>> GetBubbleTimeline(PaginationQuery pq)
|
||||||
{
|
{
|
||||||
var user = HttpContext.GetUserOrFail();
|
var user = HttpContext.GetUserOrFail();
|
||||||
var notes = await db.Notes.IncludeCommonProperties()
|
var notes = await db.Notes.IncludeCommonProperties()
|
||||||
.Where(p => db.RecommendedInstances.Any(i => i.Host == p.UserHost))
|
.Where(p => db.BubbleInstances.Any(i => i.Host == p.UserHost))
|
||||||
.EnsureVisibleFor(user)
|
.EnsureVisibleFor(user)
|
||||||
.FilterHidden(user, db, filterHiddenListMembers: true)
|
.FilterHidden(user, db, filterHiddenListMembers: true)
|
||||||
.FilterMutedThreads(user, db)
|
.FilterMutedThreads(user, db)
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class DatabaseContext(DbContextOptions<DatabaseContext> options)
|
||||||
public virtual DbSet<Filter> Filters { get; init; } = null!;
|
public virtual DbSet<Filter> Filters { get; init; } = null!;
|
||||||
public virtual DbSet<PluginStoreEntry> PluginStore { get; init; } = null!;
|
public virtual DbSet<PluginStoreEntry> PluginStore { get; init; } = null!;
|
||||||
public virtual DbSet<PolicyConfiguration> PolicyConfiguration { get; init; } = null!;
|
public virtual DbSet<PolicyConfiguration> PolicyConfiguration { get; init; } = null!;
|
||||||
public virtual DbSet<RecommendedInstance> RecommendedInstances { get; init; } = null!;
|
public virtual DbSet<BubbleInstance> BubbleInstances { get; init; } = null!;
|
||||||
public virtual DbSet<DataProtectionKey> DataProtectionKeys { get; init; } = null!;
|
public virtual DbSet<DataProtectionKey> DataProtectionKeys { get; init; } = null!;
|
||||||
|
|
||||||
public static NpgsqlDataSource GetDataSource(Config.DatabaseSection config)
|
public static NpgsqlDataSource GetDataSource(Config.DatabaseSection config)
|
||||||
|
|
|
@ -409,6 +409,18 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
|
||||||
b.ToTable("blocking");
|
b.ToTable("blocking");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.BubbleInstance", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Host")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)")
|
||||||
|
.HasColumnName("host");
|
||||||
|
|
||||||
|
b.HasKey("Host");
|
||||||
|
|
||||||
|
b.ToTable("bubble_instance");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.CacheEntry", b =>
|
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.CacheEntry", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("Key")
|
b.Property<string>("Key")
|
||||||
|
@ -3651,18 +3663,6 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
|
||||||
b.ToTable("push_subscription");
|
b.ToTable("push_subscription");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.RecommendedInstance", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Host")
|
|
||||||
.HasMaxLength(256)
|
|
||||||
.HasColumnType("character varying(256)")
|
|
||||||
.HasColumnName("host");
|
|
||||||
|
|
||||||
b.HasKey("Host");
|
|
||||||
|
|
||||||
b.ToTable("recommended_instance");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.RegistrationInvite", b =>
|
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.RegistrationInvite", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("Id")
|
b.Property<string>("Id")
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Iceshrimp.Backend.Core.Database.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
[DbContext(typeof(DatabaseContext))]
|
||||||
|
[Migration("20250323112015_RenameBubbleInstanceTable")]
|
||||||
|
public partial class RenameBubbleInstanceTable : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropPrimaryKey(
|
||||||
|
name: "PK_recommended_instance",
|
||||||
|
table: "recommended_instance");
|
||||||
|
|
||||||
|
migrationBuilder.RenameTable(
|
||||||
|
name: "recommended_instance",
|
||||||
|
newName: "bubble_instance");
|
||||||
|
|
||||||
|
migrationBuilder.AddPrimaryKey(
|
||||||
|
name: "PK_bubble_instance",
|
||||||
|
table: "bubble_instance",
|
||||||
|
column: "host");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropPrimaryKey(
|
||||||
|
name: "PK_bubble_instance",
|
||||||
|
table: "bubble_instance");
|
||||||
|
|
||||||
|
migrationBuilder.RenameTable(
|
||||||
|
name: "bubble_instance",
|
||||||
|
newName: "recommended_instance");
|
||||||
|
|
||||||
|
migrationBuilder.AddPrimaryKey(
|
||||||
|
name: "PK_recommended_instance",
|
||||||
|
table: "recommended_instance",
|
||||||
|
column: "host");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,8 +3,8 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace Iceshrimp.Backend.Core.Database.Tables;
|
namespace Iceshrimp.Backend.Core.Database.Tables;
|
||||||
|
|
||||||
[Table("recommended_instance")]
|
[Table("bubble_instance")]
|
||||||
public class RecommendedInstance
|
public class BubbleInstance
|
||||||
{
|
{
|
||||||
[Key]
|
[Key]
|
||||||
[Column("host")]
|
[Column("host")]
|
||||||
|
|
|
@ -19,8 +19,8 @@ internal class TimelineControllerModel(ApiClient api)
|
||||||
api.CallAsync<List<NoteResponse>>(HttpMethod.Get, "/timelines/social", pq);
|
api.CallAsync<List<NoteResponse>>(HttpMethod.Get, "/timelines/social", pq);
|
||||||
|
|
||||||
[LinkPagination(20, 80)]
|
[LinkPagination(20, 80)]
|
||||||
public Task<List<NoteResponse>> GetRecommendedTimelineAsync(PaginationQuery pq) =>
|
public Task<List<NoteResponse>> GetBubbleTimelineAsync(PaginationQuery pq) =>
|
||||||
api.CallAsync<List<NoteResponse>>(HttpMethod.Get, "/timelines/recommended", pq);
|
api.CallAsync<List<NoteResponse>>(HttpMethod.Get, "/timelines/bubble", pq);
|
||||||
|
|
||||||
[LinkPagination(20, 80)]
|
[LinkPagination(20, 80)]
|
||||||
public Task<List<NoteResponse>> GetGlobalTimelineAsync(PaginationQuery pq) =>
|
public Task<List<NoteResponse>> GetGlobalTimelineAsync(PaginationQuery pq) =>
|
||||||
|
|
Loading…
Add table
Reference in a new issue