mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 19:57:25 +01:00
Refactor db schema and use Diesel
This commit is contained in:
parent
2f6676ba3b
commit
220821a0e0
14 changed files with 1310 additions and 599 deletions
|
|
@ -1,7 +1,8 @@
|
|||
use crate::library::Recording;
|
||||
use gtk::{glib, subclass::prelude::*};
|
||||
use std::cell::OnceCell;
|
||||
|
||||
use crate::db::models::Recording;
|
||||
|
||||
mod imp {
|
||||
use super::*;
|
||||
|
||||
|
|
@ -44,14 +45,14 @@ glib::wrapper! {
|
|||
}
|
||||
|
||||
impl MusicusRecordingTile {
|
||||
pub fn new(recording: &Recording, performances: Vec<String>) -> Self {
|
||||
pub fn new(recording: &Recording) -> Self {
|
||||
let obj: Self = glib::Object::new();
|
||||
let imp = obj.imp();
|
||||
|
||||
imp.work_label.set_label(&recording.work.title);
|
||||
imp.composer_label
|
||||
.set_label(&recording.work.composer.name_fl());
|
||||
imp.performances_label.set_label(&performances.join(", "));
|
||||
imp.work_label.set_label(&recording.work.name.get());
|
||||
imp.composer_label.set_label(&recording.work.composers_string());
|
||||
imp.performances_label.set_label(&recording.performers_string());
|
||||
|
||||
imp.recording.set(recording.clone()).unwrap();
|
||||
|
||||
obj
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue