Compare commits
3 Commits
d20bcf6a2d
...
master
Author | SHA1 | Date | |
---|---|---|---|
94de09f429 | |||
bdc2e7a050 | |||
67d5dac0d1 |
@@ -1,6 +1,9 @@
|
||||
# Sheet Organizer
|
||||
A simple tool for organizing and opening digital sheet music on a touch display as part of a digital music stand.
|
||||
|
||||
## Dependencies
|
||||
This tool offers editing pdf using [Xournal++](https://github.com/xournalpp/xournalpp).
|
||||
|
||||
## Configuration
|
||||
You can configure sheet-organizer using an file `config.toml` inside one of your `$XDG_CONFIG_DIRECTORIES` (e.g. `~/.config/sheet-organizer/config.toml`).
|
||||
|
||||
|
@@ -52,7 +52,6 @@
|
||||
with pkgs;
|
||||
[
|
||||
gtk4
|
||||
xournalpp # not needed for building
|
||||
]
|
||||
++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
|
||||
# Additional darwin specific inputs can be set here
|
||||
@@ -116,11 +115,5 @@
|
||||
}
|
||||
);
|
||||
in
|
||||
packageOutputs
|
||||
// {
|
||||
hydraJobs = {
|
||||
x86_64-linux.sheet-organizer = packageOutputs.packages.x86_64-linux;
|
||||
aarch64-linux.sheet-organizer = packageOutputs.packages.aarch64-linux;
|
||||
};
|
||||
};
|
||||
packageOutputs;
|
||||
}
|
||||
|
@@ -81,6 +81,19 @@ pub async fn get_composer_by_id(database: &Database, id: i64) -> sqlx::Result<Co
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn remove_duplicate_sheets(database: &Database) -> sqlx::Result<()> {
|
||||
for kind in SheetKindDiscriminants::iter() {
|
||||
let table = kind.get_database_table_name();
|
||||
sqlx::query(&format!(
|
||||
"DELETE FROM {} WHERE id NOT IN (SELECT MIN(id) FROM {} GROUP BY file_hash)",
|
||||
table, table
|
||||
))
|
||||
.execute(&database.connection)
|
||||
.await?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn fetch_all_sheets(database: &Database) -> sqlx::Result<Vec<Sheet>> {
|
||||
let mut sheets: Vec<Sheet> = Vec::new();
|
||||
|
||||
|
@@ -13,6 +13,8 @@ pub async fn load_and_validate_sheets(
|
||||
database: &Database,
|
||||
directory: impl AsRef<Path>,
|
||||
) -> Vec<Sheet> {
|
||||
sheet_dao::remove_duplicate_sheets(database).await.unwrap();
|
||||
|
||||
let sheets = sheet_dao::fetch_all_sheets(database).await.unwrap();
|
||||
|
||||
debug!("Validating sheets from database...");
|
||||
|
Reference in New Issue
Block a user