Add scrobble count to each artist/album/song view
This commit is contained in:
parent
7ee3abe857
commit
4adbd59e12
7 changed files with 32 additions and 16 deletions
|
|
@ -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, .{}),
|
||||
},
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue