mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 19:57:25 +01:00
Remove server synchronization code
This commit (tries to) remove all code for synchronyzing to a music metadata server. Because the intended use cases of the application have shifted over time, this isn't a central feature anymore. However, it may well be decided to reintroduce the functionality at some point in the future.
This commit is contained in:
parent
384ca255f3
commit
f165c6cae8
48 changed files with 96 additions and 2633 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use crate::navigator::{NavigationHandle, Screen};
|
||||
use crate::widgets::{Editor, EntryRow, Section, UploadSection, Widget};
|
||||
use crate::widgets::{Editor, EntryRow, Section, Widget};
|
||||
use anyhow::Result;
|
||||
use gettextrs::gettext;
|
||||
use glib::clone;
|
||||
|
|
@ -16,7 +16,6 @@ pub struct InstrumentEditor {
|
|||
|
||||
editor: Editor,
|
||||
name: EntryRow,
|
||||
upload: Rc<UploadSection>,
|
||||
}
|
||||
|
||||
impl Screen<Option<Instrument>, Instrument> for InstrumentEditor {
|
||||
|
|
@ -33,10 +32,7 @@ impl Screen<Option<Instrument>, Instrument> for InstrumentEditor {
|
|||
list.append(&name.widget);
|
||||
|
||||
let section = Section::new(&gettext("General"), &list);
|
||||
let upload = UploadSection::new(Rc::clone(&handle.backend));
|
||||
|
||||
editor.add_content(§ion.widget);
|
||||
editor.add_content(&upload.widget);
|
||||
|
||||
let id = match instrument {
|
||||
Some(instrument) => {
|
||||
|
|
@ -51,7 +47,6 @@ impl Screen<Option<Instrument>, Instrument> for InstrumentEditor {
|
|||
id,
|
||||
editor,
|
||||
name,
|
||||
upload,
|
||||
});
|
||||
|
||||
// Connect signals and callbacks
|
||||
|
|
@ -91,7 +86,7 @@ impl InstrumentEditor {
|
|||
self.editor.set_may_save(!self.name.get_text().is_empty());
|
||||
}
|
||||
|
||||
/// Save the instrument and possibly upload it to the server.
|
||||
/// Save the instrument.
|
||||
async fn save(&self) -> Result<Instrument> {
|
||||
let name = self.name.get_text();
|
||||
|
||||
|
|
@ -100,19 +95,12 @@ impl InstrumentEditor {
|
|||
name,
|
||||
};
|
||||
|
||||
if self.upload.get_active() {
|
||||
self.handle
|
||||
.backend
|
||||
.cl()
|
||||
.post_instrument(&instrument)
|
||||
.await?;
|
||||
}
|
||||
|
||||
self.handle
|
||||
.backend
|
||||
.db()
|
||||
.update_instrument(instrument.clone())
|
||||
.await?;
|
||||
|
||||
self.handle.backend.library_changed();
|
||||
|
||||
Ok(instrument)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue