Add scrobble count to each artist/album/song view

This commit is contained in:
mitteneer 2025-03-25 15:44:40 -04:00
parent 7ee3abe857
commit 4adbd59e12
7 changed files with 32 additions and 16 deletions

View file

@ -206,13 +206,20 @@ pub const Albumsong = jetquery.Model(
},
);
pub const Scrobbleartist = jetquery.Model(@This(), "Scrobbleartists", struct {
id: i32,
scrobble_id: i32,
artist_id: i32,
created_at: jetquery.DateTime,
updated_at: jetquery.DateTime,
}, .{ .relations = .{
.scrobble = jetquery.belongsTo(.Scrobble, .{}),
.artist = jetquery.belongsTo(.Artist, .{}),
} });
pub const Scrobbleartist = jetquery.Model(
@This(),
"Scrobbleartists",
struct {
id: i32,
scrobble_id: i32,
artist_id: i32,
created_at: jetquery.DateTime,
updated_at: jetquery.DateTime,
},
.{
.relations = .{
.scrobble = jetquery.belongsTo(.Scrobble, .{}),
.artist = jetquery.belongsTo(.Artist, .{}),
},
},
);