Change AudioTags to lofty and support moree audio things (#590)
This commit is contained in:
parent
ff71e2b57a
commit
3ce5d4a967
|
@ -130,7 +130,7 @@ jobs:
|
|||
linux-gui:
|
||||
strategy:
|
||||
matrix:
|
||||
toolchain: [ stable, 1.56.0 ]
|
||||
toolchain: [ stable, 1.57.0 ]
|
||||
type: [ release ]
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
|
|
|
@ -56,9 +56,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.53"
|
||||
version = "1.0.55"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0"
|
||||
checksum = "159bb86af3a200e19a068f4224eae4c8bb2d0fa054c7e5d1cacd5cef95e684cd"
|
||||
|
||||
[[package]]
|
||||
name = "arrayref"
|
||||
|
@ -113,30 +113,11 @@ dependencies = [
|
|||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "audiotags"
|
||||
version = "0.2.7182"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b87d111118f42416bb5f13c5dd2e2d879925964702a435be711d4f78fa9ce6d8"
|
||||
dependencies = [
|
||||
"audiotags-dev-macro",
|
||||
"id3",
|
||||
"metaflac",
|
||||
"mp4ameta",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "audiotags-dev-macro"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3b79298591161f312f06327df7963063ee07466be303dcc3084a44ec293cb36e"
|
||||
|
||||
[[package]]
|
||||
name = "autocfg"
|
||||
version = "1.0.1"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
|
||||
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
|
@ -214,7 +195,7 @@ dependencies = [
|
|||
"cc",
|
||||
"cfg-if 1.0.0",
|
||||
"constant_time_eq",
|
||||
"digest 0.10.1",
|
||||
"digest 0.10.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -234,9 +215,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "block-buffer"
|
||||
version = "0.10.0"
|
||||
version = "0.10.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95"
|
||||
checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
]
|
||||
|
@ -288,9 +269,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cairo-rs"
|
||||
version = "0.15.1"
|
||||
version = "0.15.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b869e97a87170f96762f9f178eae8c461147e722ba21dd8814105bf5716bf14a"
|
||||
checksum = "e8b14c80d8d1a02fa6d914b9d1afeeca9bc34257f8300d9696e1e331ae114223"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cairo-sys-rs",
|
||||
|
@ -312,9 +293,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.0.72"
|
||||
version = "1.0.73"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee"
|
||||
checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
|
||||
dependencies = [
|
||||
"jobserver",
|
||||
]
|
||||
|
@ -336,9 +317,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cfg-expr"
|
||||
version = "0.9.1"
|
||||
version = "0.10.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3431df59f28accaf4cb4eed4a9acc66bea3f3c3753aa6cdc2f024174ef232af7"
|
||||
checksum = "5e068cb2806bbc15b439846dc16c5f89f8599f2c3e4d73d4449d38f9b2f0b6c5"
|
||||
dependencies = [
|
||||
"smallvec",
|
||||
]
|
||||
|
@ -370,9 +351,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "clang-sys"
|
||||
version = "1.3.0"
|
||||
version = "1.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fa66045b9cb23c2e9c1520732030608b02ee07e5cfaa5a521ec15ded7fa24c90"
|
||||
checksum = "4cc00842eed744b858222c4c9faf7243aafc6d33f92f96935263ef4d8a41ce21"
|
||||
dependencies = [
|
||||
"glob",
|
||||
"libc",
|
||||
|
@ -465,7 +446,7 @@ dependencies = [
|
|||
"ndk-glue",
|
||||
"nix",
|
||||
"oboe",
|
||||
"parking_lot",
|
||||
"parking_lot 0.11.2",
|
||||
"stdweb",
|
||||
"thiserror",
|
||||
"web-sys",
|
||||
|
@ -483,9 +464,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "crc32fast"
|
||||
version = "1.3.1"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a2209c310e29876f7f0b2721e7e26b84aff178aa3da5d091f9bfbf47669e60e3"
|
||||
checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
]
|
||||
|
@ -513,9 +494,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "crossbeam-epoch"
|
||||
version = "0.9.6"
|
||||
version = "0.9.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762"
|
||||
checksum = "c00d6d2ea26e8b151d99093005cb442fb9a37aeaca582a03ec70946f49ab5ed9"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"crossbeam-utils",
|
||||
|
@ -526,9 +507,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "crossbeam-utils"
|
||||
version = "0.8.6"
|
||||
version = "0.8.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120"
|
||||
checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"lazy_static",
|
||||
|
@ -536,11 +517,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "crypto-common"
|
||||
version = "0.1.1"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0"
|
||||
checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
"typenum",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -566,7 +548,6 @@ dependencies = [
|
|||
name = "czkawka_core"
|
||||
version = "4.0.0"
|
||||
dependencies = [
|
||||
"audiotags",
|
||||
"bincode",
|
||||
"bitflags",
|
||||
"bk-tree",
|
||||
|
@ -583,6 +564,7 @@ dependencies = [
|
|||
"image",
|
||||
"imagepipe",
|
||||
"img_hash",
|
||||
"lofty",
|
||||
"once_cell",
|
||||
"rawloader",
|
||||
"rayon",
|
||||
|
@ -659,12 +641,13 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "dashmap"
|
||||
version = "4.0.2"
|
||||
version = "5.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c"
|
||||
checksum = "c0834a35a3fce649144119e18da2a4d8ed12ef3862f47183fd46f625d072d96c"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"num_cpus",
|
||||
"parking_lot 0.12.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -688,13 +671,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.10.1"
|
||||
version = "0.10.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b"
|
||||
checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506"
|
||||
dependencies = [
|
||||
"block-buffer 0.10.0",
|
||||
"block-buffer 0.10.2",
|
||||
"crypto-common",
|
||||
"generic-array",
|
||||
"subtle",
|
||||
]
|
||||
|
||||
|
@ -747,15 +729,16 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "ffmpeg_cmdline_utils"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2f156b1f5ba5f16135ec1efd32d9f90d0dad3ef8f8b77ca9928d4d0e3b24dd41"
|
||||
checksum = "b5cab6fb4997f82b6cb54ee905df6a4b954365ee01985f7a4e13cbc305923085"
|
||||
dependencies = [
|
||||
"image",
|
||||
"rayon",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -847,9 +830,9 @@ checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394"
|
|||
|
||||
[[package]]
|
||||
name = "futures"
|
||||
version = "0.3.19"
|
||||
version = "0.3.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "28560757fe2bb34e79f907794bb6b22ae8b0e5c669b638a1132f2592b19035b4"
|
||||
checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e"
|
||||
dependencies = [
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
|
@ -862,9 +845,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "futures-channel"
|
||||
version = "0.3.19"
|
||||
version = "0.3.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ba3dda0b6588335f360afc675d0564c17a77a2bda81ca178a4b6081bd86c7f0b"
|
||||
checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"futures-sink",
|
||||
|
@ -872,15 +855,15 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "futures-core"
|
||||
version = "0.3.19"
|
||||
version = "0.3.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7"
|
||||
checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3"
|
||||
|
||||
[[package]]
|
||||
name = "futures-executor"
|
||||
version = "0.3.19"
|
||||
version = "0.3.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "29d6d2ff5bb10fb95c85b8ce46538a2e5f5e7fdc755623a7d4529ab8a4ed9d2a"
|
||||
checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"futures-task",
|
||||
|
@ -889,15 +872,15 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "futures-io"
|
||||
version = "0.3.19"
|
||||
version = "0.3.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2"
|
||||
checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b"
|
||||
|
||||
[[package]]
|
||||
name = "futures-macro"
|
||||
version = "0.3.19"
|
||||
version = "0.3.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6dbd947adfffb0efc70599b3ddcf7b5597bb5fa9e245eb99f62b3a5f7bb8bd3c"
|
||||
checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -906,21 +889,21 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "futures-sink"
|
||||
version = "0.3.19"
|
||||
version = "0.3.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e3055baccb68d74ff6480350f8d6eb8fcfa3aa11bdc1a1ae3afdd0514617d508"
|
||||
checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868"
|
||||
|
||||
[[package]]
|
||||
name = "futures-task"
|
||||
version = "0.3.19"
|
||||
version = "0.3.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6ee7c6485c30167ce4dfb83ac568a849fe53274c831081476ee13e0dce1aad72"
|
||||
checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a"
|
||||
|
||||
[[package]]
|
||||
name = "futures-util"
|
||||
version = "0.3.19"
|
||||
version = "0.3.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d9b5cf40b47a271f77a8b1bec03ca09044d99d2372c0de244e66430761127164"
|
||||
checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a"
|
||||
dependencies = [
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
|
@ -936,9 +919,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gdk"
|
||||
version = "0.15.2"
|
||||
version = "0.15.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "614258e81ec35ed8770e64a0838f3a47f95b398bc51e724d3b3fa09c1ee0f8d5"
|
||||
checksum = "a6e05c1f572ab0e1f15be94217f0dc29088c248b14f792a5ff0af0d84bcda9e8"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cairo-rs",
|
||||
|
@ -952,9 +935,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gdk-pixbuf"
|
||||
version = "0.15.4"
|
||||
version = "0.15.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73aa2f5de1b45710da90a55863276667dc3a3264aaf6a2aeace62bb015244d49"
|
||||
checksum = "d8750501d75f318c2ec0314701bc8403901303210def80bafd13f6b6059a3f45"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"gdk-pixbuf-sys",
|
||||
|
@ -1005,9 +988,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "getrandom"
|
||||
version = "0.2.4"
|
||||
version = "0.2.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c"
|
||||
checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"libc",
|
||||
|
@ -1026,9 +1009,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gio"
|
||||
version = "0.15.4"
|
||||
version = "0.15.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "56f906022fe89505b4e7b6c59a62d4ca3c090904f286cf61f1b245afcb20897d"
|
||||
checksum = "96efd8a1c00d890f6b45671916e165b5e43ccec61957d443aff6d7e44f62d348"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"futures-channel",
|
||||
|
@ -1043,9 +1026,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gio-sys"
|
||||
version = "0.15.4"
|
||||
version = "0.15.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "97225e1b9c7c48ed7fec4377fdc72702965bfbfd3a944b928ccbb5d8ed82ccc9"
|
||||
checksum = "1d0fa5052773f5a56b8ae47dab09d040f5d9ce1311f4f99006e16e9a08269296"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"gobject-sys",
|
||||
|
@ -1056,9 +1039,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "glib"
|
||||
version = "0.15.4"
|
||||
version = "0.15.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e385b6c17a1add7d0fbc64d38e2e742346d3e8b22e5fa3734e5cdca2be24028d"
|
||||
checksum = "aa570813c504bdf7539a9400180c2dd4b789a819556fb86da7226d7d1b037b49"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"futures-channel",
|
||||
|
@ -1076,9 +1059,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "glib-macros"
|
||||
version = "0.15.3"
|
||||
version = "0.15.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e58b262ff65ef771003873cea8c10e0fe854f1c508d48d62a4111a1ff163f7d1"
|
||||
checksum = "41bfd8d227dead0829ac142454e97531b93f576d0805d779c42bfd799c65c572"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"heck 0.4.0",
|
||||
|
@ -1091,9 +1074,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "glib-sys"
|
||||
version = "0.15.4"
|
||||
version = "0.15.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c4f08dd67f74b223fedbbb30e73145b9acd444e67cc4d77d0598659b7eebe7e"
|
||||
checksum = "f4366377bd56697de8aaee24e673c575d2694d72e7756324ded2b0428829a7b8"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"system-deps",
|
||||
|
@ -1107,9 +1090,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
|
|||
|
||||
[[package]]
|
||||
name = "gobject-sys"
|
||||
version = "0.15.1"
|
||||
version = "0.15.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6edb1f0b3e4c08e2a0a490d1082ba9e902cdff8ff07091e85c6caec60d17e2ab"
|
||||
checksum = "df6859463843c20cf3837e3a9069b6ab2051aeeadf4c899d33344f4aea83189a"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"libc",
|
||||
|
@ -1118,9 +1101,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gtk"
|
||||
version = "0.15.3"
|
||||
version = "0.15.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c7978eaec05bea63947c801d29a21372f2ed39aec0bf56bf7725d3599094675e"
|
||||
checksum = "5f2d1326b36af927fe46ae2f89a8fec38c6f0d279ebc5ef07ffeeabb70300bfc"
|
||||
dependencies = [
|
||||
"atk",
|
||||
"bitflags",
|
||||
|
@ -1159,9 +1142,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "gtk3-macros"
|
||||
version = "0.15.1"
|
||||
version = "0.15.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8c891188af69e77a1e8a0b1746fbd03b9b396e7d34d518c5331b15950259f541"
|
||||
checksum = "24f518afe90c23fba585b2d7697856f9e6a7bbc62f65588035e66f6afb01a2e9"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"proc-macro-crate",
|
||||
|
@ -1207,12 +1190,6 @@ dependencies = [
|
|||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hex"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
||||
|
||||
[[package]]
|
||||
name = "hound"
|
||||
version = "3.4.0"
|
||||
|
@ -1241,9 +1218,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "i18n-embed"
|
||||
version = "0.13.1"
|
||||
version = "0.13.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "39a0b4598fcd199eb5da38f70ece82903b178ad638839661c00612719bcfc0ad"
|
||||
checksum = "e7f21ed76e44de8ac3dfa36bb37ab2e6480be0dc75c612474949be1f3cb2c253"
|
||||
dependencies = [
|
||||
"fluent",
|
||||
"fluent-langneg",
|
||||
|
@ -1253,7 +1230,7 @@ dependencies = [
|
|||
"lazy_static",
|
||||
"locale_config",
|
||||
"log",
|
||||
"parking_lot",
|
||||
"parking_lot 0.12.0",
|
||||
"rust-embed",
|
||||
"thiserror",
|
||||
"unic-langid",
|
||||
|
@ -1262,9 +1239,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "i18n-embed-fl"
|
||||
version = "0.6.1"
|
||||
version = "0.6.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c1d347d2f7f9f2f977385b43b204d59ebeb1b2f93ce73cd23622df2d2da1033"
|
||||
checksum = "9420a9718ef9d0ab727840a398e25408ea0daff9ba3c681707ba05485face98e"
|
||||
dependencies = [
|
||||
"dashmap",
|
||||
"find-crate",
|
||||
|
@ -1294,17 +1271,6 @@ dependencies = [
|
|||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "id3"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8cb37ae5aa60d57c5f3412df1f3e5a48a978804f4a7e70700bb5f97e8f1a6331"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"byteorder",
|
||||
"flate2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ident_case"
|
||||
version = "1.0.1"
|
||||
|
@ -1479,9 +1445,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.116"
|
||||
version = "0.2.119"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "565dbd88872dbe4cc8a46e527f26483c1d1f7afa6b884a3bd6cd893d4f98da74"
|
||||
checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4"
|
||||
|
||||
[[package]]
|
||||
name = "libloading"
|
||||
|
@ -1521,6 +1487,21 @@ dependencies = [
|
|||
"scopeguard",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lofty"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1b6eb70e6fb8ce11f97426232b74ada51c246d4c611cd0e1f960cf31503ebad"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"byteorder",
|
||||
"cfg-if 1.0.0",
|
||||
"flate2",
|
||||
"ogg_pager",
|
||||
"once_cell",
|
||||
"paste",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.4.14"
|
||||
|
@ -1563,17 +1544,6 @@ dependencies = [
|
|||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "metaflac"
|
||||
version = "0.2.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e1470d3cc1bb0d692af5eb3afb594330b8ba09fd91c32c4e1c6322172a5ba750"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"hex",
|
||||
"log",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "minimp3"
|
||||
version = "0.5.1"
|
||||
|
@ -1613,22 +1583,6 @@ dependencies = [
|
|||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mp4ameta"
|
||||
version = "0.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1ef7a2ba51feaa9e7be2209b6e5d7472d08427ef0ce88616ed93c66dae9601b2"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"mp4ameta_proc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mp4ameta_proc"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "64ae83441f6b67e3b7f009295618e90f03228b0f1a149f56ee8cd0f6bb5602c5"
|
||||
|
||||
[[package]]
|
||||
name = "multicache"
|
||||
version = "0.6.1"
|
||||
|
@ -1652,15 +1606,22 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "ndk-glue"
|
||||
version = "0.6.0"
|
||||
name = "ndk-context"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "04c0d14b0858eb9962a5dac30b809b19f19da7e4547d64af2b0bb051d2e55d79"
|
||||
checksum = "4e3c5cc68637e21fe8f077f6a1c9e0b9ca495bb74895226b476310f613325884"
|
||||
|
||||
[[package]]
|
||||
name = "ndk-glue"
|
||||
version = "0.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d9ffb7443daba48349d545028777ca98853b018b4c16624aa01223bc29e078da"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"libc",
|
||||
"log",
|
||||
"ndk",
|
||||
"ndk-context",
|
||||
"ndk-macro",
|
||||
"ndk-sys",
|
||||
]
|
||||
|
@ -1873,6 +1834,15 @@ dependencies = [
|
|||
"byteorder",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ogg_pager"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4507172566b8e1b4d4e3da7f33453055a223fdcf96bc7c5e5d67168f1c4b241b"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.9.0"
|
||||
|
@ -1887,9 +1857,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
|
|||
|
||||
[[package]]
|
||||
name = "open"
|
||||
version = "2.0.2"
|
||||
version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "176ee4b630d174d2da8241336763bb459281dddc0f4d87f72c3b1efc9a6109b7"
|
||||
checksum = "5a82915836ef43159bb6a3c64d884c42329ccd0b8afdca737cf1e3dd701709dc"
|
||||
dependencies = [
|
||||
"pathdiff",
|
||||
"winapi",
|
||||
|
@ -1897,9 +1867,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "pango"
|
||||
version = "0.15.2"
|
||||
version = "0.15.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "79211eff430c29cc38c69e0ab54bc78fa1568121ca9737707eee7f92a8417a94"
|
||||
checksum = "78c7420fc01a390ec200da7395b64d705f5d82fe03e5d0708aee422c46538be7"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"glib",
|
||||
|
@ -1928,7 +1898,17 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
|
|||
dependencies = [
|
||||
"instant",
|
||||
"lock_api",
|
||||
"parking_lot_core",
|
||||
"parking_lot_core 0.8.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58"
|
||||
dependencies = [
|
||||
"lock_api",
|
||||
"parking_lot_core 0.9.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1945,6 +1925,25 @@ dependencies = [
|
|||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot_core"
|
||||
version = "0.9.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "28141e0cc4143da2443301914478dc976a61ffdb3f043058310c70df2fed8954"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"libc",
|
||||
"redox_syscall",
|
||||
"smallvec",
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "paste"
|
||||
version = "1.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5"
|
||||
|
||||
[[package]]
|
||||
name = "pathdiff"
|
||||
version = "0.2.1"
|
||||
|
@ -2013,9 +2012,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "proc-macro-crate"
|
||||
version = "1.1.0"
|
||||
version = "1.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83"
|
||||
checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a"
|
||||
dependencies = [
|
||||
"thiserror",
|
||||
"toml",
|
||||
|
@ -2065,14 +2064,13 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.8.4"
|
||||
version = "0.8.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8"
|
||||
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"rand_chacha",
|
||||
"rand_core",
|
||||
"rand_hc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2094,15 +2092,6 @@ dependencies = [
|
|||
"getrandom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_hc"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7"
|
||||
dependencies = [
|
||||
"rand_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rawloader"
|
||||
version = "0.37.0"
|
||||
|
@ -2190,9 +2179,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "rodio"
|
||||
version = "0.14.0"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4d98f5e557b61525057e2bc142c8cd7f0e70d75dc32852309bec440e6e046bf9"
|
||||
checksum = "ec0939e9f626e6c6f1989adb6226a039c855ca483053f0ee7c98b90e41cf731e"
|
||||
dependencies = [
|
||||
"claxon",
|
||||
"cpal",
|
||||
|
@ -2368,9 +2357,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.78"
|
||||
version = "1.0.79"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d23c1ba4cf0efd44be32017709280b32d1cea5c3f1275c3b6d9e8bc54f758085"
|
||||
checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"ryu",
|
||||
|
@ -2498,9 +2487,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "system-deps"
|
||||
version = "6.0.1"
|
||||
version = "6.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ad3a97fdef3daf935d929b3e97e5a6a680cd4622e40c2941ca0875d6566416f8"
|
||||
checksum = "a1a45a1c4c9015217e12347f2a411b57ce2c4fc543913b14b6fe40483328e709"
|
||||
dependencies = [
|
||||
"cfg-expr",
|
||||
"heck 0.4.0",
|
||||
|
@ -2677,9 +2666,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "unicode-segmentation"
|
||||
version = "1.8.0"
|
||||
version = "1.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b"
|
||||
checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-width"
|
||||
|
@ -2847,10 +2836,53 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||
|
||||
[[package]]
|
||||
name = "xxhash-rust"
|
||||
version = "0.8.2"
|
||||
name = "windows-sys"
|
||||
version = "0.32.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e575e15bedf6e57b5c2d763ffc6c3c760143466cbd09d762d539680ab5992ded"
|
||||
checksum = "3df6e476185f92a12c072be4a189a0210dcdcf512a1891d6dff9edb874deadc6"
|
||||
dependencies = [
|
||||
"windows_aarch64_msvc",
|
||||
"windows_i686_gnu",
|
||||
"windows_i686_msvc",
|
||||
"windows_x86_64_gnu",
|
||||
"windows_x86_64_msvc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.32.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.32.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.32.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.32.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.32.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316"
|
||||
|
||||
[[package]]
|
||||
name = "xxhash-rust"
|
||||
version = "0.8.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "886f21441c6731b9e06a9fdacbc5e29319c17a4069c2a511d80349874864702d"
|
||||
|
||||
[[package]]
|
||||
name = "yaml-rust"
|
||||
|
|
|
@ -141,7 +141,7 @@ pub enum Commands {
|
|||
excluded_items: ExcludedItems,
|
||||
// #[structopt(short = "D", long, help = "Delete found files")]
|
||||
// delete_files: bool, TODO
|
||||
#[structopt(short = "z", long, default_value = "artist,title", parse(try_from_str = parse_music_duplicate_type), help = "Search method (title, artist, album_title, album_artist, year)", long_help = "Sets which rows must be equal to set this files as duplicates(may be mixed, but must be divided by commas).")]
|
||||
#[structopt(short = "z", long, default_value = "track_title,track_artist", parse(try_from_str = parse_music_duplicate_type), help = "Search method (track_title,track_artist,year,bitrate,genre,length))", long_help = "Sets which rows must be equal to set this files as duplicates(may be mixed, but must be divided by commas).")]
|
||||
music_similarity: MusicSimilarity,
|
||||
#[structopt(flatten)]
|
||||
file_to_save: FileToSave,
|
||||
|
@ -414,26 +414,29 @@ fn parse_music_duplicate_type(src: &str) -> Result<MusicSimilarity, String> {
|
|||
|
||||
let mut similarity: MusicSimilarity = MusicSimilarity::NONE;
|
||||
|
||||
let parts: Vec<&str> = src.split(',').collect();
|
||||
let parts: Vec<String> = src.split(',').map(|e| e.to_lowercase().replace('_', "")).collect();
|
||||
|
||||
if parts.iter().any(|e| e.to_lowercase().contains("title") && !e.to_lowercase().contains("album")) {
|
||||
similarity |= MusicSimilarity::TITLE;
|
||||
if parts.iter().any(|e| e.contains("tracktitle")) {
|
||||
similarity |= MusicSimilarity::TRACK_TITLE;
|
||||
}
|
||||
if parts.iter().any(|e| e.to_lowercase().contains("artist") && !e.to_lowercase().contains("album")) {
|
||||
similarity |= MusicSimilarity::ARTIST;
|
||||
if parts.iter().any(|e| e.contains("trackartist")) {
|
||||
similarity |= MusicSimilarity::TRACK_ARTIST;
|
||||
}
|
||||
if parts.iter().any(|e| e.to_lowercase().contains("title") && e.to_lowercase().contains("album")) {
|
||||
similarity |= MusicSimilarity::ALBUM_TITLE;
|
||||
}
|
||||
if parts.iter().any(|e| e.to_lowercase().contains("artist") && e.to_lowercase().contains("album")) {
|
||||
similarity |= MusicSimilarity::ALBUM_ARTIST;
|
||||
}
|
||||
if parts.iter().any(|e| e.to_lowercase().contains("year")) {
|
||||
if parts.iter().any(|e| e.contains("year")) {
|
||||
similarity |= MusicSimilarity::YEAR;
|
||||
}
|
||||
if parts.iter().any(|e| e.contains("bitrate")) {
|
||||
similarity |= MusicSimilarity::BITRATE;
|
||||
}
|
||||
if parts.iter().any(|e| e.contains("genre")) {
|
||||
similarity |= MusicSimilarity::GENRE;
|
||||
}
|
||||
if parts.iter().any(|e| e.contains("length")) {
|
||||
similarity |= MusicSimilarity::LENGTH;
|
||||
}
|
||||
|
||||
if similarity == MusicSimilarity::NONE {
|
||||
return Err("Couldn't parse the music search method (allowed: title,artist,album_title,album_artist,year)".to_string());
|
||||
return Err("Couldn't parse the music search method (allowed: track_title,track_artist,year,bitrate,genre,length)".to_string());
|
||||
}
|
||||
|
||||
Ok(similarity)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::needless_late_init)]
|
||||
|
||||
use std::process;
|
||||
|
||||
use structopt::StructOpt;
|
||||
|
|
|
@ -25,14 +25,14 @@ hamming = "0.1.3"
|
|||
|
||||
# Needed by same music
|
||||
bitflags = "1.3.2"
|
||||
audiotags = "0.2.7182"
|
||||
lofty="0.5.0"
|
||||
|
||||
# Futures - needed by async progress sender
|
||||
futures = "0.3.19"
|
||||
|
||||
# Needed by broken files
|
||||
zip = "0.5.13"
|
||||
rodio = { version = "0.14.0", optional = true }
|
||||
rodio = { version = "0.15.0", optional = true }
|
||||
|
||||
# Hashes for duplicate files
|
||||
blake3 = "1.2.0"
|
||||
|
@ -60,6 +60,7 @@ once_cell = "1.9.0"
|
|||
rawloader = "0.37.0"
|
||||
imagepipe = "0.4.0"
|
||||
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#![allow(clippy::collapsible_else_if)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
#![allow(clippy::needless_late_init)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate bitflags;
|
||||
|
|
|
@ -9,8 +9,8 @@ use std::thread::sleep;
|
|||
use std::time::{Duration, SystemTime};
|
||||
use std::{mem, thread};
|
||||
|
||||
use audiotags::Tag;
|
||||
use crossbeam_channel::Receiver;
|
||||
use lofty::{read_from_path, ItemKey};
|
||||
use rayon::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
@ -33,14 +33,12 @@ bitflags! {
|
|||
pub struct MusicSimilarity : u32 {
|
||||
const NONE = 0;
|
||||
|
||||
const TITLE = 0b1;
|
||||
const ARTIST = 0b10;
|
||||
|
||||
const ALBUM_TITLE = 0b100;
|
||||
const ALBUM_ARTIST = 0b1000;
|
||||
|
||||
const YEAR = 0b10000;
|
||||
// const Time = 0b100000;
|
||||
const TRACK_TITLE = 0b1;
|
||||
const TRACK_ARTIST = 0b10;
|
||||
const YEAR = 0b100;
|
||||
const LENGTH = 0b1000;
|
||||
const GENRE = 0b10000;
|
||||
const BITRATE = 0b100000;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,14 +49,12 @@ pub struct MusicEntry {
|
|||
pub path: PathBuf,
|
||||
pub modified_date: u64,
|
||||
|
||||
pub title: String,
|
||||
pub artist: String,
|
||||
|
||||
pub album_title: String,
|
||||
pub album_artist: String,
|
||||
|
||||
pub year: i32,
|
||||
// pub time: u32,
|
||||
pub track_title: String,
|
||||
pub track_artist: String,
|
||||
pub year: String,
|
||||
pub length: String,
|
||||
pub genre: String,
|
||||
pub bitrate: u32,
|
||||
}
|
||||
|
||||
impl FileEntry {
|
||||
|
@ -68,12 +64,12 @@ impl FileEntry {
|
|||
path: self.path.clone(),
|
||||
modified_date: self.modified_date,
|
||||
|
||||
title: "".to_string(),
|
||||
|
||||
artist: "".to_string(),
|
||||
album_title: "".to_string(),
|
||||
album_artist: "".to_string(),
|
||||
year: 0,
|
||||
track_title: "".to_string(),
|
||||
track_artist: "".to_string(),
|
||||
year: "".to_string(),
|
||||
length: "".to_string(),
|
||||
genre: "".to_string(),
|
||||
bitrate: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -133,7 +129,7 @@ impl SameMusic {
|
|||
duplicated_music_entries: vec![],
|
||||
music_to_check: Default::default(),
|
||||
approximate_comparison: true,
|
||||
use_cache: true,
|
||||
use_cache: false,
|
||||
delete_outdated_cache: true,
|
||||
use_reference_folders: false,
|
||||
duplicated_music_entries_referenced: vec![],
|
||||
|
@ -361,28 +357,52 @@ impl SameMusic {
|
|||
return None;
|
||||
}
|
||||
|
||||
let tag = match Tag::new().read_from_path(&path) {
|
||||
let tagged_file = match read_from_path(&path, true) {
|
||||
Ok(t) => t,
|
||||
Err(_inspected) => return Some(Some(music_entry)), // Data not in utf-8, etc., TODO this should be probably added to warnings, errors
|
||||
Err(_inspected) => {
|
||||
// println!("Failed to open {}", path);
|
||||
return Some(Some(music_entry));
|
||||
}
|
||||
};
|
||||
|
||||
music_entry.title = match tag.title() {
|
||||
Some(t) => t.to_string(),
|
||||
None => "".to_string(),
|
||||
let properties = tagged_file.properties();
|
||||
|
||||
let tag = match tagged_file.primary_tag() {
|
||||
Some(t) => t,
|
||||
None => {
|
||||
// println!("File {} don't have valid tag", path);
|
||||
return Some(Some(music_entry));
|
||||
}
|
||||
};
|
||||
music_entry.artist = match tag.artist() {
|
||||
Some(t) => t.to_string(),
|
||||
None => "".to_string(),
|
||||
};
|
||||
music_entry.album_title = match tag.album_title() {
|
||||
Some(t) => t.to_string(),
|
||||
None => "".to_string(),
|
||||
};
|
||||
music_entry.album_artist = match tag.album_artist() {
|
||||
Some(t) => t.to_string(),
|
||||
None => "".to_string(),
|
||||
};
|
||||
music_entry.year = tag.year().unwrap_or(0);
|
||||
|
||||
// println!("{:?}", tag.items());
|
||||
|
||||
let track_title = tag.get_string(&ItemKey::TrackTitle).unwrap_or("").to_string();
|
||||
let track_artist = tag.get_string(&ItemKey::TrackArtist).unwrap_or("").to_string();
|
||||
let year = tag.get_string(&ItemKey::Year).unwrap_or("").to_string();
|
||||
let mut length = tag.get_string(&ItemKey::Length).unwrap_or("").to_string();
|
||||
let genre = tag.get_string(&ItemKey::Genre).unwrap_or("").to_string();
|
||||
let bitrate = properties.audio_bitrate().unwrap_or(0);
|
||||
|
||||
if let Ok(mut length_number) = length.parse::<u32>() {
|
||||
length_number /= 60;
|
||||
let minutes = length_number / 1000;
|
||||
let seconds = (length_number % 1000) * 6 / 100;
|
||||
if minutes != 0 && seconds != 0 {
|
||||
length = format!("{}:{:02}", minutes, seconds);
|
||||
} else {
|
||||
length = "".to_string();
|
||||
}
|
||||
} else {
|
||||
length = "".to_string();
|
||||
}
|
||||
|
||||
music_entry.track_title = track_title;
|
||||
music_entry.track_artist = track_artist;
|
||||
music_entry.year = year;
|
||||
music_entry.length = length;
|
||||
music_entry.genre = genre;
|
||||
music_entry.bitrate = bitrate;
|
||||
|
||||
Some(Some(music_entry))
|
||||
})
|
||||
|
@ -460,7 +480,7 @@ impl SameMusic {
|
|||
let mut old_duplicates: Vec<Vec<MusicEntry>> = vec![self.music_entries.clone()];
|
||||
let mut new_duplicates: Vec<Vec<MusicEntry>> = Vec::new();
|
||||
|
||||
if (self.music_similarity & MusicSimilarity::TITLE) == MusicSimilarity::TITLE {
|
||||
if (self.music_similarity & MusicSimilarity::TRACK_TITLE) == MusicSimilarity::TRACK_TITLE {
|
||||
for vec_file_entry in old_duplicates {
|
||||
atomic_file_counter.fetch_add(1, Ordering::Relaxed);
|
||||
if stop_receiver.is_some() && stop_receiver.unwrap().try_recv().is_ok() {
|
||||
|
@ -471,13 +491,13 @@ impl SameMusic {
|
|||
}
|
||||
let mut hash_map: BTreeMap<String, Vec<MusicEntry>> = Default::default();
|
||||
for file_entry in vec_file_entry {
|
||||
let mut title = file_entry.title.to_lowercase().trim().to_string();
|
||||
let mut thing = file_entry.track_title.to_lowercase().trim().to_string();
|
||||
if self.approximate_comparison {
|
||||
get_approximate_conversion(&mut title);
|
||||
get_approximate_conversion(&mut thing);
|
||||
}
|
||||
if !title.is_empty() {
|
||||
hash_map.entry(title.clone()).or_insert_with(Vec::new);
|
||||
hash_map.get_mut(title.as_str()).unwrap().push(file_entry);
|
||||
if !thing.is_empty() {
|
||||
hash_map.entry(thing.clone()).or_insert_with(Vec::new);
|
||||
hash_map.get_mut(thing.as_str()).unwrap().push(file_entry);
|
||||
}
|
||||
}
|
||||
for (_title, vec_file_entry) in hash_map {
|
||||
|
@ -489,8 +509,7 @@ impl SameMusic {
|
|||
old_duplicates = new_duplicates;
|
||||
new_duplicates = Vec::new();
|
||||
}
|
||||
|
||||
if (self.music_similarity & MusicSimilarity::ARTIST) == MusicSimilarity::ARTIST {
|
||||
if (self.music_similarity & MusicSimilarity::TRACK_ARTIST) == MusicSimilarity::TRACK_ARTIST {
|
||||
for vec_file_entry in old_duplicates {
|
||||
atomic_file_counter.fetch_add(1, Ordering::Relaxed);
|
||||
if stop_receiver.is_some() && stop_receiver.unwrap().try_recv().is_ok() {
|
||||
|
@ -501,16 +520,16 @@ impl SameMusic {
|
|||
}
|
||||
let mut hash_map: BTreeMap<String, Vec<MusicEntry>> = Default::default();
|
||||
for file_entry in vec_file_entry {
|
||||
let mut artist = file_entry.artist.to_lowercase().trim().to_string();
|
||||
let mut thing = file_entry.track_artist.to_lowercase().trim().to_string();
|
||||
if self.approximate_comparison {
|
||||
get_approximate_conversion(&mut artist);
|
||||
get_approximate_conversion(&mut thing);
|
||||
}
|
||||
if !artist.is_empty() {
|
||||
hash_map.entry(artist.clone()).or_insert_with(Vec::new);
|
||||
hash_map.get_mut(artist.as_str()).unwrap().push(file_entry);
|
||||
if !thing.is_empty() {
|
||||
hash_map.entry(thing.clone()).or_insert_with(Vec::new);
|
||||
hash_map.get_mut(thing.as_str()).unwrap().push(file_entry);
|
||||
}
|
||||
}
|
||||
for (_artist, vec_file_entry) in hash_map {
|
||||
for (_title, vec_file_entry) in hash_map {
|
||||
if vec_file_entry.len() > 1 {
|
||||
new_duplicates.push(vec_file_entry);
|
||||
}
|
||||
|
@ -519,67 +538,6 @@ impl SameMusic {
|
|||
old_duplicates = new_duplicates;
|
||||
new_duplicates = Vec::new();
|
||||
}
|
||||
|
||||
if (self.music_similarity & MusicSimilarity::ALBUM_TITLE) == MusicSimilarity::ALBUM_TITLE {
|
||||
for vec_file_entry in old_duplicates {
|
||||
atomic_file_counter.fetch_add(1, Ordering::Relaxed);
|
||||
if stop_receiver.is_some() && stop_receiver.unwrap().try_recv().is_ok() {
|
||||
// End thread which send info to gui
|
||||
progress_thread_run.store(false, Ordering::Relaxed);
|
||||
progress_thread_handle.join().unwrap();
|
||||
return false;
|
||||
}
|
||||
let mut hash_map: BTreeMap<String, Vec<MusicEntry>> = Default::default();
|
||||
for file_entry in vec_file_entry {
|
||||
let mut album_title = file_entry.album_title.to_lowercase().trim().to_string();
|
||||
if self.approximate_comparison {
|
||||
get_approximate_conversion(&mut album_title);
|
||||
}
|
||||
if !album_title.is_empty() {
|
||||
hash_map.entry(album_title.clone()).or_insert_with(Vec::new);
|
||||
hash_map.get_mut(album_title.as_str()).unwrap().push(file_entry);
|
||||
}
|
||||
}
|
||||
for (_album_title, vec_file_entry) in hash_map {
|
||||
if vec_file_entry.len() > 1 {
|
||||
new_duplicates.push(vec_file_entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
old_duplicates = new_duplicates;
|
||||
new_duplicates = Vec::new();
|
||||
}
|
||||
|
||||
if (self.music_similarity & MusicSimilarity::ALBUM_ARTIST) == MusicSimilarity::ALBUM_ARTIST {
|
||||
for vec_file_entry in old_duplicates {
|
||||
atomic_file_counter.fetch_add(1, Ordering::Relaxed);
|
||||
if stop_receiver.is_some() && stop_receiver.unwrap().try_recv().is_ok() {
|
||||
// End thread which send info to gui
|
||||
progress_thread_run.store(false, Ordering::Relaxed);
|
||||
progress_thread_handle.join().unwrap();
|
||||
return false;
|
||||
}
|
||||
let mut hash_map: BTreeMap<String, Vec<MusicEntry>> = Default::default();
|
||||
for file_entry in vec_file_entry {
|
||||
let mut album_artist = file_entry.album_artist.to_lowercase().trim().to_string();
|
||||
if self.approximate_comparison {
|
||||
get_approximate_conversion(&mut album_artist);
|
||||
}
|
||||
if !album_artist.is_empty() {
|
||||
hash_map.entry(album_artist.clone()).or_insert_with(Vec::new);
|
||||
hash_map.get_mut(album_artist.as_str()).unwrap().push(file_entry);
|
||||
}
|
||||
}
|
||||
for (_album_artist, vec_file_entry) in hash_map {
|
||||
if vec_file_entry.len() > 1 {
|
||||
new_duplicates.push(vec_file_entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
old_duplicates = new_duplicates;
|
||||
new_duplicates = Vec::new();
|
||||
}
|
||||
|
||||
if (self.music_similarity & MusicSimilarity::YEAR) == MusicSimilarity::YEAR {
|
||||
for vec_file_entry in old_duplicates {
|
||||
atomic_file_counter.fetch_add(1, Ordering::Relaxed);
|
||||
|
@ -589,15 +547,95 @@ impl SameMusic {
|
|||
progress_thread_handle.join().unwrap();
|
||||
return false;
|
||||
}
|
||||
let mut hash_map: BTreeMap<i32, Vec<MusicEntry>> = Default::default();
|
||||
let mut hash_map: BTreeMap<String, Vec<MusicEntry>> = Default::default();
|
||||
for file_entry in vec_file_entry {
|
||||
let year = file_entry.year;
|
||||
if year != 0 {
|
||||
hash_map.entry(year).or_insert_with(Vec::new);
|
||||
hash_map.get_mut(&year).unwrap().push(file_entry);
|
||||
let thing = file_entry.year.to_lowercase().trim().to_string();
|
||||
if !thing.is_empty() {
|
||||
hash_map.entry(thing.clone()).or_insert_with(Vec::new);
|
||||
hash_map.get_mut(thing.as_str()).unwrap().push(file_entry);
|
||||
}
|
||||
}
|
||||
for (_year, vec_file_entry) in hash_map {
|
||||
for (_title, vec_file_entry) in hash_map {
|
||||
if vec_file_entry.len() > 1 {
|
||||
new_duplicates.push(vec_file_entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
old_duplicates = new_duplicates;
|
||||
new_duplicates = Vec::new();
|
||||
}
|
||||
if (self.music_similarity & MusicSimilarity::LENGTH) == MusicSimilarity::LENGTH {
|
||||
for vec_file_entry in old_duplicates {
|
||||
atomic_file_counter.fetch_add(1, Ordering::Relaxed);
|
||||
if stop_receiver.is_some() && stop_receiver.unwrap().try_recv().is_ok() {
|
||||
// End thread which send info to gui
|
||||
progress_thread_run.store(false, Ordering::Relaxed);
|
||||
progress_thread_handle.join().unwrap();
|
||||
return false;
|
||||
}
|
||||
let mut hash_map: BTreeMap<String, Vec<MusicEntry>> = Default::default();
|
||||
for file_entry in vec_file_entry {
|
||||
let thing = file_entry.length.to_lowercase().trim().to_string();
|
||||
if !thing.is_empty() {
|
||||
hash_map.entry(thing.clone()).or_insert_with(Vec::new);
|
||||
hash_map.get_mut(thing.as_str()).unwrap().push(file_entry);
|
||||
}
|
||||
}
|
||||
for (_title, vec_file_entry) in hash_map {
|
||||
if vec_file_entry.len() > 1 {
|
||||
new_duplicates.push(vec_file_entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
old_duplicates = new_duplicates;
|
||||
new_duplicates = Vec::new();
|
||||
}
|
||||
if (self.music_similarity & MusicSimilarity::GENRE) == MusicSimilarity::GENRE {
|
||||
for vec_file_entry in old_duplicates {
|
||||
atomic_file_counter.fetch_add(1, Ordering::Relaxed);
|
||||
if stop_receiver.is_some() && stop_receiver.unwrap().try_recv().is_ok() {
|
||||
// End thread which send info to gui
|
||||
progress_thread_run.store(false, Ordering::Relaxed);
|
||||
progress_thread_handle.join().unwrap();
|
||||
return false;
|
||||
}
|
||||
let mut hash_map: BTreeMap<String, Vec<MusicEntry>> = Default::default();
|
||||
for file_entry in vec_file_entry {
|
||||
let thing = file_entry.genre.to_lowercase().trim().to_string();
|
||||
if !thing.is_empty() {
|
||||
hash_map.entry(thing.clone()).or_insert_with(Vec::new);
|
||||
hash_map.get_mut(thing.as_str()).unwrap().push(file_entry);
|
||||
}
|
||||
}
|
||||
for (_title, vec_file_entry) in hash_map {
|
||||
if vec_file_entry.len() > 1 {
|
||||
new_duplicates.push(vec_file_entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
old_duplicates = new_duplicates;
|
||||
new_duplicates = Vec::new();
|
||||
}
|
||||
if (self.music_similarity & MusicSimilarity::BITRATE) == MusicSimilarity::BITRATE {
|
||||
for vec_file_entry in old_duplicates {
|
||||
atomic_file_counter.fetch_add(1, Ordering::Relaxed);
|
||||
if stop_receiver.is_some() && stop_receiver.unwrap().try_recv().is_ok() {
|
||||
// End thread which send info to gui
|
||||
progress_thread_run.store(false, Ordering::Relaxed);
|
||||
progress_thread_handle.join().unwrap();
|
||||
return false;
|
||||
}
|
||||
let mut hash_map: BTreeMap<String, Vec<MusicEntry>> = Default::default();
|
||||
for file_entry in vec_file_entry {
|
||||
if file_entry.bitrate != 0 {
|
||||
let thing = file_entry.bitrate.to_string();
|
||||
if !thing.is_empty() {
|
||||
hash_map.entry(thing.clone()).or_insert_with(Vec::new);
|
||||
hash_map.get_mut(thing.as_str()).unwrap().push(file_entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (_title, vec_file_entry) in hash_map {
|
||||
if vec_file_entry.len() > 1 {
|
||||
new_duplicates.push(vec_file_entry);
|
||||
}
|
||||
|
@ -841,12 +879,13 @@ impl PrintResults for SameMusic {
|
|||
for vec_file_entry in self.duplicated_music_entries.iter() {
|
||||
for file_entry in vec_file_entry {
|
||||
println!(
|
||||
"T: {} - A: {} - Y: {} - AT: {} - AA: {} - P: {}",
|
||||
file_entry.title,
|
||||
file_entry.artist,
|
||||
"TT: {} - TA: {} - Y: {} - L: {} - G: {} - B: {} - P: {}",
|
||||
file_entry.track_title,
|
||||
file_entry.track_artist,
|
||||
file_entry.year,
|
||||
file_entry.album_title,
|
||||
file_entry.album_artist,
|
||||
file_entry.length,
|
||||
file_entry.genre,
|
||||
file_entry.bitrate,
|
||||
file_entry.path.display()
|
||||
);
|
||||
}
|
||||
|
|
|
@ -11,9 +11,10 @@ general_close_button = Close
|
|||
# Main window
|
||||
music_title_checkbox = Title
|
||||
music_artist_checkbox = Artist
|
||||
music_album_title_checkbox = Album Title
|
||||
music_album_artist_checkbox = Album Artist
|
||||
music_year_checkbox = Year
|
||||
music_bitrate_checkbox = Bitrate
|
||||
music_genre_checkbox = Genre
|
||||
music_length_checkbox = Length
|
||||
music_comparison_checkbox = Approximate Comparison
|
||||
|
||||
music_comparison_checkbox_tooltip =
|
||||
|
@ -83,8 +84,9 @@ main_tree_view_column_dimensions = Dimensions
|
|||
main_tree_view_column_title = Title
|
||||
main_tree_view_column_artist = Artist
|
||||
main_tree_view_column_year = Year
|
||||
main_tree_view_column_album_title = Album Title
|
||||
main_tree_view_column_album_artist = Album Artist
|
||||
main_tree_view_column_bitrate = Bitrate
|
||||
main_tree_view_column_length = Length
|
||||
main_tree_view_column_genre = Genre
|
||||
main_tree_view_column_symlink_file_name = Symlink File Name
|
||||
main_tree_view_column_symlink_folder = Symlnik Folder
|
||||
main_tree_view_column_destination_path = Destination Path
|
||||
|
|
|
@ -1168,11 +1168,12 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
|
|||
|
||||
let music_similarity = *mf.get_music_similarity();
|
||||
|
||||
let is_title = (MusicSimilarity::TITLE & music_similarity) != MusicSimilarity::NONE;
|
||||
let is_artist = (MusicSimilarity::ARTIST & music_similarity) != MusicSimilarity::NONE;
|
||||
let is_album_title = (MusicSimilarity::ALBUM_TITLE & music_similarity) != MusicSimilarity::NONE;
|
||||
let is_album_artist = (MusicSimilarity::ALBUM_ARTIST & music_similarity) != MusicSimilarity::NONE;
|
||||
let is_track_title = (MusicSimilarity::TRACK_TITLE & music_similarity) != MusicSimilarity::NONE;
|
||||
let is_track_artist = (MusicSimilarity::TRACK_ARTIST & music_similarity) != MusicSimilarity::NONE;
|
||||
let is_year = (MusicSimilarity::YEAR & music_similarity) != MusicSimilarity::NONE;
|
||||
let is_bitrate = (MusicSimilarity::BITRATE & music_similarity) != MusicSimilarity::NONE;
|
||||
let is_length = (MusicSimilarity::LENGTH & music_similarity) != MusicSimilarity::NONE;
|
||||
let is_genre = (MusicSimilarity::GENRE & music_similarity) != MusicSimilarity::NONE;
|
||||
|
||||
if mf.get_use_reference() {
|
||||
let vector = mf.get_similar_music_referenced();
|
||||
|
@ -1191,18 +1192,20 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
|
|||
};
|
||||
|
||||
let (directory, file) = split_path(&base_file_entry.path);
|
||||
let values: [(u32, &dyn ToValue); 15] = [
|
||||
let values: [(u32, &dyn ToValue); 17] = [
|
||||
(ColumnsSameMusic::ActivatableSelectButton as u32, &false),
|
||||
(ColumnsSameMusic::SelectionButton as u32, &false),
|
||||
(ColumnsSameMusic::Size as u32, &base_file_entry.size.file_size(options::BINARY).unwrap()),
|
||||
(ColumnsSameMusic::SizeAsBytes as u32, &base_file_entry.size),
|
||||
(ColumnsSameMusic::Name as u32, &file),
|
||||
(ColumnsSameMusic::Path as u32, &directory),
|
||||
(ColumnsSameMusic::Title as u32, &base_file_entry.title),
|
||||
(ColumnsSameMusic::Artist as u32, &base_file_entry.artist),
|
||||
(ColumnsSameMusic::AlbumTitle as u32, &base_file_entry.album_title),
|
||||
(ColumnsSameMusic::AlbumArtist as u32, &base_file_entry.album_artist),
|
||||
(ColumnsSameMusic::Title as u32, &base_file_entry.track_title),
|
||||
(ColumnsSameMusic::Artist as u32, &base_file_entry.track_artist),
|
||||
(ColumnsSameMusic::Year as u32, &base_file_entry.year.to_string()),
|
||||
(ColumnsSameMusic::Genre as u32, &base_file_entry.genre),
|
||||
(ColumnsSameMusic::Bitrate as u32, &(format!("{} kbps", base_file_entry.bitrate))),
|
||||
(ColumnsSameMusic::BitrateAsNumber as u32, &(base_file_entry.bitrate)),
|
||||
(ColumnsSameMusic::Length as u32, &base_file_entry.length),
|
||||
(
|
||||
ColumnsSameMusic::Modification as u32,
|
||||
&(NaiveDateTime::from_timestamp(base_file_entry.modified_date as i64, 0).to_string()),
|
||||
|
@ -1214,18 +1217,20 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
|
|||
list_store.set(&list_store.append(), &values);
|
||||
for file_entry in vec_file_entry {
|
||||
let (directory, file) = split_path(&file_entry.path);
|
||||
let values: [(u32, &dyn ToValue); 15] = [
|
||||
let values: [(u32, &dyn ToValue); 17] = [
|
||||
(ColumnsSameMusic::ActivatableSelectButton as u32, &true),
|
||||
(ColumnsSameMusic::SelectionButton as u32, &false),
|
||||
(ColumnsSameMusic::Size as u32, &file_entry.size.file_size(options::BINARY).unwrap()),
|
||||
(ColumnsSameMusic::SizeAsBytes as u32, &file_entry.size),
|
||||
(ColumnsSameMusic::Name as u32, &file),
|
||||
(ColumnsSameMusic::Path as u32, &directory),
|
||||
(ColumnsSameMusic::Title as u32, &file_entry.title),
|
||||
(ColumnsSameMusic::Artist as u32, &file_entry.artist),
|
||||
(ColumnsSameMusic::AlbumTitle as u32, &file_entry.album_title),
|
||||
(ColumnsSameMusic::AlbumArtist as u32, &file_entry.album_artist),
|
||||
(ColumnsSameMusic::Year as u32, &file_entry.year.to_string()),
|
||||
(ColumnsSameMusic::Title as u32, &base_file_entry.track_title),
|
||||
(ColumnsSameMusic::Artist as u32, &base_file_entry.track_artist),
|
||||
(ColumnsSameMusic::Year as u32, &base_file_entry.year.to_string()),
|
||||
(ColumnsSameMusic::Genre as u32, &base_file_entry.genre),
|
||||
(ColumnsSameMusic::Bitrate as u32, &(format!("{} kbps", base_file_entry.bitrate))),
|
||||
(ColumnsSameMusic::BitrateAsNumber as u32, &(base_file_entry.bitrate)),
|
||||
(ColumnsSameMusic::Length as u32, &base_file_entry.length),
|
||||
(
|
||||
ColumnsSameMusic::Modification as u32,
|
||||
&(NaiveDateTime::from_timestamp(file_entry.modified_date as i64, 0).to_string()),
|
||||
|
@ -1255,7 +1260,7 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
|
|||
vec_file_entry.clone()
|
||||
};
|
||||
|
||||
let values: [(u32, &dyn ToValue); 15] = [
|
||||
let values: [(u32, &dyn ToValue); 17] = [
|
||||
(ColumnsSameMusic::ActivatableSelectButton as u32, &false),
|
||||
(ColumnsSameMusic::SelectionButton as u32, &false),
|
||||
(ColumnsSameMusic::Size as u32, &"".to_string()),
|
||||
|
@ -1264,28 +1269,14 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
|
|||
(ColumnsSameMusic::Path as u32, &"".to_string()),
|
||||
(
|
||||
ColumnsSameMusic::Title as u32,
|
||||
&(match is_title {
|
||||
&(match is_track_title {
|
||||
true => text.clone(),
|
||||
false => "".to_string(),
|
||||
}),
|
||||
),
|
||||
(
|
||||
ColumnsSameMusic::Artist as u32,
|
||||
&(match is_artist {
|
||||
true => text.clone(),
|
||||
false => "".to_string(),
|
||||
}),
|
||||
),
|
||||
(
|
||||
ColumnsSameMusic::AlbumTitle as u32,
|
||||
&(match is_album_title {
|
||||
true => text.clone(),
|
||||
false => "".to_string(),
|
||||
}),
|
||||
),
|
||||
(
|
||||
ColumnsSameMusic::AlbumArtist as u32,
|
||||
&(match is_album_artist {
|
||||
&(match is_track_artist {
|
||||
true => text.clone(),
|
||||
false => "".to_string(),
|
||||
}),
|
||||
|
@ -1297,6 +1288,28 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
|
|||
false => "".to_string(),
|
||||
}),
|
||||
),
|
||||
(
|
||||
ColumnsSameMusic::Bitrate as u32,
|
||||
&(match is_bitrate {
|
||||
true => text.clone(),
|
||||
false => "".to_string(),
|
||||
}),
|
||||
),
|
||||
(ColumnsSameMusic::BitrateAsNumber as u32, &(0)),
|
||||
(
|
||||
ColumnsSameMusic::Genre as u32,
|
||||
&(match is_genre {
|
||||
true => text.clone(),
|
||||
false => "".to_string(),
|
||||
}),
|
||||
),
|
||||
(
|
||||
ColumnsSameMusic::Length as u32,
|
||||
&(match is_length {
|
||||
true => text.clone(),
|
||||
false => "".to_string(),
|
||||
}),
|
||||
),
|
||||
(ColumnsSameMusic::Modification as u32, &"".to_string()),
|
||||
(ColumnsSameMusic::ModificationAsSecs as u32, &(0)),
|
||||
(ColumnsSameMusic::Color as u32, &(HEADER_ROW_COLOR.to_string())),
|
||||
|
@ -1305,18 +1318,20 @@ pub fn connect_compute_results(gui_data: &GuiData, glib_stop_receiver: Receiver<
|
|||
list_store.set(&list_store.append(), &values);
|
||||
for file_entry in vec_file_entry {
|
||||
let (directory, file) = split_path(&file_entry.path);
|
||||
let values: [(u32, &dyn ToValue); 15] = [
|
||||
let values: [(u32, &dyn ToValue); 17] = [
|
||||
(ColumnsSameMusic::ActivatableSelectButton as u32, &true),
|
||||
(ColumnsSameMusic::SelectionButton as u32, &false),
|
||||
(ColumnsSameMusic::Size as u32, &file_entry.size.file_size(options::BINARY).unwrap()),
|
||||
(ColumnsSameMusic::SizeAsBytes as u32, &file_entry.size),
|
||||
(ColumnsSameMusic::Name as u32, &file),
|
||||
(ColumnsSameMusic::Path as u32, &directory),
|
||||
(ColumnsSameMusic::Title as u32, &file_entry.title),
|
||||
(ColumnsSameMusic::Artist as u32, &file_entry.artist),
|
||||
(ColumnsSameMusic::AlbumTitle as u32, &file_entry.album_title),
|
||||
(ColumnsSameMusic::AlbumArtist as u32, &file_entry.album_artist),
|
||||
(ColumnsSameMusic::Title as u32, &file_entry.track_title),
|
||||
(ColumnsSameMusic::Artist as u32, &file_entry.track_artist),
|
||||
(ColumnsSameMusic::Year as u32, &file_entry.year.to_string()),
|
||||
(ColumnsSameMusic::Genre as u32, &file_entry.genre),
|
||||
(ColumnsSameMusic::Bitrate as u32, &(format!("{} kbps", file_entry.bitrate))),
|
||||
(ColumnsSameMusic::BitrateAsNumber as u32, &(file_entry.bitrate)),
|
||||
(ColumnsSameMusic::Length as u32, &file_entry.length),
|
||||
(
|
||||
ColumnsSameMusic::Modification as u32,
|
||||
&(NaiveDateTime::from_timestamp(file_entry.modified_date as i64, 0).to_string()),
|
||||
|
|
|
@ -53,11 +53,12 @@ pub fn connect_button_search(
|
|||
let buttons_names = gui_data.bottom_buttons.buttons_names;
|
||||
let buttons_search_clone = gui_data.bottom_buttons.buttons_search.clone();
|
||||
let check_button_duplicates_use_prehash_cache = gui_data.settings.check_button_duplicates_use_prehash_cache.clone();
|
||||
let check_button_music_album_artist: gtk::CheckButton = gui_data.main_notebook.check_button_music_album_artist.clone();
|
||||
let check_button_music_album_title: gtk::CheckButton = gui_data.main_notebook.check_button_music_album_title.clone();
|
||||
let check_button_music_artist: gtk::CheckButton = gui_data.main_notebook.check_button_music_artist.clone();
|
||||
let check_button_music_title: gtk::CheckButton = gui_data.main_notebook.check_button_music_title.clone();
|
||||
let check_button_music_year: gtk::CheckButton = gui_data.main_notebook.check_button_music_year.clone();
|
||||
let check_button_music_genre: gtk::CheckButton = gui_data.main_notebook.check_button_music_genre.clone();
|
||||
let check_button_music_length: gtk::CheckButton = gui_data.main_notebook.check_button_music_length.clone();
|
||||
let check_button_music_bitrate: gtk::CheckButton = gui_data.main_notebook.check_button_music_bitrate.clone();
|
||||
let check_button_recursive = gui_data.upper_notebook.check_button_recursive.clone();
|
||||
let check_button_settings_duplicates_delete_outdated_cache = gui_data.settings.check_button_settings_duplicates_delete_outdated_cache.clone();
|
||||
let check_button_settings_hide_hard_links = gui_data.settings.check_button_settings_hide_hard_links.clone();
|
||||
|
@ -385,20 +386,23 @@ pub fn connect_button_search(
|
|||
let mut music_similarity: MusicSimilarity = MusicSimilarity::NONE;
|
||||
|
||||
if check_button_music_title.is_active() {
|
||||
music_similarity |= MusicSimilarity::TITLE;
|
||||
music_similarity |= MusicSimilarity::TRACK_TITLE;
|
||||
}
|
||||
if check_button_music_artist.is_active() {
|
||||
music_similarity |= MusicSimilarity::ARTIST;
|
||||
}
|
||||
if check_button_music_album_title.is_active() {
|
||||
music_similarity |= MusicSimilarity::ALBUM_TITLE;
|
||||
}
|
||||
if check_button_music_album_artist.is_active() {
|
||||
music_similarity |= MusicSimilarity::ALBUM_ARTIST;
|
||||
music_similarity |= MusicSimilarity::TRACK_ARTIST;
|
||||
}
|
||||
if check_button_music_year.is_active() {
|
||||
music_similarity |= MusicSimilarity::YEAR;
|
||||
}
|
||||
if check_button_music_bitrate.is_active() {
|
||||
music_similarity |= MusicSimilarity::BITRATE;
|
||||
}
|
||||
if check_button_music_genre.is_active() {
|
||||
music_similarity |= MusicSimilarity::GENRE;
|
||||
}
|
||||
if check_button_music_length.is_active() {
|
||||
music_similarity |= MusicSimilarity::LENGTH;
|
||||
}
|
||||
|
||||
if music_similarity != MusicSimilarity::NONE {
|
||||
let futures_sender_same_music = futures_sender_same_music.clone();
|
||||
|
|
|
@ -538,17 +538,6 @@ pub fn create_tree_view_same_music(tree_view: >k::TreeView) {
|
|||
column.add_attribute(&renderer, "foreground", ColumnsSameMusic::TextColor as i32);
|
||||
tree_view.append_column(&column);
|
||||
|
||||
let renderer = gtk::CellRendererText::new();
|
||||
let column: gtk::TreeViewColumn = TreeViewColumn::new();
|
||||
column.pack_start(&renderer, true);
|
||||
column.set_title("Path");
|
||||
column.set_resizable(true);
|
||||
column.set_min_width(50);
|
||||
column.add_attribute(&renderer, "text", ColumnsSameMusic::Path as i32);
|
||||
column.add_attribute(&renderer, "background", ColumnsSameMusic::Color as i32);
|
||||
column.add_attribute(&renderer, "foreground", ColumnsSameMusic::TextColor as i32);
|
||||
tree_view.append_column(&column);
|
||||
|
||||
let renderer = gtk::CellRendererText::new();
|
||||
let column: gtk::TreeViewColumn = TreeViewColumn::new();
|
||||
column.pack_start(&renderer, true);
|
||||
|
@ -585,10 +574,10 @@ pub fn create_tree_view_same_music(tree_view: >k::TreeView) {
|
|||
let renderer = gtk::CellRendererText::new();
|
||||
let column: gtk::TreeViewColumn = TreeViewColumn::new();
|
||||
column.pack_start(&renderer, true);
|
||||
column.set_title("Album Title");
|
||||
column.set_title("Bitrate");
|
||||
column.set_resizable(true);
|
||||
column.set_min_width(50);
|
||||
column.add_attribute(&renderer, "text", ColumnsSameMusic::AlbumTitle as i32);
|
||||
column.add_attribute(&renderer, "text", ColumnsSameMusic::Bitrate as i32);
|
||||
column.add_attribute(&renderer, "background", ColumnsSameMusic::Color as i32);
|
||||
column.add_attribute(&renderer, "foreground", ColumnsSameMusic::TextColor as i32);
|
||||
tree_view.append_column(&column);
|
||||
|
@ -596,10 +585,32 @@ pub fn create_tree_view_same_music(tree_view: >k::TreeView) {
|
|||
let renderer = gtk::CellRendererText::new();
|
||||
let column: gtk::TreeViewColumn = TreeViewColumn::new();
|
||||
column.pack_start(&renderer, true);
|
||||
column.set_title("Album Artist");
|
||||
column.set_title("Length");
|
||||
column.set_resizable(true);
|
||||
column.set_min_width(50);
|
||||
column.add_attribute(&renderer, "text", ColumnsSameMusic::AlbumArtist as i32);
|
||||
column.add_attribute(&renderer, "text", ColumnsSameMusic::Length as i32);
|
||||
column.add_attribute(&renderer, "background", ColumnsSameMusic::Color as i32);
|
||||
column.add_attribute(&renderer, "foreground", ColumnsSameMusic::TextColor as i32);
|
||||
tree_view.append_column(&column);
|
||||
|
||||
let renderer = gtk::CellRendererText::new();
|
||||
let column: gtk::TreeViewColumn = TreeViewColumn::new();
|
||||
column.pack_start(&renderer, true);
|
||||
column.set_title("Genre");
|
||||
column.set_resizable(true);
|
||||
column.set_min_width(50);
|
||||
column.add_attribute(&renderer, "text", ColumnsSameMusic::Genre as i32);
|
||||
column.add_attribute(&renderer, "background", ColumnsSameMusic::Color as i32);
|
||||
column.add_attribute(&renderer, "foreground", ColumnsSameMusic::TextColor as i32);
|
||||
tree_view.append_column(&column);
|
||||
|
||||
let renderer = gtk::CellRendererText::new();
|
||||
let column: gtk::TreeViewColumn = TreeViewColumn::new();
|
||||
column.pack_start(&renderer, true);
|
||||
column.set_title("Path");
|
||||
column.set_resizable(true);
|
||||
column.set_min_width(50);
|
||||
column.add_attribute(&renderer, "text", ColumnsSameMusic::Path as i32);
|
||||
column.add_attribute(&renderer, "background", ColumnsSameMusic::Color as i32);
|
||||
column.add_attribute(&renderer, "foreground", ColumnsSameMusic::TextColor as i32);
|
||||
tree_view.append_column(&column);
|
||||
|
|
|
@ -16,7 +16,7 @@ pub struct GuiAbout {
|
|||
|
||||
impl GuiAbout {
|
||||
pub fn create_from_builder(window_main: &Window, logo: &Pixbuf) -> Self {
|
||||
let glade_src = include_str!("../../ui/about_dialog.glade").to_string();
|
||||
let glade_src = include_str!("../../ui/about_dialog.ui").to_string();
|
||||
let builder = Builder::from_string(glade_src.as_str());
|
||||
|
||||
let about_dialog: gtk::AboutDialog = builder.object("about_dialog").unwrap();
|
||||
|
|
|
@ -30,7 +30,7 @@ pub struct GuiCompareImages {
|
|||
|
||||
impl GuiCompareImages {
|
||||
pub fn create_from_builder(window_main: >k::Window) -> Self {
|
||||
let glade_src = include_str!("../../ui/compare_images.glade").to_string();
|
||||
let glade_src = include_str!("../../ui/compare_images.ui").to_string();
|
||||
let builder = Builder::from_string(glade_src.as_str());
|
||||
|
||||
let window_compare: gtk::Window = builder.object("window_compare").unwrap();
|
||||
|
|
|
@ -88,7 +88,7 @@ pub struct GuiData {
|
|||
impl GuiData {
|
||||
pub fn new_with_application(application: >k::Application) -> Self {
|
||||
//// Loading glade file content and build with it help UI
|
||||
let glade_src = include_str!("../../ui/main_window.glade").to_string();
|
||||
let glade_src = include_str!("../../ui/main_window.ui").to_string();
|
||||
let builder = Builder::from_string(glade_src.as_str());
|
||||
|
||||
//// Windows
|
||||
|
|
|
@ -104,9 +104,10 @@ pub struct GuiMainNotebook {
|
|||
// Music
|
||||
pub check_button_music_title: gtk::CheckButton,
|
||||
pub check_button_music_artist: gtk::CheckButton,
|
||||
pub check_button_music_album_title: gtk::CheckButton,
|
||||
pub check_button_music_album_artist: gtk::CheckButton,
|
||||
pub check_button_music_year: gtk::CheckButton,
|
||||
pub check_button_music_bitrate: gtk::CheckButton,
|
||||
pub check_button_music_genre: gtk::CheckButton,
|
||||
pub check_button_music_length: gtk::CheckButton,
|
||||
pub check_button_music_approximate_comparison: gtk::CheckButton,
|
||||
}
|
||||
|
||||
|
@ -199,9 +200,10 @@ impl GuiMainNotebook {
|
|||
//// Check Buttons
|
||||
let check_button_music_title: gtk::CheckButton = builder.object("check_button_music_title").unwrap();
|
||||
let check_button_music_artist: gtk::CheckButton = builder.object("check_button_music_artist").unwrap();
|
||||
let check_button_music_album_title: gtk::CheckButton = builder.object("check_button_music_album_title").unwrap();
|
||||
let check_button_music_album_artist: gtk::CheckButton = builder.object("check_button_music_album_artist").unwrap();
|
||||
let check_button_music_year: gtk::CheckButton = builder.object("check_button_music_year").unwrap();
|
||||
let check_button_music_bitrate: gtk::CheckButton = builder.object("check_button_music_bitrate").unwrap();
|
||||
let check_button_music_genre: gtk::CheckButton = builder.object("check_button_music_genre").unwrap();
|
||||
let check_button_music_length: gtk::CheckButton = builder.object("check_button_music_length").unwrap();
|
||||
let check_button_music_approximate_comparison: gtk::CheckButton = builder.object("check_button_music_approximate_comparison").unwrap();
|
||||
|
||||
//// Radio Buttons
|
||||
|
@ -270,9 +272,10 @@ impl GuiMainNotebook {
|
|||
entry_big_files_number,
|
||||
check_button_music_title,
|
||||
check_button_music_artist,
|
||||
check_button_music_album_title,
|
||||
check_button_music_album_artist,
|
||||
check_button_music_year,
|
||||
check_button_music_bitrate,
|
||||
check_button_music_genre,
|
||||
check_button_music_length,
|
||||
check_button_music_approximate_comparison,
|
||||
scale_similarity_similar_images,
|
||||
scale_similarity_similar_videos,
|
||||
|
@ -319,9 +322,10 @@ impl GuiMainNotebook {
|
|||
pub fn update_language(&self) {
|
||||
self.check_button_music_title.set_label(&flg!("music_title_checkbox"));
|
||||
self.check_button_music_artist.set_label(&flg!("music_artist_checkbox"));
|
||||
self.check_button_music_album_title.set_label(&flg!("music_album_title_checkbox"));
|
||||
self.check_button_music_album_artist.set_label(&flg!("music_album_artist_checkbox"));
|
||||
self.check_button_music_year.set_label(&flg!("music_year_checkbox"));
|
||||
self.check_button_music_bitrate.set_label(&flg!("music_bitrate_checkbox"));
|
||||
self.check_button_music_genre.set_label(&flg!("music_genre_checkbox"));
|
||||
self.check_button_music_length.set_label(&flg!("music_length_checkbox"));
|
||||
self.check_button_music_approximate_comparison.set_label(&flg!("music_comparison_checkbox"));
|
||||
|
||||
self.check_button_music_approximate_comparison
|
||||
|
@ -460,12 +464,13 @@ impl GuiMainNotebook {
|
|||
vec![
|
||||
flg!("main_tree_view_column_size"),
|
||||
flg!("main_tree_view_column_file_name"),
|
||||
flg!("main_tree_view_column_path"),
|
||||
flg!("main_tree_view_column_title"),
|
||||
flg!("main_tree_view_column_artist"),
|
||||
flg!("main_tree_view_column_year"),
|
||||
flg!("main_tree_view_column_album_title"),
|
||||
flg!("main_tree_view_column_album_artist"),
|
||||
flg!("main_tree_view_column_bitrate"),
|
||||
flg!("main_tree_view_column_length"),
|
||||
flg!("main_tree_view_column_genre"),
|
||||
flg!("main_tree_view_column_path"),
|
||||
flg!("main_tree_view_column_modification"),
|
||||
], // Music Dupliactes
|
||||
vec![
|
||||
|
|
|
@ -31,7 +31,7 @@ pub struct GuiPopovers {
|
|||
|
||||
impl GuiPopovers {
|
||||
pub fn create_from_builder() -> Self {
|
||||
let glade_src = include_str!("../../ui/popover_select.glade").to_string();
|
||||
let glade_src = include_str!("../../ui/popover_select.ui").to_string();
|
||||
let builder = Builder::from_string(glade_src.as_str());
|
||||
|
||||
let buttons_popover_select_all: gtk::Button = builder.object("buttons_popover_select_all").unwrap();
|
||||
|
@ -54,7 +54,7 @@ impl GuiPopovers {
|
|||
let popover_select: gtk::Popover = builder.object("popover_select").unwrap();
|
||||
|
||||
// Popover right click(not implemented for now)
|
||||
let glade_src = include_str!("../../ui/popover_right_click.glade").to_string();
|
||||
let glade_src = include_str!("../../ui/popover_right_click.ui").to_string();
|
||||
let builder = Builder::from_string(glade_src.as_str());
|
||||
|
||||
let buttons_popover_right_click_open_file: gtk::Button = builder.object("buttons_popover_right_click_open_file").unwrap();
|
||||
|
|
|
@ -24,7 +24,7 @@ pub struct GuiProgressDialog {
|
|||
|
||||
impl GuiProgressDialog {
|
||||
pub fn create_from_builder(window_main: &Window) -> Self {
|
||||
let glade_src = include_str!("../../ui/progress.glade").to_string();
|
||||
let glade_src = include_str!("../../ui/progress.ui").to_string();
|
||||
let builder = Builder::from_string(glade_src.as_str());
|
||||
|
||||
let window_progress: gtk::Dialog = builder.object("window_progress").unwrap();
|
||||
|
|
|
@ -53,7 +53,7 @@ pub struct GuiSettings {
|
|||
|
||||
impl GuiSettings {
|
||||
pub fn create_from_builder(window_main: &Window) -> Self {
|
||||
let glade_src = include_str!("../../ui/settings.glade").to_string();
|
||||
let glade_src = include_str!("../../ui/settings.ui").to_string();
|
||||
let builder = Builder::from_string(glade_src.as_str());
|
||||
|
||||
let window_settings: gtk::Window = builder.object("window_settings").unwrap();
|
||||
|
|
|
@ -318,9 +318,11 @@ pub enum ColumnsSameMusic {
|
|||
Path,
|
||||
Title,
|
||||
Artist,
|
||||
AlbumTitle,
|
||||
AlbumArtist,
|
||||
Year,
|
||||
Bitrate,
|
||||
BitrateAsNumber,
|
||||
Length,
|
||||
Genre,
|
||||
Modification,
|
||||
ModificationAsSecs,
|
||||
Color,
|
||||
|
|
|
@ -311,7 +311,7 @@ pub fn initialize_gui(gui_data: &mut GuiData) {
|
|||
let scrolled_window = gui_data.main_notebook.scrolled_window_same_music_finder.clone();
|
||||
let tree_view = gui_data.main_notebook.tree_view_same_music_finder.clone();
|
||||
|
||||
let col_types: [glib::types::Type; 15] = [
|
||||
let col_types: [glib::types::Type; 17] = [
|
||||
glib::types::Type::BOOL, // ActivatableSelectButton
|
||||
glib::types::Type::BOOL, // SelectionButton
|
||||
glib::types::Type::STRING, // Size
|
||||
|
@ -320,9 +320,11 @@ pub fn initialize_gui(gui_data: &mut GuiData) {
|
|||
glib::types::Type::STRING, // Path
|
||||
glib::types::Type::STRING, // Title
|
||||
glib::types::Type::STRING, // Artist
|
||||
glib::types::Type::STRING, // AlbumTitle
|
||||
glib::types::Type::STRING, // AlbumArtist
|
||||
glib::types::Type::STRING, // Year
|
||||
glib::types::Type::STRING, // Bitrate
|
||||
glib::types::Type::U64, // BitrateAsNumber
|
||||
glib::types::Type::STRING, // Length
|
||||
glib::types::Type::STRING, // Genre
|
||||
glib::types::Type::STRING, // Modification
|
||||
glib::types::Type::U64, // ModificationAsSecs
|
||||
glib::types::Type::STRING, // Color
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#![allow(clippy::collapsible_else_if)]
|
||||
#![allow(clippy::too_many_arguments)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
#![allow(clippy::needless_late_init)]
|
||||
|
||||
use gtk::prelude::*;
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue