Compare commits

..

No commits in common. "685c9b489456a09c5616b313c9176f0db0165298" and "15c4ae9bad74d467825ab413d0cfc3e1fcdac323" have entirely different histories.

43 changed files with 2466 additions and 21012 deletions

326
Cargo.lock generated
View File

@ -290,6 +290,16 @@ version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
[[package]]
name = "atomic-write-file"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edcdbedc2236483ab103a53415653d6b4442ea6141baf1ffa85df29635e88436"
dependencies = [
"nix",
"rand 0.8.5",
]
[[package]] [[package]]
name = "authdb" name = "authdb"
version = "0.1.0" version = "0.1.0"
@ -456,7 +466,7 @@ checksum = "f33613627f0dea6a731b0605101fad59ba4f193a52c96c4687728d822605a8a1"
dependencies = [ dependencies = [
"bitflags 2.4.1", "bitflags 2.4.1",
"cairo-sys-rs", "cairo-sys-rs",
"glib 0.18.4", "glib",
"libc", "libc",
"once_cell", "once_cell",
"thiserror", "thiserror",
@ -468,7 +478,7 @@ version = "0.18.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51"
dependencies = [ dependencies = [
"glib-sys 0.18.1", "glib-sys",
"libc", "libc",
"system-deps", "system-deps",
] ]
@ -779,7 +789,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"cairo-rs", "cairo-rs",
"gio", "gio",
"glib 0.18.4", "glib",
"gtk4", "gtk4",
] ]
@ -795,7 +805,7 @@ dependencies = [
"gdk4", "gdk4",
"geo-types", "geo-types",
"gio", "gio",
"glib 0.18.4", "glib",
"glib-build-tools 0.18.0", "glib-build-tools 0.18.0",
"gtk4", "gtk4",
"ifc", "ifc",
@ -1015,18 +1025,6 @@ dependencies = [
"zune-inflate", "zune-inflate",
] ]
[[package]]
name = "fallible-iterator"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7"
[[package]]
name = "fallible-streaming-iterator"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
[[package]] [[package]]
name = "fastrand" name = "fastrand"
version = "1.9.0" version = "1.9.0"
@ -1111,7 +1109,7 @@ dependencies = [
"ft-core", "ft-core",
"gdk4", "gdk4",
"gio", "gio",
"glib 0.18.4", "glib",
"glib-build-tools 0.18.0", "glib-build-tools 0.18.0",
"gtk4", "gtk4",
"libadwaita", "libadwaita",
@ -1379,7 +1377,7 @@ checksum = "446f32b74d22c33b7b258d4af4ffde53c2bf96ca2e29abdf1a785fe59bd6c82c"
dependencies = [ dependencies = [
"gdk-pixbuf-sys", "gdk-pixbuf-sys",
"gio", "gio",
"glib 0.18.4", "glib",
"libc", "libc",
"once_cell", "once_cell",
] ]
@ -1390,9 +1388,9 @@ version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7"
dependencies = [ dependencies = [
"gio-sys 0.18.1", "gio-sys",
"glib-sys 0.18.1", "glib-sys",
"gobject-sys 0.18.0", "gobject-sys",
"libc", "libc",
"system-deps", "system-deps",
] ]
@ -1407,7 +1405,7 @@ dependencies = [
"gdk-pixbuf", "gdk-pixbuf",
"gdk4-sys", "gdk4-sys",
"gio", "gio",
"glib 0.18.4", "glib",
"libc", "libc",
"pango", "pango",
] ]
@ -1420,9 +1418,9 @@ checksum = "dbab43f332a3cf1df9974da690b5bb0e26720ed09a228178ce52175372dcfef0"
dependencies = [ dependencies = [
"cairo-sys-rs", "cairo-sys-rs",
"gdk-pixbuf-sys", "gdk-pixbuf-sys",
"gio-sys 0.18.1", "gio-sys",
"glib-sys 0.18.1", "glib-sys",
"gobject-sys 0.18.0", "gobject-sys",
"libc", "libc",
"pango-sys", "pango-sys",
"pkg-config", "pkg-config",
@ -1499,8 +1497,8 @@ dependencies = [
"futures-core", "futures-core",
"futures-io", "futures-io",
"futures-util", "futures-util",
"gio-sys 0.18.1", "gio-sys",
"glib 0.18.4", "glib",
"libc", "libc",
"once_cell", "once_cell",
"pin-project-lite", "pin-project-lite",
@ -1508,54 +1506,19 @@ dependencies = [
"thiserror", "thiserror",
] ]
[[package]]
name = "gio-sys"
version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9b693b8e39d042a95547fc258a7b07349b1f0b48f4b2fa3108ba3c51c0b5229"
dependencies = [
"glib-sys 0.16.3",
"gobject-sys 0.16.3",
"libc",
"system-deps",
"winapi",
]
[[package]] [[package]]
name = "gio-sys" name = "gio-sys"
version = "0.18.1" version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2"
dependencies = [ dependencies = [
"glib-sys 0.18.1", "glib-sys",
"gobject-sys 0.18.0", "gobject-sys",
"libc", "libc",
"system-deps", "system-deps",
"winapi", "winapi",
] ]
[[package]]
name = "glib"
version = "0.16.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16aa2475c9debed5a32832cb5ff2af5a3f9e1ab9e69df58eaadc1ab2004d6eba"
dependencies = [
"bitflags 1.3.2",
"futures-channel",
"futures-core",
"futures-executor",
"futures-task",
"futures-util",
"gio-sys 0.16.3",
"glib-macros 0.16.8",
"glib-sys 0.16.3",
"gobject-sys 0.16.3",
"libc",
"once_cell",
"smallvec",
"thiserror",
]
[[package]] [[package]]
name = "glib" name = "glib"
version = "0.18.4" version = "0.18.4"
@ -1568,10 +1531,10 @@ dependencies = [
"futures-executor", "futures-executor",
"futures-task", "futures-task",
"futures-util", "futures-util",
"gio-sys 0.18.1", "gio-sys",
"glib-macros 0.18.3", "glib-macros",
"glib-sys 0.18.1", "glib-sys",
"gobject-sys 0.18.0", "gobject-sys",
"libc", "libc",
"memchr", "memchr",
"once_cell", "once_cell",
@ -1597,21 +1560,6 @@ version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3431c56f463443cba9bc3600248bc6d680cb614c2ee1cdd39dab5415bd12ac5c" checksum = "3431c56f463443cba9bc3600248bc6d680cb614c2ee1cdd39dab5415bd12ac5c"
[[package]]
name = "glib-macros"
version = "0.16.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb1a9325847aa46f1e96ffea37611b9d51fc4827e67f79e7de502a297560a67b"
dependencies = [
"anyhow",
"heck",
"proc-macro-crate 1.3.1",
"proc-macro-error",
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]] [[package]]
name = "glib-macros" name = "glib-macros"
version = "0.18.3" version = "0.18.3"
@ -1626,16 +1574,6 @@ dependencies = [
"syn 2.0.48", "syn 2.0.48",
] ]
[[package]]
name = "glib-sys"
version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c61a4f46316d06bfa33a7ac22df6f0524c8be58e3db2d9ca99ccb1f357b62a65"
dependencies = [
"libc",
"system-deps",
]
[[package]] [[package]]
name = "glib-sys" name = "glib-sys"
version = "0.18.1" version = "0.18.1"
@ -1667,7 +1605,7 @@ dependencies = [
"futures", "futures",
"gdk4", "gdk4",
"gio", "gio",
"glib 0.18.4", "glib",
"glib-build-tools 0.16.3", "glib-build-tools 0.16.3",
"gtk4", "gtk4",
"libadwaita", "libadwaita",
@ -1676,24 +1614,13 @@ dependencies = [
"tokio", "tokio",
] ]
[[package]]
name = "gobject-sys"
version = "0.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3520bb9c07ae2a12c7f2fbb24d4efc11231c8146a86956413fb1a79bb760a0f1"
dependencies = [
"glib-sys 0.16.3",
"libc",
"system-deps",
]
[[package]] [[package]]
name = "gobject-sys" name = "gobject-sys"
version = "0.18.0" version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44"
dependencies = [ dependencies = [
"glib-sys 0.18.1", "glib-sys",
"libc", "libc",
"system-deps", "system-deps",
] ]
@ -1704,7 +1631,7 @@ version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b2228cda1505613a7a956cca69076892cfbda84fc2b7a62b94a41a272c0c401" checksum = "3b2228cda1505613a7a956cca69076892cfbda84fc2b7a62b94a41a272c0c401"
dependencies = [ dependencies = [
"glib 0.18.4", "glib",
"graphene-sys", "graphene-sys",
"libc", "libc",
] ]
@ -1715,7 +1642,7 @@ version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc4144cee8fc8788f2a9b73dc5f1d4e1189d1f95305c4cb7bd9c1af1cfa31f59" checksum = "cc4144cee8fc8788f2a9b73dc5f1d4e1189d1f95305c4cb7bd9c1af1cfa31f59"
dependencies = [ dependencies = [
"glib-sys 0.18.1", "glib-sys",
"libc", "libc",
"pkg-config", "pkg-config",
"system-deps", "system-deps",
@ -1738,7 +1665,7 @@ checksum = "0d958e351d2f210309b32d081c832d7de0aca0b077aa10d88336c6379bd01f7e"
dependencies = [ dependencies = [
"cairo-rs", "cairo-rs",
"gdk4", "gdk4",
"glib 0.18.4", "glib",
"graphene-rs", "graphene-rs",
"gsk4-sys", "gsk4-sys",
"libc", "libc",
@ -1753,50 +1680,14 @@ checksum = "12bd9e3effea989f020e8f1ff3fa3b8c63ba93d43b899c11a118868853a56d55"
dependencies = [ dependencies = [
"cairo-sys-rs", "cairo-sys-rs",
"gdk4-sys", "gdk4-sys",
"glib-sys 0.18.1", "glib-sys",
"gobject-sys 0.18.0", "gobject-sys",
"graphene-sys", "graphene-sys",
"libc", "libc",
"pango-sys", "pango-sys",
"system-deps", "system-deps",
] ]
[[package]]
name = "gstreamer"
version = "0.19.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85fc926d081923c840403ec5ec3b2157a7cd236a2587c3031a4f0206f13ed500"
dependencies = [
"bitflags 1.3.2",
"cfg-if",
"futures-channel",
"futures-core",
"futures-util",
"glib 0.16.9",
"gstreamer-sys",
"libc",
"muldiv",
"num-integer",
"num-rational 0.4.1",
"once_cell",
"option-operations",
"paste",
"pretty-hex",
"thiserror",
]
[[package]]
name = "gstreamer-sys"
version = "0.19.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "545f52ad8a480732cc4290fd65dfe42952c8ae374fe581831ba15981fedf18a4"
dependencies = [
"glib-sys 0.16.3",
"gobject-sys 0.16.3",
"libc",
"system-deps",
]
[[package]] [[package]]
name = "gtk4" name = "gtk4"
version = "0.7.3" version = "0.7.3"
@ -1809,7 +1700,7 @@ dependencies = [
"gdk-pixbuf", "gdk-pixbuf",
"gdk4", "gdk4",
"gio", "gio",
"glib 0.18.4", "glib",
"graphene-rs", "graphene-rs",
"gsk4", "gsk4",
"gtk4-macros", "gtk4-macros",
@ -1841,9 +1732,9 @@ dependencies = [
"cairo-sys-rs", "cairo-sys-rs",
"gdk-pixbuf-sys", "gdk-pixbuf-sys",
"gdk4-sys", "gdk4-sys",
"gio-sys 0.18.1", "gio-sys",
"glib-sys 0.18.1", "glib-sys",
"gobject-sys 0.18.0", "gobject-sys",
"graphene-sys", "graphene-sys",
"gsk4-sys", "gsk4-sys",
"libc", "libc",
@ -1950,7 +1841,7 @@ dependencies = [
"cairo-rs", "cairo-rs",
"coordinates", "coordinates",
"gio", "gio",
"glib 0.18.4", "glib",
"glib-build-tools 0.18.0", "glib-build-tools 0.18.0",
"gtk4", "gtk4",
"image 0.24.7", "image 0.24.7",
@ -2124,22 +2015,11 @@ name = "icon-test"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"gio", "gio",
"glib 0.18.4", "glib",
"gtk4", "gtk4",
"libadwaita", "libadwaita",
] ]
[[package]]
name = "id3"
version = "1.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79f41f7e5ad125c63d55b112a98afb753742fa7f97692bfbbc52544b89e1ff1f"
dependencies = [
"bitflags 2.4.1",
"byteorder",
"flate2",
]
[[package]] [[package]]
name = "idna" name = "idna"
version = "0.1.5" version = "0.1.5"
@ -2377,7 +2257,7 @@ dependencies = [
"gdk-pixbuf", "gdk-pixbuf",
"gdk4", "gdk4",
"gio", "gio",
"glib 0.18.4", "glib",
"gtk4", "gtk4",
"libadwaita-sys", "libadwaita-sys",
"libc", "libc",
@ -2391,9 +2271,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e10aaa38de1d53374f90deeb4535209adc40cc5dba37f9704724169bceec69a" checksum = "5e10aaa38de1d53374f90deeb4535209adc40cc5dba37f9704724169bceec69a"
dependencies = [ dependencies = [
"gdk4-sys", "gdk4-sys",
"gio-sys 0.18.1", "gio-sys",
"glib-sys 0.18.1", "glib-sys",
"gobject-sys 0.18.0", "gobject-sys",
"gtk4-sys", "gtk4-sys",
"libc", "libc",
"pango-sys", "pango-sys",
@ -2414,9 +2294,9 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058"
[[package]] [[package]]
name = "libsqlite3-sys" name = "libsqlite3-sys"
version = "0.26.0" version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326" checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716"
dependencies = [ dependencies = [
"cc", "cc",
"pkg-config", "pkg-config",
@ -2605,12 +2485,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41f5c9112cb662acd3b204077e0de5bc66305fa8df65c8019d5adb10e9ab6e58" checksum = "41f5c9112cb662acd3b204077e0de5bc66305fa8df65c8019d5adb10e9ab6e58"
[[package]]
name = "muldiv"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "956787520e75e9bd233246045d19f42fb73242759cc57fba9611d940ae96d4b0"
[[package]] [[package]]
name = "multer" name = "multer"
version = "2.1.0" version = "2.1.0"
@ -2629,26 +2503,6 @@ dependencies = [
"version_check 0.9.4", "version_check 0.9.4",
] ]
[[package]]
name = "music-player"
version = "0.1.0"
dependencies = [
"gstreamer",
"id3",
"mime 0.3.17",
"mime_guess 2.0.4",
"result-extended",
"rusqlite",
"serde 1.0.193",
"serde_json",
"thiserror",
"tokio",
"url 2.5.0",
"urlencoding",
"uuid 1.6.1",
"warp",
]
[[package]] [[package]]
name = "nary_tree" name = "nary_tree"
version = "0.4.3" version = "0.4.3"
@ -2677,6 +2531,17 @@ dependencies = [
"tempfile", "tempfile",
] ]
[[package]]
name = "nix"
version = "0.27.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053"
dependencies = [
"bitflags 2.4.1",
"cfg-if",
"libc",
]
[[package]] [[package]]
name = "no-std-compat" name = "no-std-compat"
version = "0.4.1" version = "0.4.1"
@ -2840,15 +2705,6 @@ dependencies = [
"vcpkg", "vcpkg",
] ]
[[package]]
name = "option-operations"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c26d27bb1aeab65138e4bf7666045169d1717febcc9ff870166be8348b223d0"
dependencies = [
"paste",
]
[[package]] [[package]]
name = "otg-core" name = "otg-core"
version = "0.1.0" version = "0.1.0"
@ -2875,7 +2731,7 @@ dependencies = [
"async-std", "async-std",
"cairo-rs", "cairo-rs",
"gio", "gio",
"glib 0.18.4", "glib",
"glib-build-tools 0.17.10", "glib-build-tools 0.17.10",
"gtk4", "gtk4",
"image 0.24.7", "image 0.24.7",
@ -2894,7 +2750,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4"
dependencies = [ dependencies = [
"gio", "gio",
"glib 0.18.4", "glib",
"libc", "libc",
"once_cell", "once_cell",
"pango-sys", "pango-sys",
@ -2906,8 +2762,8 @@ version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5"
dependencies = [ dependencies = [
"glib-sys 0.18.1", "glib-sys",
"gobject-sys 0.18.0", "gobject-sys",
"libc", "libc",
"system-deps", "system-deps",
] ]
@ -3200,12 +3056,6 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
[[package]]
name = "pretty-hex"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6fa0831dd7cc608c38a5e323422a0077678fa5744aa2be4ad91c4ece8eec8d5"
[[package]] [[package]]
name = "pretty_env_logger" name = "pretty_env_logger"
version = "0.5.0" version = "0.5.0"
@ -3622,20 +3472,6 @@ dependencies = [
"zeroize", "zeroize",
] ]
[[package]]
name = "rusqlite"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "549b9d036d571d42e6e85d1c1425e2ac83491075078ca9a15be021c56b1641f2"
dependencies = [
"bitflags 2.4.1",
"fallible-iterator",
"fallible-streaming-iterator",
"hashlink",
"libsqlite3-sys",
"smallvec",
]
[[package]] [[package]]
name = "rustc-demangle" name = "rustc-demangle"
version = "0.1.23" version = "0.1.23"
@ -3748,7 +3584,7 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
name = "screenplay" name = "screenplay"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"glib 0.18.4", "glib",
"gtk4", "gtk4",
] ]
@ -4006,9 +3842,9 @@ dependencies = [
[[package]] [[package]]
name = "sqlx" name = "sqlx"
version = "0.7.2" version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e50c216e3624ec8e7ecd14c6a6a6370aad6ee5d8cfc3ab30b5162eeeef2ed33" checksum = "dba03c279da73694ef99763320dea58b51095dfe87d001b1d4b5fe78ba8763cf"
dependencies = [ dependencies = [
"sqlx-core", "sqlx-core",
"sqlx-macros", "sqlx-macros",
@ -4019,9 +3855,9 @@ dependencies = [
[[package]] [[package]]
name = "sqlx-core" name = "sqlx-core"
version = "0.7.2" version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d6753e460c998bbd4cd8c6f0ed9a64346fcca0723d6e75e52fdc351c5d2169d" checksum = "d84b0a3c3739e220d94b3239fd69fb1f74bc36e16643423bd99de3b43c21bfbd"
dependencies = [ dependencies = [
"ahash", "ahash",
"atoi", "atoi",
@ -4059,9 +3895,9 @@ dependencies = [
[[package]] [[package]]
name = "sqlx-macros" name = "sqlx-macros"
version = "0.7.2" version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a793bb3ba331ec8359c1853bd39eed32cdd7baaf22c35ccf5c92a7e8d1189ec" checksum = "89961c00dc4d7dffb7aee214964b065072bff69e36ddb9e2c107541f75e4f2a5"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -4072,10 +3908,11 @@ dependencies = [
[[package]] [[package]]
name = "sqlx-macros-core" name = "sqlx-macros-core"
version = "0.7.2" version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a4ee1e104e00dedb6aa5ffdd1343107b0a4702e862a84320ee7cc74782d96fc" checksum = "d0bd4519486723648186a08785143599760f7cc81c52334a55d6a83ea1e20841"
dependencies = [ dependencies = [
"atomic-write-file",
"dotenvy", "dotenvy",
"either", "either",
"heck", "heck",
@ -4097,9 +3934,9 @@ dependencies = [
[[package]] [[package]]
name = "sqlx-mysql" name = "sqlx-mysql"
version = "0.7.2" version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "864b869fdf56263f4c95c45483191ea0af340f9f3e3e7b4d57a61c7c87a970db" checksum = "e37195395df71fd068f6e2082247891bc11e3289624bbc776a0cdfa1ca7f1ea4"
dependencies = [ dependencies = [
"atoi", "atoi",
"base64 0.21.5", "base64 0.21.5",
@ -4139,9 +3976,9 @@ dependencies = [
[[package]] [[package]]
name = "sqlx-postgres" name = "sqlx-postgres"
version = "0.7.2" version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb7ae0e6a97fb3ba33b23ac2671a5ce6e3cabe003f451abd5a56e7951d975624" checksum = "d6ac0ac3b7ccd10cc96c7ab29791a7dd236bd94021f31eec7ba3d46a74aa1c24"
dependencies = [ dependencies = [
"atoi", "atoi",
"base64 0.21.5", "base64 0.21.5",
@ -4178,9 +4015,9 @@ dependencies = [
[[package]] [[package]]
name = "sqlx-sqlite" name = "sqlx-sqlite"
version = "0.7.2" version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d59dc83cf45d89c555a577694534fcd1b55c545a816c816ce51f20bbe56a4f3f" checksum = "210976b7d948c7ba9fced8ca835b11cbb2d677c59c79de41ac0d397e14547490"
dependencies = [ dependencies = [
"atoi", "atoi",
"flume", "flume",
@ -4196,6 +4033,7 @@ dependencies = [
"sqlx-core", "sqlx-core",
"tracing", "tracing",
"url 2.5.0", "url 2.5.0",
"urlencoding",
] ]
[[package]] [[package]]

View File

@ -19,7 +19,6 @@ members = [
"icon-test", "icon-test",
"ifc", "ifc",
"memorycache", "memorycache",
"music-player/server",
"nom-training", "nom-training",
"otg/core", "otg/core",
"otg/gtk", "otg/gtk",

File diff suppressed because it is too large Load Diff

View File

@ -1,27 +0,0 @@
{
"name": "music-player-client",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"build": "webpack",
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "webpack --watch"
},
"author": "Savanni D'Gerinel <savanni@luminescent-dreams.com>",
"license": "GPL-3.0-or-later",
"dependencies": {
"lodash": "^4.17.21",
"systemjs": "^6.13.0"
},
"devDependencies": {
"@types/lodash": "^4.14.191",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.3",
"style-loader": "^3.3.1",
"ts-loader": "^9.4.2",
"typescript": "^4.9.5",
"webpack": "^5.91.0",
"webpack-cli": "^5.0.1"
}
}

View File

@ -1,13 +0,0 @@
const colorGrey100 = "hsl(240 10% 95%)";
export class StyleProvider {
styles: Record<string, string> = {};
constructor() {
this.styles["backgroundColorLight"] = colorGrey100;
}
get(key: string) {
return this.styles[key]
}
}

View File

@ -1,14 +0,0 @@
{
"compilerOptions": {
"target": "es2015",
"module": "commonjs",
"moduleResolution": "node",
"rootDir": "src",
"outDir": "./dist",
"lib": ["es2016", "DOM"],
"sourceMap": true,
"strict": true,
"noImplicitAny": true
},
"include": ["src"]
}

View File

@ -1,23 +0,0 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

View File

@ -1,46 +0,0 @@
# Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).

File diff suppressed because it is too large Load Diff

View File

@ -1,43 +1,27 @@
{ {
"name": "client", "name": "music-player-client",
"version": "0.1.0", "version": "1.0.0",
"private": true, "description": "",
"dependencies": { "main": "main.js",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.97",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-scripts": "5.0.1",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4"
},
"scripts": { "scripts": {
"start": "react-scripts start", "build": "webpack",
"build": "react-scripts build", "test": "echo \"Error: no test specified\" && exit 1",
"test": "react-scripts test", "watch": "webpack --watch"
"eject": "react-scripts eject"
}, },
"eslintConfig": { "author": "Savanni D'Gerinel <savanni@luminescent-dreams.com>",
"extends": [ "license": "GPL-3.0-or-later",
"react-app", "dependencies": {
"react-app/jest" "lodash": "^4.17.21",
] "systemjs": "^6.13.0"
}, },
"browserslist": { "devDependencies": {
"production": [ "@types/lodash": "^4.14.191",
">0.2%", "copy-webpack-plugin": "^11.0.0",
"not dead", "css-loader": "^6.7.3",
"not op_mini all" "style-loader": "^3.3.1",
], "ts-loader": "^9.4.2",
"development": [ "typescript": "^4.9.5",
"last 1 chrome version", "webpack": "^5.75.0",
"last 1 firefox version", "webpack-cli": "^5.0.1"
"last 1 safari version"
]
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -1,43 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -1,25 +0,0 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

View File

@ -1,3 +0,0 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

View File

@ -1,38 +0,0 @@
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

View File

@ -1,9 +0,0 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});

View File

@ -1,26 +0,0 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
}
export default App;

View File

@ -1,4 +1,4 @@
import { TextField } from "../TextField/TextField"; import { TextField } from "./TextField";
export class NowPlaying extends HTMLElement { export class NowPlaying extends HTMLElement {
onStop: () => void; onStop: () => void;

View File

@ -1,15 +1,4 @@
import { TextField } from "../TextField/TextField"; import { TextField } from "./TextField";
import { StyleProvider } from "../../StyleProvider";
const style = `
.track-card {
display: grid;
gap: 4px 4px;
border: 1px solid $border-color;
background-color: $background-color-light;
box-shadow: $elevation-low;
}
`;
export class TrackCard extends HTMLElement { export class TrackCard extends HTMLElement {
trackNumberContainer: TextField; trackNumberContainer: TextField;
@ -17,17 +6,14 @@ export class TrackCard extends HTMLElement {
albumContainer: TextField; albumContainer: TextField;
artistContainer: TextField; artistContainer: TextField;
durationContainer: TextField; durationContainer: TextField;
styleProvider: StyleProvider;
static get observedAttributes() { static get observedAttributes() {
return ["trackId", "trackNumber", "name", "album", "artist", "duration"]; return ["trackId", "trackNumber", "name", "album", "artist", "duration"];
} }
constructor(styleProvider: StyleProvider) { constructor() {
super(); super();
this.styleProvider = styleProvider
this.trackNumberContainer = document.createElement("text-field"); this.trackNumberContainer = document.createElement("text-field");
this.nameContainer = document.createElement("text-field"); this.nameContainer = document.createElement("text-field");
@ -114,11 +100,6 @@ export class TrackCard extends HTMLElement {
connectedCallback() { connectedCallback() {
const container = document.createElement("data-card"); const container = document.createElement("data-card");
container.classList.add("track-card"); container.classList.add("track-card");
container.style.setProperty("display", "grid");
container.style.setProperty("gap", "4px 4px");
container.style.setProperty("border", "1px solid --border-color");
container.style.setProperty("background-color", this.styleProvider.get("backgroundColorLight"));
container.style.setProperty("box-shadow", "$elevation-low");
// this.appendChild(this.trackNumberContainer); // this.appendChild(this.trackNumberContainer);
container.appendChild(this.nameContainer); container.appendChild(this.nameContainer);

View File

@ -1,13 +0,0 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}

View File

@ -1,19 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -1,11 +1,10 @@
import * as _ from "lodash"; import * as _ from "lodash";
import { TrackInfo, getTracks, playTrack, stopPlayback } from "./client"; import { TrackInfo, getTracks, playTrack, stopPlayback } from "./client";
import { DataCard } from "./components/DataCard/DataCard"; import { DataCard } from "./components/DataCard";
import { NowPlaying } from "./components/NowPlaying/NowPlaying"; import { NowPlaying } from "./components/NowPlaying";
import { TextField } from "./components/TextField/TextField"; import { TextField } from "./components/TextField";
import { TrackCard } from "./components/TrackCard/TrackCard"; import { TrackCard } from "./components/TrackCard";
import { PlaylistRow } from "./components/PlaylistRow/PlaylistRow"; import { PlaylistRow } from "./components/PlaylistRow";
import { StyleProvider } from "./StyleProvider";
window.customElements.define("data-card", DataCard); window.customElements.define("data-card", DataCard);
window.customElements.define("now-playing", NowPlaying); window.customElements.define("now-playing", NowPlaying);
@ -25,11 +24,9 @@ declare global {
const updateTrackList = (tracks: TrackInfo[]) => { const updateTrackList = (tracks: TrackInfo[]) => {
const playlist = document.querySelector(".track-list__tracks"); const playlist = document.querySelector(".track-list__tracks");
const styleProvider = new StyleProvider();
if (playlist) { if (playlist) {
_.map(tracks, (info) => { _.map(tracks, (info) => {
let card: TrackCard = document.createElement("track-card"); let card: TrackCard = document.createElement("track-card");
card.styleProvider = styleProvider;
let listItem: PlaylistRow = document.createElement("playlist-row"); let listItem: PlaylistRow = document.createElement("playlist-row");
card.trackId = info.id; card.trackId = info.id;

View File

@ -1 +0,0 @@
/// <reference types="react-scripts" />

View File

@ -1,15 +0,0 @@
import { ReportHandler } from 'web-vitals';
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
}
};
export default reportWebVitals;

View File

@ -1,5 +0,0 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';

View File

@ -1,26 +1,14 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es2015",
"lib": [ "module": "commonjs",
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node", "moduleResolution": "node",
"resolveJsonModule": true, "rootDir": "src",
"isolatedModules": true, "outDir": "./dist",
"noEmit": true, "lib": ["es2016", "DOM"],
"jsx": "react-jsx" "sourceMap": true,
"strict": true,
"noImplicitAny": true
}, },
"include": [ "include": ["src"]
"src"
]
} }

View File

@ -3,7 +3,7 @@ const CopyPlugin = require('copy-webpack-plugin');
module.exports = { module.exports = {
mode: 'development', mode: 'development',
entry: ['./src/main.ts'], entry: ['./src/main.ts', './styles.scss'],
module: { module: {
rules: [ rules: [
{ {
@ -15,6 +15,10 @@ module.exports = {
test: /\.html$/i, test: /\.html$/i,
type: 'asset/resource', type: 'asset/resource',
}, },
{
test: /\.s[ac]ss$/i,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
], ],
}, },
resolve: { resolve: {

View File

@ -6,12 +6,12 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
result-extended = { path = "../../result-extended" } flow = { path = "../../flow" }
gstreamer = { version = "0.19" } gstreamer = { version = "0.19" }
id3 = { version = "1.6" } id3 = { version = "1.6" }
mime_guess = { version = "2.0" } mime_guess = { version = "2.0" }
mime = { version = "0.3" } mime = { version = "0.3" }
rusqlite = { version = "0.29" } rusqlite = { version = "0.28" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0" } serde_json = { version = "1.0" }
thiserror = { version = "1.0" } thiserror = { version = "1.0" }

View File

@ -1,4 +1,4 @@
use result_extended::Result; use flow::Flow;
use music_player::{ use music_player::{
core::{ControlMsg, Core}, core::{ControlMsg, Core},
database::{MemoryIndex, MusicIndex}, database::{MemoryIndex, MusicIndex},
@ -29,8 +29,8 @@ enum Response<A: Serialize> {
Fatal(String), Fatal(String),
} }
impl<A: Serialize> From<std::result::Result<A, Error>> for Response<A> { impl<A: Serialize> From<Result<A, Error>> for Response<A> {
fn from(res: std::result::Result<A, Error>) -> Self { fn from(res: Result<A, Error>) -> Self {
match res { match res {
Ok(val) => Self::Success(val), Ok(val) => Self::Success(val),
Err(err) => Self::Failure(format!("{}", err)), Err(err) => Self::Failure(format!("{}", err)),
@ -38,12 +38,12 @@ impl<A: Serialize> From<std::result::Result<A, Error>> for Response<A> {
} }
} }
impl<A: Serialize> From<Result<A, Error, FatalError>> for Response<A> { impl<A: Serialize> From<Flow<A, FatalError, Error>> for Response<A> {
fn from(res: Result<A, Error, FatalError>) -> Self { fn from(res: Flow<A, FatalError, Error>) -> Self {
match res { match res {
Result::Ok(val) => Self::Success(val), Flow::Ok(val) => Self::Success(val),
Result::Fatal(fatal) => Self::Fatal(format!("{}", fatal)), Flow::Fatal(fatal) => Self::Fatal(format!("{}", fatal)),
Result::Err(err) => Self::Failure(format!("{}", err)), Flow::Err(err) => Self::Failure(format!("{}", err)),
} }
} }
} }

View File

@ -5,7 +5,7 @@ use crate::{
scanner::MusicScanner, scanner::MusicScanner,
Error, FatalError, Error, FatalError,
}; };
use result_extended::{ok, return_error, Result}; use flow::{ok, return_error, Flow};
use gstreamer::{format::ClockTime, prelude::*, MessageView}; use gstreamer::{format::ClockTime, prelude::*, MessageView};
use std::{ use std::{
sync::{Arc, Mutex, RwLock}, sync::{Arc, Mutex, RwLock},
@ -52,7 +52,7 @@ impl Core {
pub fn new( pub fn new(
db: Arc<dyn MusicIndex>, db: Arc<dyn MusicIndex>,
scanner: Arc<dyn MusicScanner>, scanner: Arc<dyn MusicScanner>,
) -> std::result::Result<Core, FatalError> { ) -> Result<Core, FatalError> {
let db = db; let db = db;
let next_scan = Arc::new(RwLock::new(Instant::now())); let next_scan = Arc::new(RwLock::new(Instant::now()));
@ -70,17 +70,17 @@ impl Core {
}) })
} }
pub fn list_tracks<'a>(&'a self) -> Result<Vec<TrackInfo>, Error, FatalError> { pub fn list_tracks<'a>(&'a self) -> Flow<Vec<TrackInfo>, FatalError, Error> {
self.db.list_tracks().map_err(Error::DatabaseError) self.db.list_tracks().map_err(Error::DatabaseError)
} }
pub fn play_track<'a>(&'a mut self, id: TrackId) -> std::result::Result<(), Error> { pub fn play_track<'a>(&'a mut self, id: TrackId) -> Result<(), Error> {
self.stop_playback()?; self.stop_playback()?;
self.playback_controller = Some(Playback::new(id)?); self.playback_controller = Some(Playback::new(id)?);
Ok(()) Ok(())
} }
pub fn stop_playback<'a>(&'a mut self) -> std::result::Result<(), Error> { pub fn stop_playback<'a>(&'a mut self) -> Result<(), Error> {
match self.playback_controller { match self.playback_controller {
Some(ref controller) => controller.stop()?, Some(ref controller) => controller.stop()?,
None => (), None => (),

View File

@ -2,7 +2,7 @@ use crate::{
media::{TrackId, TrackInfo}, media::{TrackId, TrackInfo},
FatalError, FatalError,
}; };
use result_extended::{error, ok, Result}; use flow::{error, ok, Flow};
use rusqlite::Connection; use rusqlite::Connection;
use serde::Serialize; use serde::Serialize;
use std::collections::HashMap; use std::collections::HashMap;
@ -21,10 +21,10 @@ pub enum DatabaseError {
} }
pub trait MusicIndex: Sync + Send { pub trait MusicIndex: Sync + Send {
fn add_track(&self, track: TrackInfo) -> Result<(), DatabaseError, FatalError>; fn add_track(&self, track: TrackInfo) -> Flow<(), FatalError, DatabaseError>;
fn remove_track(&self, id: &TrackId) -> Result<(), DatabaseError, FatalError>; fn remove_track(&self, id: &TrackId) -> Flow<(), FatalError, DatabaseError>;
fn get_track_info(&self, id: &TrackId) -> Result<Option<TrackInfo>, DatabaseError, FatalError>; fn get_track_info(&self, id: &TrackId) -> Flow<Option<TrackInfo>, FatalError, DatabaseError>;
fn list_tracks<'a>(&'a self) -> Result<Vec<TrackInfo>, DatabaseError, FatalError>; fn list_tracks<'a>(&'a self) -> Flow<Vec<TrackInfo>, FatalError, DatabaseError>;
} }
pub struct MemoryIndex { pub struct MemoryIndex {
@ -40,13 +40,13 @@ impl MemoryIndex {
} }
impl MusicIndex for MemoryIndex { impl MusicIndex for MemoryIndex {
fn add_track(&self, info: TrackInfo) -> Result<(), DatabaseError, FatalError> { fn add_track(&self, info: TrackInfo) -> Flow<(), FatalError, DatabaseError> {
let mut tracks = self.tracks.write().unwrap(); let mut tracks = self.tracks.write().unwrap();
tracks.insert(info.id.clone(), info); tracks.insert(info.id.clone(), info);
ok(()) ok(())
} }
fn remove_track(&self, id: &TrackId) -> Result<(), DatabaseError, FatalError> { fn remove_track(&self, id: &TrackId) -> Flow<(), FatalError, DatabaseError> {
let mut tracks = self.tracks.write().unwrap(); let mut tracks = self.tracks.write().unwrap();
tracks.remove(&id); tracks.remove(&id);
ok(()) ok(())
@ -55,7 +55,7 @@ impl MusicIndex for MemoryIndex {
fn get_track_info<'a>( fn get_track_info<'a>(
&'a self, &'a self,
id: &TrackId, id: &TrackId,
) -> Result<Option<TrackInfo>, DatabaseError, FatalError> { ) -> Flow<Option<TrackInfo>, FatalError, DatabaseError> {
let track = { let track = {
let tracks = self.tracks.read().unwrap(); let tracks = self.tracks.read().unwrap();
tracks.get(&id).cloned() tracks.get(&id).cloned()
@ -63,7 +63,7 @@ impl MusicIndex for MemoryIndex {
ok(track) ok(track)
} }
fn list_tracks<'a>(&'a self) -> Result<Vec<TrackInfo>, DatabaseError, FatalError> { fn list_tracks<'a>(&'a self) -> Flow<Vec<TrackInfo>, FatalError, DatabaseError> {
ok(self ok(self
.tracks .tracks
.read() .read()
@ -92,7 +92,7 @@ pub struct Database {
} }
impl Database { impl Database {
pub fn new(path: PathBuf) -> Result<Database, DatabaseError, FatalError> { pub fn new(path: PathBuf) -> Flow<Database, FatalError, DatabaseError> {
let connection = match Connection::open(path.clone()) { let connection = match Connection::open(path.clone()) {
Ok(connection) => connection, Ok(connection) => connection,
Err(err) => return error(DatabaseError::UnhandledError(err.to_string())), Err(err) => return error(DatabaseError::UnhandledError(err.to_string())),
@ -136,7 +136,7 @@ mod test {
index.add_track(info.clone()); index.add_track(info.clone());
assert_eq!( assert_eq!(
Result::Ok(Some(info)), Flow::Ok(Some(info)),
index.get_track_info(&TrackId::from("track_1".to_owned())) index.get_track_info(&TrackId::from("track_1".to_owned()))
); );
}); });

View File

@ -33,4 +33,4 @@ pub enum FatalError {
UnexpectedError, UnexpectedError,
} }
impl result_extended::FatalError for FatalError {} impl flow::FatalError for FatalError {}

View File

@ -1,4 +1,5 @@
use crate::{media::TrackId, Error, FatalError}; use crate::{media::TrackId, Error, FatalError};
use flow::{ok, return_error, Flow};
use gstreamer::{format::ClockTime, prelude::*, MessageView, StateChangeError}; use gstreamer::{format::ClockTime, prelude::*, MessageView, StateChangeError};
use std::{ use std::{
path::PathBuf, path::PathBuf,