Trash music (#732)

This commit is contained in:
Rafał Mikrut 2022-05-30 16:26:27 +02:00 committed by GitHub
parent 19afce5d2e
commit 3748411ebd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 151 additions and 41 deletions

3
.gitignore vendored
View File

@ -7,4 +7,5 @@ results*.txt
TestSuite*
*.snap
flatpak/
*.zip
*.zip
*.zst

140
Cargo.lock generated
View File

@ -522,13 +522,14 @@ dependencies = [
[[package]]
name = "dashmap"
version = "5.3.3"
version = "5.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "391b56fbd302e585b7a9494fb70e40949567b1cf9003a8e4a6041a1687c26573"
checksum = "3495912c9c1ccf2e18976439f4443f3fee0fd61f424ff99fde6a66b15ecb448f"
dependencies = [
"cfg-if",
"hashbrown 0.12.1",
"lock_api",
"parking_lot_core",
]
[[package]]
@ -712,13 +713,11 @@ dependencies = [
[[package]]
name = "flate2"
version = "1.0.23"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af"
checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6"
dependencies = [
"cfg-if",
"crc32fast",
"libc",
"miniz_oxide 0.5.1",
]
@ -785,6 +784,16 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "form_urlencoded"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191"
dependencies = [
"matches",
"percent-encoding",
]
[[package]]
name = "fs_extra"
version = "1.2.0"
@ -924,9 +933,9 @@ dependencies = [
[[package]]
name = "gdk4-sys"
version = "0.4.2"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48a39e34abe35ee2cf54a1e29dd983accecd113ad30bdead5050418fa92f2a1b"
checksum = "b34a7e60e0c0103cffeaf7baf9dc05358dca74fd350a0c4d61c6c3083ca9fdf1"
dependencies = [
"cairo-sys-rs",
"gdk-pixbuf-sys",
@ -1308,6 +1317,17 @@ dependencies = [
"syn",
]
[[package]]
name = "idna"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8"
dependencies = [
"matches",
"unicode-bidi",
"unicode-normalization",
]
[[package]]
name = "image"
version = "0.23.14"
@ -1382,9 +1402,9 @@ dependencies = [
[[package]]
name = "indexmap"
version = "1.8.1"
version = "1.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee"
checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a"
dependencies = [
"autocfg",
"hashbrown 0.11.2",
@ -1559,6 +1579,12 @@ dependencies = [
"libc",
]
[[package]]
name = "matches"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
[[package]]
name = "md5"
version = "0.7.0"
@ -1762,9 +1788,9 @@ dependencies = [
[[package]]
name = "once_cell"
version = "1.11.0"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b10983b38c53aebdf33f542c6275b0f58a238129d00c4ae0e6fb59738d783ca"
checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225"
[[package]]
name = "opaque-debug"
@ -1910,6 +1936,12 @@ dependencies = [
"syn",
]
[[package]]
name = "percent-encoding"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
[[package]]
name = "pest"
version = "2.1.3"
@ -2851,11 +2883,18 @@ dependencies = [
[[package]]
name = "trash"
version = "1.3.0"
version = "2.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90df96afb154814e214f37eac04920c66886fd95962f22febb4d537b0dacd512"
checksum = "7d0492e349e41bfa40e9d446a5803b84275898f0b3bda568b23e10325702095d"
dependencies = [
"winapi",
"chrono",
"libc",
"log",
"objc",
"once_cell",
"scopeguard",
"url",
"windows",
]
[[package]]
@ -2947,10 +2986,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
[[package]]
name = "uuid"
version = "1.0.0"
name = "url"
version = "2.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cfcd319456c4d6ea10087ed423473267e1a071f3bc0aa89f80d60997843c6f0"
checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c"
dependencies = [
"form_urlencoded",
"idna",
"matches",
"percent-encoding",
]
[[package]]
name = "uuid"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93bbc61e655a4833cf400d0d15bf3649313422fa7572886ad6dab16d79886365"
[[package]]
name = "vec_map"
@ -3095,17 +3146,30 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57b543186b344cc61c85b5aab0d2e3adf4e0f99bc076eff9aa5927bcc0b8a647"
dependencies = [
"windows_aarch64_msvc 0.37.0",
"windows_i686_gnu 0.37.0",
"windows_i686_msvc 0.37.0",
"windows_x86_64_gnu 0.37.0",
"windows_x86_64_msvc 0.37.0",
]
[[package]]
name = "windows-sys"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
dependencies = [
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_msvc",
"windows_aarch64_msvc 0.36.1",
"windows_i686_gnu 0.36.1",
"windows_i686_msvc 0.36.1",
"windows_x86_64_gnu 0.36.1",
"windows_x86_64_msvc 0.36.1",
]
[[package]]
@ -3114,30 +3178,60 @@ version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
[[package]]
name = "windows_aarch64_msvc"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2623277cb2d1c216ba3b578c0f3cf9cdebeddb6e66b1b218bb33596ea7769c3a"
[[package]]
name = "windows_i686_gnu"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
[[package]]
name = "windows_i686_gnu"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3925fd0b0b804730d44d4b6278c50f9699703ec49bcd628020f46f4ba07d9e1"
[[package]]
name = "windows_i686_msvc"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
[[package]]
name = "windows_i686_msvc"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce907ac74fe331b524c1298683efbf598bb031bc84d5e274db2083696d07c57c"
[[package]]
name = "windows_x86_64_gnu"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
[[package]]
name = "windows_x86_64_gnu"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2babfba0828f2e6b32457d5341427dcbb577ceef556273229959ac23a10af33d"
[[package]]
name = "windows_x86_64_msvc"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
[[package]]
name = "windows_x86_64_msvc"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4dd6dc7df2d84cf7b33822ed5b86318fb1781948e9663bacd047fc9dd52259d"
[[package]]
name = "xxhash-rust"
version = "0.8.5"

View File

@ -5,8 +5,10 @@ members = [
"czkawka_gui",
]
[profile.release]
# Panic = "abort" will crash entire app when processing invalid image file.
# Since crash happens in external library, this is only way to handle this(I think).
# panic = "unwind" in opposite to "abort", allows to catch panic!()
# Since Czkawka parse different types of files with few libraries, it is possible
# that some files will cause crash, so at this moment I don't recommend to use "abort"
# until you are ready to occasional crashes
panic = "unwind"
# LTO setting is disabled by default, because release mode is usually needed to develop app and compilation with LTO would take a lot of time

View File

@ -1,3 +1,14 @@
## Version 5.0.0 - ?.?.2022r
- GTK 4 port - [#466](https://github.com/qarmin/czkawka/pull/466)
- Resize preview with window - [#466](https://github.com/qarmin/czkawka/pull/466)
- Fix removing only one item from list view - [#466](https://github.com/qarmin/czkawka/pull/466)
- Fix showing help command in duplicate CLI mode - [#720](https://github.com/qarmin/czkawka/pull/720)
- Fix freeze when not choosing any tag in similiar music mode - [TODO]()
- Read more tags from music files - [#705](https://github.com/qarmin/czkawka/pull/705)
- Improve checking for invalid extensions - [#705](https://github.com/qarmin/czkawka/pull/705)
- Support for finding invalid PDF files - [#705](https://github.com/qarmin/czkawka/pull/705)
- Re-enable checking for broken music files(`libasound.so.2` no longer needed) - [#705](https://github.com/qarmin/czkawka/pull/705)
## Version 4.1.0 - 24.04.2022r
- New mode - finding files whose content not match with their extension - [#678](https://github.com/qarmin/czkawka/pull/678)
- Builtin icons - no more invalid, theme/OS dependant icons - [#659](https://github.com/qarmin/czkawka/pull/659)

View File

@ -28,10 +28,7 @@ pub const ZIP_FILES_EXTENSIONS: &[&str] = &[".zip"];
pub const PDF_FILES_EXTENSIONS: &[&str] = &[".pdf"];
pub const AUDIO_FILES_EXTENSIONS: &[&str] = &[
".mp3", ".flac", ".wav", ".ogg", ".m4a", ".aac", ".aiff", ".pcm", ".aif", ".aiff", ".aifc", ".m3a", ".mp2", ".mp4a", ".mp2a", ".mpga", ".wave", ".weba",
".wma",
/*".ac3",*/
/*".oga", https://github.com/Serial-ATA/lofty-rs/issues/47#issuecomment-1120414259*/
".mp3", ".flac", ".wav", ".ogg", ".m4a", ".aac", ".aiff", ".pcm", ".aif", ".aiff", ".aifc", ".m3a", ".mp2", ".mp4a", ".mp2a", ".mpga", ".wave", ".weba", ".wma", ".oga",
];
pub const VIDEO_FILES_EXTENSIONS: &[&str] = &[

View File

@ -38,7 +38,7 @@ regex = "1.5.5"
image_hasher = "1.0.0"
# Move files to trash
trash = "1.3.0"
trash = "2.1.4"
# For moving files(why std::fs doesn't have such features)
fs_extra = "1.2.0"

View File

@ -441,6 +441,11 @@ pub fn connect_button_search(
);
entry_info.set_text(&flg!("search_not_choosing_any_music"));
show_dialog.store(false, Ordering::Relaxed);
notebook_main.set_sensitive(true);
notebook_upper.set_sensitive(true);
button_settings.set_sensitive(true);
button_app_info.set_sensitive(true);
}
}
NotebookMainEnum::Symlinks => {

View File

@ -26,7 +26,6 @@ pub fn connect_button_stop(gui_data: &GuiData) {
let button_stop_in_dialog = gui_data.progress_window.button_stop_in_dialog.clone();
let stop_dialog = gui_data.progress_window.window_progress.clone();
let stop_sender = gui_data.stop_sender.clone();
// TODO GTK 4 change this to connect released, not sure why not works here
button_stop_in_dialog.connect_clicked(move |_a| {
stop_dialog.set_title(Some(&format!("{} ({})", flg!("window_progress_title"), flg!("progress_stop_additional_message"))));

View File

@ -538,16 +538,17 @@ fn connect_event_mouse(gui_data: &GuiData) {
let check_button_settings_show_preview = gui_data.settings.check_button_settings_show_preview_duplicates.clone();
let image_preview = gui_data.main_notebook.image_preview_duplicates.clone();
let preview_path = gui_data.preview_path.clone();
let tree_view = gui_data.main_notebook.tree_view_duplicate_finder.clone();
let gc = gui_data.main_notebook.gc_tree_view_duplicate_finder.clone();
tree_view.set_property("activate-on-single-click", true);
// TODO GTK 4, currently not works, connect_pressed shows previous thing
gc.connect_released(move |gc, _event, _, _| {
let tree_view = gc.widget().downcast::<gtk4::TreeView>().unwrap();
// TODO GTK 4, currently not works, connect_pressed shows previous thing - https://gitlab.gnome.org/GNOME/gtk/-/issues/4939
// Use connect_released when it will be fixed, currently using connect_row_activated workaround
tree_view.connect_row_activated(move |tree_view, _b, _c| {
let nb_object = &NOTEBOOKS_INFOS[NotebookMainEnum::Duplicate as usize];
let preview_path = preview_path.clone();
show_preview(
&tree_view,
tree_view,
&text_view_errors,
&check_button_settings_show_preview,
&image_preview,
@ -563,16 +564,16 @@ fn connect_event_mouse(gui_data: &GuiData) {
let check_button_settings_show_preview = gui_data.settings.check_button_settings_show_preview_similar_images.clone();
let preview_path = gui_data.preview_path.clone();
let image_preview = gui_data.main_notebook.image_preview_similar_images.clone();
let tree_view = gui_data.main_notebook.tree_view_similar_images_finder.clone();
let gc = gui_data.main_notebook.gc_tree_view_similar_images_finder.clone();
tree_view.set_property("activate-on-single-click", true);
// TODO GTK 4, currently not works, connect_pressed shows previous thing
gc.connect_released(move |gc, _event, _, _| {
let tree_view = gc.widget().downcast::<gtk4::TreeView>().unwrap();
tree_view.connect_row_activated(move |tree_view, _b, _c| {
let nb_object = &NOTEBOOKS_INFOS[NotebookMainEnum::SimilarImages as usize];
let preview_path = preview_path.clone();
show_preview(
&tree_view,
tree_view,
&text_view_errors,
&check_button_settings_show_preview,
&image_preview,