diff --git a/Cargo.lock b/Cargo.lock index fc557cc..01e79f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -64,9 +64,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.1.30" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "shlex", ] @@ -415,9 +415,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -527,18 +527,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" dependencies = [ "proc-macro2", "quote", @@ -547,9 +547,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.129" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbcf9b78a125ee667ae19388837dd12294b858d101fdd393cb9d5501ef09eb2" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", @@ -565,9 +565,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "syn" -version = "2.0.79" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -576,18 +576,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", @@ -637,12 +637,9 @@ dependencies = [ [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-ident" @@ -650,12 +647,6 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - [[package]] name = "walkdir" version = "2.5.0" diff --git a/endsong_web/Cargo.lock b/endsong_web/Cargo.lock index 1aeffa4..c8b0d5d 100644 --- a/endsong_web/Cargo.lock +++ b/endsong_web/Cargo.lock @@ -17,19 +17,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "getrandom", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "aho-corasick" version = "1.1.3" @@ -71,9 +58,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.16" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "103db485efc3e41214fe4fda9f3dbeae2eb9082f48fd236e6095627a9422066e" +checksum = "0cb8f1d480b0ea3783ab015936d2a55c87e219676f0c0b7dec61494043f21857" dependencies = [ "brotli", "futures-core", @@ -247,9 +234,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cc" @@ -801,18 +788,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "once_map" -version = "0.4.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd2cae3bec3936bbed1ccc5a3343b3738858182419f9c0522c7260c80c430b0" -dependencies = [ - "ahash", - "hashbrown 0.15.0", - "parking_lot", - "stable_deref_trait", -] - [[package]] name = "overload" version = "0.1.1" @@ -908,9 +883,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -1020,13 +995,12 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rinja" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28580fecce391f3c0e65a692e5f2b5db258ba2346ee04f355ae56473ab973dc" +checksum = "3dc4940d00595430b3d7d5a01f6222b5e5b51395d1120bdb28d854bb8abb17a5" dependencies = [ "humansize", "itoa", - "num-traits", "percent-encoding", "rinja_derive", "serde", @@ -1035,9 +1009,9 @@ dependencies = [ [[package]] name = "rinja_axum" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad88e570fdd4107b876624cc18b650c50fce7bf04ecf587e78bc8fc11cfa53d2" +checksum = "cc64d77bb950f6498d0fc64b028d168fcb4e56ac31b66a8ae05f64d3b0c218b6" dependencies = [ "axum-core", "http", @@ -1046,15 +1020,14 @@ dependencies = [ [[package]] name = "rinja_derive" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f1ae91455a4c82892d9513fcfa1ac8faff6c523602d0041536341882714aede" +checksum = "08d9ed0146aef6e2825f1b1515f074510549efba38d71f4554eec32eb36ba18b" dependencies = [ "basic-toml", "memchr", "mime", "mime_guess", - "once_map", "proc-macro2", "pulldown-cmark", "quote", @@ -1066,9 +1039,9 @@ dependencies = [ [[package]] name = "rinja_parser" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea17639e1f35032e1c67539856e498c04cd65fe2a45f55ec437ec55e4be941" +checksum = "93f9a866e2e00a7a1fb27e46e9e324a6f7c0e7edc4543cae1d38f4e4a100c610" dependencies = [ "memchr", "nom", @@ -1107,18 +1080,18 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" dependencies = [ "proc-macro2", "quote", @@ -1240,12 +1213,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "strsim" version = "0.11.1" @@ -1254,9 +1221,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.80" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e185e337f816bc8da115b8afcb3324006ccc82eeaddf35113888d3bd8e44ac" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -1277,18 +1244,18 @@ checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", @@ -1338,9 +1305,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", @@ -1517,12 +1484,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/endsong_web/src/album.rs b/endsong_web/src/album.rs index b49a434..9611581 100644 --- a/endsong_web/src/album.rs +++ b/endsong_web/src/album.rs @@ -59,7 +59,7 @@ struct AlbumTemplate<'a> { /// Link to artist page link_artist: String, } -/// GET `/album/[:artist_name]/[:album_name][?artist_id=usize][?album_id=usize]` +/// GET `/album/[:artist_name]/[:album_name][?artist_id=usize][&album_id=usize]` /// /// Artist page /// @@ -86,7 +86,7 @@ pub async fn base( album_name = album_name, artist_id = options.artist_id, album_id = options.album_id, - "GET /album/[:artist_name]/[:album_name][?artist_id=usize][?album_id=usize]" + "GET /album/[:artist_name]/[:album_name][?artist_id=usize][&album_id=usize]" ); let entries = &state.entries; @@ -129,16 +129,18 @@ pub async fn base( }; let encoded_artist = artist.encode(); + let artist_id_arg = if let Some(artist_id) = options.artist_id { + format!("?artist_id={artist_id}") + } else { + String::new() + }; + let link_artist = format!("/artist/{encoded_artist}{artist_id_arg}"); let Some(album) = album else { // unwrap ok - find().album() guaranteed to contain at least one album if Some, see earlier let encoded_album = albums.first().unwrap().encode(); - let link_base_album = if let Some(artist_id) = options.artist_id { - format!("/album/{encoded_artist}/{encoded_album}?artist_id={artist_id}") - } else { - format!("/album/{encoded_artist}/{encoded_album}") - }; + let link_base_album = format!("/album/{encoded_artist}/{encoded_album}{artist_id_arg}"); return AlbumSelectionTemplate { albums, @@ -172,12 +174,6 @@ pub async fn base( let first_listen = gather::first_entry_of(entries, album).unwrap().timestamp; let last_listen = gather::last_entry_of(entries, album).unwrap().timestamp; - let link_artist = if let Some(artist_id) = options.artist_id { - format!("/artist/{encoded_artist}?artist_id={artist_id}") - } else { - format!("/artist/{encoded_artist}") - }; - AlbumTemplate { plays, percentage_of_plays, diff --git a/endsong_web/src/artist.rs b/endsong_web/src/artist.rs index ed117f1..9cb7843 100644 --- a/endsong_web/src/artist.rs +++ b/endsong_web/src/artist.rs @@ -145,22 +145,17 @@ pub async fn base( .timestamp; let encoded_artist = artist.encode(); - let (link_albums, link_songs, link_absolute, link_relative) = - if let Some(artist_id) = options.artist_id { - ( - format!("/artist/{encoded_artist}/albums?artist_id={artist_id}"), - format!("/artist/{encoded_artist}/songs?artist_id={artist_id}"), - format!("/artist/{encoded_artist}/absolute_plot?artist_id={artist_id}"), - format!("/artist/{encoded_artist}/relative_plot?artist_id={artist_id}"), - ) - } else { - ( - format!("/artist/{encoded_artist}/albums"), - format!("/artist/{encoded_artist}/songs"), - format!("/artist/{encoded_artist}/absolute_plot"), - format!("/artist/{encoded_artist}/relative_plot"), - ) - }; + let artist_id_arg = if let Some(artist_id) = options.artist_id { + format!("?artist_id={artist_id}") + } else { + String::new() + }; + let (link_albums, link_songs, link_absolute, link_relative) = ( + format!("/artist/{encoded_artist}/albums{artist_id_arg}"), + format!("/artist/{encoded_artist}/songs{artist_id_arg}"), + format!("/artist/{encoded_artist}/absolute_plot{artist_id_arg}"), + format!("/artist/{encoded_artist}/relative_plot{artist_id_arg}"), + ); ArtistTemplate { artist, @@ -345,7 +340,7 @@ struct AlbumsTemplate { /// Elements: link to album page, [`Album`] instance, plays albums: Vec<(String, Album, usize)>, } -/// POST `/artist/[:artist_name]/albums[&artist_id=usize][?top=usize]` +/// POST `/artist/[:artist_name]/albums[?artist_id=usize][&top=usize]` /// /// Lists of top albums /// @@ -360,7 +355,7 @@ pub async fn albums( artist_name = artist_name, artist_id = options.artist_id, top = form.top, - "POST /artist/[:artist_name]/albums[&artist_id=usize][?top=usize]" + "POST /artist/[:artist_name]/albums[?artist_id=usize][&top=usize]" ); let entries = &state.entries; @@ -428,7 +423,7 @@ struct SongsTemplate { /// Elements: link to song page, [`Song`] instance, plays songs: Vec<(String, Song, usize)>, } -/// POST `/artist/[:artist_name]/songs[&artist_id=usize][?top=usize][&sum_across_albums=String]` +/// POST `/artist/[:artist_name]/songs[?artist_id=usize][&top=usize][&sum_across_albums=String]` /// /// Lists of top albums /// @@ -444,7 +439,7 @@ pub async fn songs( artist_id = options.artist_id, top = form.top, sum_across_albums = form.sum_across_albums, - "POST /artist/[:artist_name]/songs[&artist_id=usize][?top=usize][&sum_across_albums=String]" + "POST /artist/[:artist_name]/songs[?artist_id=usize][&top=usize][&sum_across_albums=String]" ); let entries = &state.entries; diff --git a/endsong_web/static/tailwind_style.css b/endsong_web/static/tailwind_style.css index a2f9942..cf4e171 100644 --- a/endsong_web/static/tailwind_style.css +++ b/endsong_web/static/tailwind_style.css @@ -562,10 +562,6 @@ video { position: relative; } -.m-auto { - margin: auto; -} - .ml-4 { margin-left: 1rem; } @@ -705,11 +701,6 @@ video { background-color: rgb(226 232 240 / var(--tw-bg-opacity)); } -.bg-black { - --tw-bg-opacity: 1; - background-color: rgb(0 0 0 / var(--tw-bg-opacity)); -} - .p-1 { padding: 0.25rem; } @@ -731,14 +722,14 @@ video { padding-right: 1rem; } -.pr-4 { - padding-right: 1rem; -} - .pl-4 { padding-left: 1rem; } +.pr-4 { + padding-right: 1rem; +} + .text-center { text-align: center; } diff --git a/endsong_web/templates/history_datepicker.html b/endsong_web/templates/history_datepicker.html index 2387a8d..d7bb641 100644 --- a/endsong_web/templates/history_datepicker.html +++ b/endsong_web/templates/history_datepicker.html @@ -43,6 +43,6 @@ min="{{ first|date_basic }}" max="{{ last|date_basic }}" value="{{ first_plus_one|date_basic }}" - /> + /> {% endif %}