Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 97c82b4ba2 | |||
| de7626a6a9 | |||
| fb7d0c7e1a | |||
| c3b70dc16c | |||
| 66bb127d43 | |||
| 1bb5a2f973 |
Generated
+1
-1
@@ -1418,7 +1418,7 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c"
|
||||
|
||||
[[package]]
|
||||
name = "furumusic"
|
||||
version = "0.2.4"
|
||||
version = "0.2.8"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "furumusic"
|
||||
version = "0.2.5"
|
||||
version = "0.2.8"
|
||||
edition = "2024"
|
||||
description = "Reusable web-app boilerplate: auth, OIDC/SSO, admin panel, user management, i18n, PostgreSQL"
|
||||
|
||||
|
||||
+307
-22
@@ -9,7 +9,7 @@ use cot::response::IntoResponse;
|
||||
use cot::session::Session;
|
||||
use cot::{Body, Template};
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde::{Deserialize, Deserializer, Serialize};
|
||||
use sqlx::{PgPool, Postgres, QueryBuilder};
|
||||
|
||||
use super::BUILD_INFO;
|
||||
@@ -68,7 +68,13 @@ pub(super) struct UpdateLibraryItemRequest {
|
||||
title: String,
|
||||
hidden: bool,
|
||||
release_type: Option<String>,
|
||||
#[serde(default, deserialize_with = "deserialize_optional_stringish")]
|
||||
year: Option<String>,
|
||||
release_id: Option<i64>,
|
||||
#[serde(default, deserialize_with = "deserialize_optional_stringish")]
|
||||
track_number: Option<String>,
|
||||
#[serde(default, deserialize_with = "deserialize_optional_stringish")]
|
||||
disc_number: Option<String>,
|
||||
artist_ids: Option<Vec<i64>>,
|
||||
}
|
||||
|
||||
@@ -385,9 +391,13 @@ struct LibraryItemDetailDto {
|
||||
hidden: bool,
|
||||
release_type: Option<String>,
|
||||
year: Option<i32>,
|
||||
release_id: Option<i64>,
|
||||
track_number: Option<i32>,
|
||||
disc_number: Option<i32>,
|
||||
current_image_url: Option<String>,
|
||||
selected_artist_ids: Vec<i64>,
|
||||
artists: Vec<ArtistOptionDto>,
|
||||
releases: Vec<ReleaseOptionDto>,
|
||||
available_covers: Vec<AvailableCoverDto>,
|
||||
}
|
||||
|
||||
@@ -397,6 +407,13 @@ struct ArtistOptionDto {
|
||||
name: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, JsonSchema)]
|
||||
struct ReleaseOptionDto {
|
||||
id: i64,
|
||||
title: String,
|
||||
subtitle: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, JsonSchema)]
|
||||
struct AvailableCoverDto {
|
||||
media_file_id: i64,
|
||||
@@ -1050,6 +1067,40 @@ pub async fn update_library_item(
|
||||
.execute(pool)
|
||||
.await
|
||||
}
|
||||
"tracks" => {
|
||||
let release_id = body.release_id.unwrap_or(0);
|
||||
if release_id <= 0 {
|
||||
return Ok(json_error(StatusCode::BAD_REQUEST, "release is required"));
|
||||
}
|
||||
let release_exists: Option<i64> =
|
||||
sqlx::query_scalar("SELECT id FROM furumusic__release WHERE id = $1")
|
||||
.bind(release_id)
|
||||
.fetch_optional(pool)
|
||||
.await
|
||||
.map_err(|e| cot::Error::internal(e.to_string()))?;
|
||||
if release_exists.is_none() {
|
||||
return Ok(json_error(StatusCode::NOT_FOUND, "release not found"));
|
||||
}
|
||||
let year = parse_optional_admin_i32(body.year.as_deref(), 0, 3000);
|
||||
let track_number = parse_optional_admin_i32(body.track_number.as_deref(), 1, 9999);
|
||||
let disc_number = parse_optional_admin_i32(body.disc_number.as_deref(), 1, 999);
|
||||
sqlx::query(
|
||||
"UPDATE furumusic__track \
|
||||
SET title = $1, title_sort = $2, release_id = $3, track_number = $4, disc_number = $5, year = $6, is_hidden = $7, updated_at = $8 \
|
||||
WHERE id = $9",
|
||||
)
|
||||
.bind(title)
|
||||
.bind(normalize_name(title))
|
||||
.bind(release_id)
|
||||
.bind(track_number)
|
||||
.bind(disc_number)
|
||||
.bind(year)
|
||||
.bind(body.hidden)
|
||||
.bind(&now)
|
||||
.bind(body.id)
|
||||
.execute(pool)
|
||||
.await
|
||||
}
|
||||
"playlists" => {
|
||||
sqlx::query(
|
||||
"UPDATE furumusic__playlist \
|
||||
@@ -1071,25 +1122,44 @@ pub async fn update_library_item(
|
||||
if affected == 0 {
|
||||
return Ok(json_error(StatusCode::NOT_FOUND, "library item not found"));
|
||||
}
|
||||
if kind == "releases" {
|
||||
if kind == "releases" || kind == "tracks" {
|
||||
if let Some(mut artist_ids) = body.artist_ids {
|
||||
let mut seen_artist_ids = HashSet::new();
|
||||
artist_ids.retain(|id| *id > 0 && seen_artist_ids.insert(*id));
|
||||
sqlx::query("DELETE FROM furumusic__release_artist WHERE release_id = $1")
|
||||
.bind(body.id)
|
||||
.execute(pool)
|
||||
.await
|
||||
.map_err(|e| cot::Error::internal(e.to_string()))?;
|
||||
for (position, artist_id) in artist_ids.iter().enumerate() {
|
||||
sqlx::query(
|
||||
"INSERT INTO furumusic__release_artist (release_id, artist_id, position) VALUES ($1, $2, $3)",
|
||||
)
|
||||
.bind(body.id)
|
||||
.bind(*artist_id)
|
||||
.bind(position as i32)
|
||||
.execute(pool)
|
||||
.await
|
||||
.map_err(|e| cot::Error::internal(e.to_string()))?;
|
||||
if kind == "releases" {
|
||||
sqlx::query("DELETE FROM furumusic__release_artist WHERE release_id = $1")
|
||||
.bind(body.id)
|
||||
.execute(pool)
|
||||
.await
|
||||
.map_err(|e| cot::Error::internal(e.to_string()))?;
|
||||
for (position, artist_id) in artist_ids.iter().enumerate() {
|
||||
sqlx::query(
|
||||
"INSERT INTO furumusic__release_artist (release_id, artist_id, position) VALUES ($1, $2, $3)",
|
||||
)
|
||||
.bind(body.id)
|
||||
.bind(*artist_id)
|
||||
.bind(position as i32)
|
||||
.execute(pool)
|
||||
.await
|
||||
.map_err(|e| cot::Error::internal(e.to_string()))?;
|
||||
}
|
||||
} else {
|
||||
sqlx::query("DELETE FROM furumusic__track_artist WHERE track_id = $1 AND role = 'main'")
|
||||
.bind(body.id)
|
||||
.execute(pool)
|
||||
.await
|
||||
.map_err(|e| cot::Error::internal(e.to_string()))?;
|
||||
for (position, artist_id) in artist_ids.iter().enumerate() {
|
||||
sqlx::query(
|
||||
"INSERT INTO furumusic__track_artist (track_id, artist_id, role, position) VALUES ($1, $2, 'main', $3)",
|
||||
)
|
||||
.bind(body.id)
|
||||
.bind(*artist_id)
|
||||
.bind(position as i32)
|
||||
.execute(pool)
|
||||
.await
|
||||
.map_err(|e| cot::Error::internal(e.to_string()))?;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1781,6 +1851,7 @@ async fn load_library_page(pool: &PgPool, query: LibraryQuery) -> anyhow::Result
|
||||
let total = count_library(pool, &kind, search_pattern.clone()).await?;
|
||||
let rows = match kind.as_str() {
|
||||
"releases" => load_release_items(pool, search_pattern.clone(), limit, offset).await?,
|
||||
"tracks" => load_track_items(pool, search_pattern.clone(), limit, offset).await?,
|
||||
"playlists" => load_playlist_items(pool, search_pattern.clone(), limit, offset).await?,
|
||||
_ => load_artist_items(pool, search_pattern.clone(), limit, offset).await?,
|
||||
};
|
||||
@@ -1808,7 +1879,7 @@ async fn fetch_library_item(
|
||||
"releases" => {
|
||||
sqlx::query_as::<_, LibraryItemRow>(
|
||||
"SELECT r.id, r.title::text AS title, \
|
||||
CONCAT(r.release_type::text, COALESCE(' · ' || r.year::text, '')) AS subtitle, \
|
||||
(COALESCE(NULLIF(STRING_AGG(DISTINCT a.name::text, ', '), ''), 'Unknown artist') || COALESCE(' / ' || r.year::text, '')) AS subtitle, \
|
||||
r.is_hidden, COUNT(DISTINCT t.id)::bigint AS primary_count, \
|
||||
COUNT(DISTINCT ra.artist_id)::bigint AS secondary_count, \
|
||||
COUNT(DISTINCT ph.id)::bigint AS tertiary_count, \
|
||||
@@ -1816,6 +1887,7 @@ async fn fetch_library_item(
|
||||
FROM furumusic__release r \
|
||||
LEFT JOIN furumusic__track t ON t.release_id = r.id \
|
||||
LEFT JOIN furumusic__release_artist ra ON ra.release_id = r.id \
|
||||
LEFT JOIN furumusic__artist a ON a.id = ra.artist_id \
|
||||
LEFT JOIN furumusic__play_history ph ON ph.track_id = t.id \
|
||||
WHERE r.id = $1 \
|
||||
GROUP BY r.id",
|
||||
@@ -1841,6 +1913,26 @@ async fn fetch_library_item(
|
||||
.fetch_optional(pool)
|
||||
.await?
|
||||
}
|
||||
"tracks" => {
|
||||
sqlx::query_as::<_, LibraryItemRow>(
|
||||
"SELECT t.id, t.title::text AS title, \
|
||||
CONCAT(r.title::text, COALESCE(' / #' || t.track_number::text, '')) AS subtitle, \
|
||||
t.is_hidden, COUNT(DISTINCT ta.artist_id)::bigint AS primary_count, \
|
||||
COUNT(DISTINCT ph.id)::bigint AS secondary_count, \
|
||||
COUNT(DISTINCT pt.playlist_id)::bigint AS tertiary_count, \
|
||||
t.updated_at::text AS updated_at \
|
||||
FROM furumusic__track t \
|
||||
JOIN furumusic__release r ON r.id = t.release_id \
|
||||
LEFT JOIN furumusic__track_artist ta ON ta.track_id = t.id \
|
||||
LEFT JOIN furumusic__play_history ph ON ph.track_id = t.id \
|
||||
LEFT JOIN furumusic__playlist_track pt ON pt.track_id = t.id \
|
||||
WHERE t.id = $1 \
|
||||
GROUP BY t.id, r.title",
|
||||
)
|
||||
.bind(id)
|
||||
.fetch_optional(pool)
|
||||
.await?
|
||||
}
|
||||
_ => {
|
||||
sqlx::query_as::<_, LibraryItemRow>(
|
||||
"SELECT a.id, a.name::text AS title, NULL::text AS subtitle, a.is_hidden, \
|
||||
@@ -1874,9 +1966,13 @@ async fn load_library_item_detail(
|
||||
hidden: item.is_hidden.unwrap_or(false),
|
||||
release_type: None,
|
||||
year: None,
|
||||
release_id: None,
|
||||
track_number: None,
|
||||
disc_number: None,
|
||||
current_image_url: None,
|
||||
selected_artist_ids: Vec::new(),
|
||||
artists: Vec::new(),
|
||||
releases: Vec::new(),
|
||||
available_covers: Vec::new(),
|
||||
item,
|
||||
};
|
||||
@@ -1917,6 +2013,31 @@ async fn load_library_item_detail(
|
||||
.collect();
|
||||
detail.artists = load_artist_options(pool).await?;
|
||||
}
|
||||
"tracks" => {
|
||||
let row: Option<(i64, Option<i32>, Option<i32>, Option<i32>)> = sqlx::query_as(
|
||||
"SELECT release_id, track_number, disc_number, year FROM furumusic__track WHERE id = $1",
|
||||
)
|
||||
.bind(detail.item.id)
|
||||
.fetch_optional(pool)
|
||||
.await?;
|
||||
if let Some((release_id, track_number, disc_number, year)) = row {
|
||||
detail.release_id = Some(release_id);
|
||||
detail.track_number = track_number;
|
||||
detail.disc_number = disc_number;
|
||||
detail.year = year;
|
||||
}
|
||||
detail.selected_artist_ids = sqlx::query_as::<_, IdRow>(
|
||||
"SELECT artist_id AS id FROM furumusic__track_artist WHERE track_id = $1 AND role = 'main' ORDER BY position, artist_id",
|
||||
)
|
||||
.bind(detail.item.id)
|
||||
.fetch_all(pool)
|
||||
.await?
|
||||
.into_iter()
|
||||
.map(|row| row.id)
|
||||
.collect();
|
||||
detail.artists = load_artist_options(pool).await?;
|
||||
detail.releases = load_release_options(pool).await?;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
@@ -1935,6 +2056,28 @@ async fn load_artist_options(pool: &PgPool) -> anyhow::Result<Vec<ArtistOptionDt
|
||||
.collect())
|
||||
}
|
||||
|
||||
async fn load_release_options(pool: &PgPool) -> anyhow::Result<Vec<ReleaseOptionDto>> {
|
||||
let rows = sqlx::query_as::<_, (i64, String, Option<String>)>(
|
||||
"SELECT r.id, r.title::text AS title, \
|
||||
(COALESCE(NULLIF(STRING_AGG(DISTINCT a.name::text, ', '), ''), 'Unknown artist') || COALESCE(' / ' || r.year::text, '')) AS subtitle \
|
||||
FROM furumusic__release r \
|
||||
LEFT JOIN furumusic__release_artist ra ON ra.release_id = r.id \
|
||||
LEFT JOIN furumusic__artist a ON a.id = ra.artist_id \
|
||||
GROUP BY r.id \
|
||||
ORDER BY r.title_sort ASC, r.year NULLS LAST, r.id ASC",
|
||||
)
|
||||
.fetch_all(pool)
|
||||
.await?;
|
||||
Ok(rows
|
||||
.into_iter()
|
||||
.map(|(id, title, subtitle)| ReleaseOptionDto {
|
||||
id,
|
||||
title,
|
||||
subtitle: subtitle.unwrap_or_default(),
|
||||
})
|
||||
.collect())
|
||||
}
|
||||
|
||||
async fn artist_available_covers(
|
||||
pool: &PgPool,
|
||||
artist_id: i64,
|
||||
@@ -1974,6 +2117,13 @@ async fn library_ids_by_filter(
|
||||
LEFT JOIN furumusic__release_artist ra ON ra.release_id = r.id \
|
||||
LEFT JOIN furumusic__artist a ON a.id = ra.artist_id WHERE 1=1",
|
||||
),
|
||||
"tracks" => QueryBuilder::<Postgres>::new(
|
||||
"SELECT DISTINCT t.id \
|
||||
FROM furumusic__track t \
|
||||
JOIN furumusic__release r ON r.id = t.release_id \
|
||||
LEFT JOIN furumusic__track_artist ta ON ta.track_id = t.id \
|
||||
LEFT JOIN furumusic__artist a ON a.id = ta.artist_id WHERE 1=1",
|
||||
),
|
||||
"playlists" => QueryBuilder::<Postgres>::new(
|
||||
"SELECT DISTINCT p.id \
|
||||
FROM furumusic__playlist p \
|
||||
@@ -2030,6 +2180,14 @@ async fn set_library_visibility(
|
||||
.bind(ids)
|
||||
.execute(pool)
|
||||
.await,
|
||||
"tracks" => sqlx::query(
|
||||
"UPDATE furumusic__track SET is_hidden = $1, updated_at = $2 WHERE id = ANY($3)",
|
||||
)
|
||||
.bind(hidden)
|
||||
.bind(&now)
|
||||
.bind(ids)
|
||||
.execute(pool)
|
||||
.await,
|
||||
_ => sqlx::query(
|
||||
"UPDATE furumusic__artist SET is_hidden = $1, updated_at = $2 WHERE id = ANY($3)",
|
||||
)
|
||||
@@ -2046,6 +2204,7 @@ async fn set_library_visibility(
|
||||
async fn delete_library_items(pool: &PgPool, kind: &str, ids: &[i64]) -> cot::Result<u64> {
|
||||
match kind {
|
||||
"releases" => delete_releases(pool, ids).await,
|
||||
"tracks" => delete_tracks(pool, ids).await,
|
||||
"playlists" => delete_playlists(pool, ids).await,
|
||||
_ => delete_artists(pool, ids).await,
|
||||
}
|
||||
@@ -2132,6 +2291,40 @@ async fn delete_releases(pool: &PgPool, ids: &[i64]) -> cot::Result<u64> {
|
||||
Ok(result.rows_affected())
|
||||
}
|
||||
|
||||
async fn delete_tracks(pool: &PgPool, ids: &[i64]) -> cot::Result<u64> {
|
||||
sqlx::query("DELETE FROM furumusic__playlist_track WHERE track_id = ANY($1)")
|
||||
.bind(ids)
|
||||
.execute(pool)
|
||||
.await
|
||||
.map_err(|e| cot::Error::internal(e.to_string()))?;
|
||||
sqlx::query("DELETE FROM furumusic__user_liked_track WHERE track_id = ANY($1)")
|
||||
.bind(ids)
|
||||
.execute(pool)
|
||||
.await
|
||||
.map_err(|e| cot::Error::internal(e.to_string()))?;
|
||||
sqlx::query("DELETE FROM furumusic__play_history WHERE track_id = ANY($1)")
|
||||
.bind(ids)
|
||||
.execute(pool)
|
||||
.await
|
||||
.map_err(|e| cot::Error::internal(e.to_string()))?;
|
||||
sqlx::query("DELETE FROM furumusic__track_genre WHERE track_id = ANY($1)")
|
||||
.bind(ids)
|
||||
.execute(pool)
|
||||
.await
|
||||
.map_err(|e| cot::Error::internal(e.to_string()))?;
|
||||
sqlx::query("DELETE FROM furumusic__track_artist WHERE track_id = ANY($1)")
|
||||
.bind(ids)
|
||||
.execute(pool)
|
||||
.await
|
||||
.map_err(|e| cot::Error::internal(e.to_string()))?;
|
||||
let result = sqlx::query("DELETE FROM furumusic__track WHERE id = ANY($1)")
|
||||
.bind(ids)
|
||||
.execute(pool)
|
||||
.await
|
||||
.map_err(|e| cot::Error::internal(e.to_string()))?;
|
||||
Ok(result.rows_affected())
|
||||
}
|
||||
|
||||
async fn delete_playlists(pool: &PgPool, ids: &[i64]) -> cot::Result<u64> {
|
||||
sqlx::query("DELETE FROM furumusic__playlist_track WHERE playlist_id = ANY($1)")
|
||||
.bind(ids)
|
||||
@@ -2163,6 +2356,13 @@ async fn count_library(
|
||||
LEFT JOIN furumusic__release_artist ra ON ra.release_id = r.id \
|
||||
LEFT JOIN furumusic__artist a ON a.id = ra.artist_id WHERE 1=1",
|
||||
),
|
||||
"tracks" => QueryBuilder::<Postgres>::new(
|
||||
"SELECT COUNT(DISTINCT t.id) AS count \
|
||||
FROM furumusic__track t \
|
||||
JOIN furumusic__release r ON r.id = t.release_id \
|
||||
LEFT JOIN furumusic__track_artist ta ON ta.track_id = t.id \
|
||||
LEFT JOIN furumusic__artist a ON a.id = ta.artist_id WHERE 1=1",
|
||||
),
|
||||
"playlists" => QueryBuilder::<Postgres>::new(
|
||||
"SELECT COUNT(DISTINCT p.id) AS count \
|
||||
FROM furumusic__playlist p \
|
||||
@@ -2203,6 +2403,15 @@ fn push_library_search_filter(
|
||||
qb.push_bind(pattern);
|
||||
qb.push(")");
|
||||
}
|
||||
"tracks" => {
|
||||
qb.push(" AND (t.title ILIKE ");
|
||||
qb.push_bind(pattern.clone());
|
||||
qb.push(" OR r.title ILIKE ");
|
||||
qb.push_bind(pattern.clone());
|
||||
qb.push(" OR a.name ILIKE ");
|
||||
qb.push_bind(pattern);
|
||||
qb.push(")");
|
||||
}
|
||||
_ => {
|
||||
qb.push(" AND a.name ILIKE ");
|
||||
qb.push_bind(pattern);
|
||||
@@ -2250,7 +2459,7 @@ async fn load_release_items(
|
||||
) -> anyhow::Result<Vec<LibraryItemRow>> {
|
||||
let mut qb = QueryBuilder::<Postgres>::new(
|
||||
"SELECT r.id, r.title::text AS title, \
|
||||
CONCAT(r.release_type::text, COALESCE(' · ' || r.year::text, '')) AS subtitle, \
|
||||
(COALESCE(NULLIF(STRING_AGG(DISTINCT a.name::text, ', '), ''), 'Unknown artist') || COALESCE(' / ' || r.year::text, '')) AS subtitle, \
|
||||
r.is_hidden, COUNT(DISTINCT t.id)::bigint AS primary_count, \
|
||||
COUNT(DISTINCT ra.artist_id)::bigint AS secondary_count, \
|
||||
COUNT(DISTINCT ph.id)::bigint AS tertiary_count, \
|
||||
@@ -2279,6 +2488,46 @@ async fn load_release_items(
|
||||
.await?)
|
||||
}
|
||||
|
||||
async fn load_track_items(
|
||||
pool: &PgPool,
|
||||
search_pattern: Option<String>,
|
||||
limit: i64,
|
||||
offset: i64,
|
||||
) -> anyhow::Result<Vec<LibraryItemRow>> {
|
||||
let mut qb = QueryBuilder::<Postgres>::new(
|
||||
"SELECT t.id, t.title::text AS title, \
|
||||
CONCAT(r.title::text, COALESCE(' / #' || t.track_number::text, '')) AS subtitle, \
|
||||
t.is_hidden, COUNT(DISTINCT ta.artist_id)::bigint AS primary_count, \
|
||||
COUNT(DISTINCT ph.id)::bigint AS secondary_count, \
|
||||
COUNT(DISTINCT pt.playlist_id)::bigint AS tertiary_count, \
|
||||
t.updated_at::text AS updated_at \
|
||||
FROM furumusic__track t \
|
||||
JOIN furumusic__release r ON r.id = t.release_id \
|
||||
LEFT JOIN furumusic__track_artist ta ON ta.track_id = t.id \
|
||||
LEFT JOIN furumusic__artist a ON a.id = ta.artist_id \
|
||||
LEFT JOIN furumusic__play_history ph ON ph.track_id = t.id \
|
||||
LEFT JOIN furumusic__playlist_track pt ON pt.track_id = t.id \
|
||||
WHERE 1=1",
|
||||
);
|
||||
if let Some(pattern) = search_pattern {
|
||||
qb.push(" AND (t.title ILIKE ");
|
||||
qb.push_bind(pattern.clone());
|
||||
qb.push(" OR r.title ILIKE ");
|
||||
qb.push_bind(pattern.clone());
|
||||
qb.push(" OR a.name ILIKE ");
|
||||
qb.push_bind(pattern);
|
||||
qb.push(")");
|
||||
}
|
||||
qb.push(" GROUP BY t.id, r.title ORDER BY r.title ASC, t.disc_number NULLS FIRST, t.track_number NULLS FIRST, t.title ASC LIMIT ");
|
||||
qb.push_bind(limit);
|
||||
qb.push(" OFFSET ");
|
||||
qb.push_bind(offset);
|
||||
Ok(qb
|
||||
.build_query_as::<LibraryItemRow>()
|
||||
.fetch_all(pool)
|
||||
.await?)
|
||||
}
|
||||
|
||||
async fn load_playlist_items(
|
||||
pool: &PgPool,
|
||||
search_pattern: Option<String>,
|
||||
@@ -2324,6 +2573,11 @@ fn library_item_dto(kind: &str, row: LibraryItemRow) -> LibraryItemDto {
|
||||
tag(format!("{} artists", row.secondary_count), "relation"),
|
||||
tag(format!("{} plays", row.tertiary_count), "plays"),
|
||||
],
|
||||
"tracks" => vec![
|
||||
tag(format!("{} artists", row.primary_count), "relation"),
|
||||
tag(format!("{} plays", row.secondary_count), "plays"),
|
||||
tag(format!("{} playlists", row.tertiary_count), "count"),
|
||||
],
|
||||
"playlists" => vec![
|
||||
tag(format!("{} tracks", row.primary_count), "count"),
|
||||
tag(
|
||||
@@ -2410,9 +2664,12 @@ fn optional_job_time(value: &str) -> Option<String> {
|
||||
}
|
||||
|
||||
fn normalize_library_kind(kind: Option<&str>) -> String {
|
||||
match kind {
|
||||
Some("releases") => "releases",
|
||||
Some("playlists") => "playlists",
|
||||
let kind = kind.unwrap_or_default().trim().to_ascii_lowercase();
|
||||
match kind.as_str() {
|
||||
"release" | "releases" => "releases",
|
||||
"track" | "tracks" => "tracks",
|
||||
"playlist" | "playlists" => "playlists",
|
||||
"artist" | "artists" => "artists",
|
||||
_ => "artists",
|
||||
}
|
||||
.to_owned()
|
||||
@@ -2437,6 +2694,34 @@ fn normalize_name(value: &str) -> String {
|
||||
value.trim().to_lowercase()
|
||||
}
|
||||
|
||||
fn parse_optional_admin_i32(value: Option<&str>, min: i32, max: i32) -> Option<i32> {
|
||||
let value = value?.trim();
|
||||
if value.is_empty() {
|
||||
return None;
|
||||
}
|
||||
value
|
||||
.parse::<i32>()
|
||||
.ok()
|
||||
.map(|parsed| parsed.clamp(min, max))
|
||||
}
|
||||
|
||||
fn deserialize_optional_stringish<'de, D>(deserializer: D) -> Result<Option<String>, D::Error>
|
||||
where
|
||||
D: Deserializer<'de>,
|
||||
{
|
||||
let Some(value) = Option::<serde_json::Value>::deserialize(deserializer)? else {
|
||||
return Ok(None);
|
||||
};
|
||||
match value {
|
||||
serde_json::Value::Null => Ok(None),
|
||||
serde_json::Value::String(value) => Ok(Some(value)),
|
||||
serde_json::Value::Number(value) => Ok(Some(value.to_string())),
|
||||
other => Err(serde::de::Error::custom(format!(
|
||||
"expected string, number, or null, got {other}"
|
||||
))),
|
||||
}
|
||||
}
|
||||
|
||||
fn now_string() -> String {
|
||||
chrono::Utc::now().format("%Y-%m-%dT%H:%M:%SZ").to_string()
|
||||
}
|
||||
|
||||
@@ -370,7 +370,8 @@ pub async fn save_cover_to_storage(
|
||||
}
|
||||
|
||||
let ext = extension_for_mime(&cover.mime_type);
|
||||
let filename = format!("cover.{ext}");
|
||||
let hash_prefix: String = hash.chars().take(12).collect();
|
||||
let filename = format!("cover-{hash_prefix}.{ext}");
|
||||
|
||||
let artist_dir = sanitize_dir_name(artist_name);
|
||||
let album_dir = sanitize_dir_name(release_title);
|
||||
|
||||
+124
-9
@@ -975,6 +975,16 @@ tbody tr:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.artist-result small {
|
||||
display: block;
|
||||
margin-top: 2px;
|
||||
color: var(--text-subdued);
|
||||
font-size: 11px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.artist-result:hover,
|
||||
.artist-result:focus {
|
||||
background: var(--bg-hover);
|
||||
@@ -1452,6 +1462,7 @@ tbody tr:hover {
|
||||
<div class="segmented">
|
||||
<button class="seg-btn" :class="{active: libraryKind === 'artists'}" @click="openLibrary('artists')">Artists</button>
|
||||
<button class="seg-btn" :class="{active: libraryKind === 'releases'}" @click="openLibrary('releases')">Releases</button>
|
||||
<button class="seg-btn" :class="{active: libraryKind === 'tracks'}" @click="openLibrary('tracks')">Tracks</button>
|
||||
<button class="seg-btn" :class="{active: libraryKind === 'playlists'}" @click="openLibrary('playlists')">Playlists</button>
|
||||
</div>
|
||||
<input class="search" placeholder="Search library" x-model="librarySearch" @input.debounce.350ms="loadLibrary()" />
|
||||
@@ -1923,7 +1934,7 @@ tbody tr:hover {
|
||||
<div class="empty" x-show="editorLoading">Loading editor...</div>
|
||||
<div x-show="!editorLoading">
|
||||
<div class="field">
|
||||
<label x-text="isArtistEditor() ? 'Artist name' : 'Title'"></label>
|
||||
<label x-text="isArtistEditor() ? 'Artist name' : (isReleaseEditor() ? 'Release title' : (isTrackEditor() ? 'Track title' : 'Title'))"></label>
|
||||
<input x-model="editorDraft.title" />
|
||||
</div>
|
||||
|
||||
@@ -1947,8 +1958,43 @@ tbody tr:hover {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field" x-show="isReleaseEditor()">
|
||||
<label>Release artists</label>
|
||||
<div class="editor-grid" x-show="isTrackEditor()">
|
||||
<div class="field">
|
||||
<label>Track #</label>
|
||||
<input type="number" min="1" max="9999" x-model="editorDraft.track_number" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>Disc #</label>
|
||||
<input type="number" min="1" max="999" x-model="editorDraft.disc_number" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>Year</label>
|
||||
<input type="number" min="0" max="3000" x-model="editorDraft.year" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field" x-show="isTrackEditor()">
|
||||
<label>Release</label>
|
||||
<div class="artist-tags">
|
||||
<span class="tag relation" x-show="selectedEditorRelease()" x-text="selectedEditorReleaseLabel()"></span>
|
||||
<span class="muted" x-show="!selectedEditorRelease()">No release selected</span>
|
||||
</div>
|
||||
<div class="artist-picker">
|
||||
<input class="search" placeholder="Search release to move track" x-model="editorReleaseToAdd" @keydown.enter.prevent="selectEditorRelease()" @keydown.escape="editorReleaseToAdd = ''" />
|
||||
<div class="artist-results" x-show="editorReleaseSearchOpen()" x-transition>
|
||||
<template x-for="release in filteredEditorReleases()" :key="release.id">
|
||||
<button class="artist-result" type="button" @click="selectEditorRelease(release)">
|
||||
<span x-text="release.title"></span>
|
||||
<small x-text="release.subtitle"></small>
|
||||
</button>
|
||||
</template>
|
||||
<div class="artist-result muted" x-show="filteredEditorReleases().length === 0">No matching releases</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field" x-show="isReleaseEditor() || isTrackEditor()">
|
||||
<label x-text="isTrackEditor() ? 'Track artists' : 'Release artists'"></label>
|
||||
<div class="artist-tags">
|
||||
<template x-for="artist in selectedEditorArtists()" :key="artist.id">
|
||||
<span class="tag relation">
|
||||
@@ -2099,8 +2145,9 @@ function adminV2() {
|
||||
editorImageUploading: false,
|
||||
editorImageFile: null,
|
||||
editorArtistToAdd: '',
|
||||
editorReleaseToAdd: '',
|
||||
editorDetail: null,
|
||||
editorDraft: { title: '', hidden: 'false', release_type: 'album', year: '', artist_ids: [] },
|
||||
editorDraft: { title: '', hidden: 'false', release_type: 'album', year: '', release_id: null, track_number: '', disc_number: '', artist_ids: [] },
|
||||
settings: { values: {}, sources: {}, lastfm_api_key_configured: false, lastfm_shared_secret_configured: false, lastfm_scrobbling_configured: false },
|
||||
settingsDraft: {
|
||||
auth_password_enabled: false,
|
||||
@@ -2196,7 +2243,7 @@ function adminV2() {
|
||||
this.activeView = 'jobs';
|
||||
if (parts[1]) this.activeJobName = decodeURIComponent(parts[1]);
|
||||
} else if (view === 'library') {
|
||||
const nextKind = ['artists', 'releases', 'playlists'].includes(parts[1]) ? parts[1] : 'artists';
|
||||
const nextKind = ['artists', 'releases', 'tracks', 'playlists'].includes(parts[1]) ? parts[1] : 'artists';
|
||||
if (this.libraryKind !== nextKind) this.clearLibrarySelection();
|
||||
this.activeView = 'library';
|
||||
this.libraryKind = nextKind;
|
||||
@@ -2256,7 +2303,7 @@ function adminV2() {
|
||||
|
||||
openLibrary(kind = this.libraryKind) {
|
||||
this.activeView = 'library';
|
||||
const nextKind = ['artists', 'releases', 'playlists'].includes(kind) ? kind : 'artists';
|
||||
const nextKind = ['artists', 'releases', 'tracks', 'playlists'].includes(kind) ? kind : 'artists';
|
||||
if (this.libraryKind !== nextKind) this.clearLibrarySelection();
|
||||
this.libraryKind = nextKind;
|
||||
this.setRoute(`#library/${this.libraryKind}`);
|
||||
@@ -2618,11 +2665,15 @@ function adminV2() {
|
||||
hidden: item.is_hidden ? 'true' : 'false',
|
||||
release_type: 'album',
|
||||
year: '',
|
||||
release_id: null,
|
||||
track_number: '',
|
||||
disc_number: '',
|
||||
artist_ids: []
|
||||
};
|
||||
this.editorDetail = null;
|
||||
this.editorImageFile = null;
|
||||
this.editorArtistToAdd = '';
|
||||
this.editorReleaseToAdd = '';
|
||||
this.editorOpen = true;
|
||||
this.loadEditorDetail(item);
|
||||
},
|
||||
@@ -2640,10 +2691,14 @@ function adminV2() {
|
||||
hidden: detail.hidden ? 'true' : 'false',
|
||||
release_type: detail.release_type || 'album',
|
||||
year: detail.year || '',
|
||||
release_id: detail.release_id || null,
|
||||
track_number: detail.track_number || '',
|
||||
disc_number: detail.disc_number || '',
|
||||
artist_ids: Array.isArray(detail.selected_artist_ids) ? detail.selected_artist_ids.slice() : []
|
||||
};
|
||||
this.editorImageFile = null;
|
||||
this.editorArtistToAdd = '';
|
||||
this.editorReleaseToAdd = '';
|
||||
} catch (error) {
|
||||
this.showToast(error.message);
|
||||
} finally {
|
||||
@@ -2662,12 +2717,18 @@ function adminV2() {
|
||||
return this.activeLibraryItem && this.activeLibraryItem.kind === 'releases';
|
||||
},
|
||||
|
||||
isTrackEditor() {
|
||||
return this.activeLibraryItem && this.activeLibraryItem.kind === 'tracks';
|
||||
},
|
||||
|
||||
canEditLibraryImage() {
|
||||
return this.isArtistEditor() || this.isReleaseEditor();
|
||||
},
|
||||
|
||||
editorCanSave() {
|
||||
return Boolean(this.activeLibraryItem && this.editorDetail && !this.editorLoading && !this.editorSaving);
|
||||
if (!this.activeLibraryItem || !this.editorDetail || this.editorLoading || this.editorSaving) return false;
|
||||
if (this.isTrackEditor() && !this.editorDraft.release_id) return false;
|
||||
return true;
|
||||
},
|
||||
|
||||
selectedEditorArtists() {
|
||||
@@ -2710,7 +2771,7 @@ function adminV2() {
|
||||
},
|
||||
|
||||
editorArtistSearchOpen() {
|
||||
return this.isReleaseEditor() && String(this.editorArtistToAdd || '').trim().length > 0;
|
||||
return (this.isReleaseEditor() || this.isTrackEditor()) && String(this.editorArtistToAdd || '').trim().length > 0;
|
||||
},
|
||||
|
||||
addEditorArtist(artist = null) {
|
||||
@@ -2729,6 +2790,51 @@ function adminV2() {
|
||||
this.editorDraft.artist_ids = (this.editorDraft.artist_ids || []).filter(value => Number(value) !== Number(id));
|
||||
},
|
||||
|
||||
selectedEditorRelease() {
|
||||
const releases = (this.editorDetail && this.editorDetail.releases) || [];
|
||||
return releases.find(row => Number(row.id) === Number(this.editorDraft.release_id));
|
||||
},
|
||||
|
||||
selectedEditorReleaseLabel() {
|
||||
const release = this.selectedEditorRelease();
|
||||
if (!release) return '';
|
||||
return release.subtitle ? `${release.title} / ${release.subtitle}` : release.title;
|
||||
},
|
||||
|
||||
filteredEditorReleases() {
|
||||
const releases = (this.editorDetail && this.editorDetail.releases) || [];
|
||||
const query = String(this.editorReleaseToAdd || '').trim().toLowerCase();
|
||||
const currentId = Number(this.editorDraft.release_id || 0);
|
||||
const candidates = releases.filter(release => Number(release.id) !== currentId);
|
||||
if (!query) return candidates.slice(0, 12);
|
||||
return candidates
|
||||
.map(release => {
|
||||
const haystack = `${release.title || ''} ${release.subtitle || ''}`.toLowerCase();
|
||||
let score = 3;
|
||||
if (String(release.title || '').toLowerCase() === query) score = 0;
|
||||
else if (String(release.title || '').toLowerCase().startsWith(query)) score = 1;
|
||||
else if (haystack.includes(query)) score = 2;
|
||||
return { release, score };
|
||||
})
|
||||
.filter(row => row.score < 3)
|
||||
.sort((a, b) => a.score - b.score || a.release.title.localeCompare(b.release.title))
|
||||
.slice(0, 12)
|
||||
.map(row => row.release);
|
||||
},
|
||||
|
||||
editorReleaseSearchOpen() {
|
||||
return this.isTrackEditor() && String(this.editorReleaseToAdd || '').trim().length > 0;
|
||||
},
|
||||
|
||||
selectEditorRelease(release = null) {
|
||||
const candidates = this.filteredEditorReleases();
|
||||
release = release || candidates[0];
|
||||
if (!release) return false;
|
||||
this.editorDraft.release_id = Number(release.id);
|
||||
this.editorReleaseToAdd = '';
|
||||
return true;
|
||||
},
|
||||
|
||||
setEditorImageFile(event) {
|
||||
this.editorImageFile = event.target.files && event.target.files.length ? event.target.files[0] : null;
|
||||
},
|
||||
@@ -2844,6 +2950,12 @@ function adminV2() {
|
||||
},
|
||||
|
||||
async saveLibraryItem() {
|
||||
if (this.isTrackEditor() && String(this.editorReleaseToAdd || '').trim()) {
|
||||
if (!this.selectEditorRelease()) {
|
||||
this.showToast('Choose a release from search results');
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!this.editorCanSave()) return;
|
||||
this.editorSaving = true;
|
||||
try {
|
||||
@@ -2856,6 +2968,9 @@ function adminV2() {
|
||||
hidden: this.editorDraft.hidden === 'true',
|
||||
release_type: this.editorDraft.release_type || null,
|
||||
year: this.editorDraft.year || '',
|
||||
release_id: this.editorDraft.release_id ? Number(this.editorDraft.release_id) : null,
|
||||
track_number: this.editorDraft.track_number || '',
|
||||
disc_number: this.editorDraft.disc_number || '',
|
||||
artist_ids: this.editorDraft.artist_ids || []
|
||||
})
|
||||
});
|
||||
@@ -2931,7 +3046,7 @@ function adminV2() {
|
||||
},
|
||||
|
||||
pageSubtitle() {
|
||||
if (this.activeView === 'library') return 'Fast entity control surface for artists, releases, and playlists';
|
||||
if (this.activeView === 'library') return 'Fast entity control surface for artists, releases, tracks, and playlists';
|
||||
if (this.activeView === 'jobs') return 'Scheduler state, recent runs, and manual controls in one place';
|
||||
if (this.activeView === 'tools') return 'Reserved space for merge, split, enrichment, and destructive workflows';
|
||||
if (this.activeView === 'settings') return 'Application configuration and external API credentials';
|
||||
|
||||
@@ -422,13 +422,13 @@
|
||||
<button class="torrent-tree-check" :class="{ checked: $store.torrents.selectedUploadTracks.has(item.track.id) }" @click="$store.torrents.toggleUploadTrackSelection(item.track.id)">
|
||||
<template x-if="$store.torrents.selectedUploadTracks.has(item.track.id)"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg></template>
|
||||
</button>
|
||||
<button class="track-action-btn play-btn" @click="$store.player.play(item.track)" title="{{ t.player_play }}"><svg viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg></button>
|
||||
<div class="upload-track-main">
|
||||
<div class="upload-track-title"><span x-text="item.track.track_number ? item.track.track_number + '. ' + item.track.title : item.track.title"></span><span class="upload-hidden-pill" x-show="item.is_hidden">hidden</span></div>
|
||||
<div class="upload-track-meta"><span x-text="$store.torrents.uploadArtistsText(item)"></span><span x-show="$store.torrents.uploadFeaturedArtistsText(item)">feat.</span><span x-show="$store.torrents.uploadFeaturedArtistsText(item)" x-text="$store.torrents.uploadFeaturedArtistsText(item)"></span></div>
|
||||
</div>
|
||||
<div class="upload-track-actions">
|
||||
<button class="track-action-btn" @click="$store.queue.addNextInQueue([item.track])" title="{{ t.player_play_next }}"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h14M5 12h8M5 18h14"/><path d="M17 10l4 3-4 3" fill="currentColor" stroke="none"/></svg></button>
|
||||
<button class="track-action-btn queue-insert-btn queue-next-btn" @click="$store.queue.addNextInQueue([item.track])" title="{{ t.player_play_next }}"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h10M5 12h7M5 18h10"/><path d="M17 9l4 3-4 3" fill="currentColor" stroke="none"/></svg></button>
|
||||
<button class="track-action-btn queue-insert-btn queue-end-btn" @click="$store.queue.addToEnd([item.track])" title="{{ t.player_add_to_queue }}"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h14M5 12h14M5 18h7"/><path d="M17 15l4 3-4 3" fill="currentColor" stroke="none"/></svg></button>
|
||||
<button class="modal-btn modal-btn-ghost" @click="$store.torrents.editUpload(item)">Edit</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -516,11 +516,6 @@
|
||||
<div class="upload-track-card" :class="{ hidden: item.is_hidden }">
|
||||
<template x-if="$store.torrents.uploadEditId !== item.track.id">
|
||||
<div class="upload-track-display">
|
||||
<button class="track-action-btn play-btn"
|
||||
@click="$store.player.play(item.track)"
|
||||
title="{{ t.player_play }}">
|
||||
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>
|
||||
</button>
|
||||
<div class="upload-track-main">
|
||||
<div class="upload-track-title">
|
||||
<span x-text="item.track.title"></span>
|
||||
@@ -535,8 +530,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="upload-track-actions">
|
||||
<button class="track-action-btn" @click="$store.queue.addNextInQueue([item.track])" title="{{ t.player_play_next }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h14M5 12h8M5 18h14"/><path d="M17 10l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||||
<button class="track-action-btn queue-insert-btn queue-next-btn" @click="$store.queue.addNextInQueue([item.track])" title="{{ t.player_play_next }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h10M5 12h7M5 18h10"/><path d="M17 9l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||||
</button>
|
||||
<button class="track-action-btn queue-insert-btn queue-end-btn" @click="$store.queue.addToEnd([item.track])" title="{{ t.player_add_to_queue }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h14M5 12h14M5 18h7"/><path d="M17 15l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||||
</button>
|
||||
<button class="modal-btn modal-btn-ghost" @click="$store.torrents.editUpload(item)">Edit</button>
|
||||
</div>
|
||||
|
||||
@@ -165,6 +165,19 @@ document.addEventListener('alpine:init', () => {
|
||||
|
||||
Alpine.store('mobile', {
|
||||
libraryOpen: false,
|
||||
playerExpanded: false,
|
||||
playerDragging: false,
|
||||
playerDragOffset: 0,
|
||||
playerCloseOffset: 0,
|
||||
_playerDragStartY: 0,
|
||||
_playerDragStartX: 0,
|
||||
_playerDragTracking: false,
|
||||
_playerDragMode: null,
|
||||
_playerDragPointerId: null,
|
||||
_playerDragElement: null,
|
||||
_playerDragMove: null,
|
||||
_playerDragEnd: null,
|
||||
_playerSuppressClickUntil: 0,
|
||||
toggleLibrary() {
|
||||
this.libraryOpen = !this.libraryOpen;
|
||||
if (this.libraryOpen) Alpine.store('user').menuOpen = false;
|
||||
@@ -172,6 +185,121 @@ document.addEventListener('alpine:init', () => {
|
||||
closeLibrary() {
|
||||
this.libraryOpen = false;
|
||||
},
|
||||
isMobilePlayer() {
|
||||
return window.matchMedia && window.matchMedia('(max-width: 720px)').matches;
|
||||
},
|
||||
openPlayerFullscreen() {
|
||||
if (!this.isMobilePlayer() || !Alpine.store('player').currentTrack) return;
|
||||
this.playerExpanded = true;
|
||||
this.playerDragging = false;
|
||||
this.playerDragOffset = 0;
|
||||
this.playerCloseOffset = 0;
|
||||
Alpine.store('queue').visible = false;
|
||||
Alpine.store('devices').open = false;
|
||||
},
|
||||
closePlayerFullscreen() {
|
||||
this.playerExpanded = false;
|
||||
this.playerDragging = false;
|
||||
this.playerDragOffset = 0;
|
||||
this.playerCloseOffset = 0;
|
||||
},
|
||||
playerDragStyle() {
|
||||
return `--mobile-player-drag:${this.playerDragOffset}px; --mobile-player-close-drag:${this.playerCloseOffset}px;`;
|
||||
},
|
||||
handlePlayerClick(event) {
|
||||
if (Date.now() <= this._playerSuppressClickUntil) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
this._playerSuppressClickUntil = 0;
|
||||
}
|
||||
},
|
||||
startPlayerDrag(event, force = false) {
|
||||
if (!this.isMobilePlayer() || !Alpine.store('player').currentTrack) return;
|
||||
if (event.button && event.button !== 0) return;
|
||||
const target = event.target;
|
||||
const isDragBlocked = target.closest('input, select, textarea, .volume-slider, .device-popover, .mobile-expanded-queue');
|
||||
if (!force) {
|
||||
if (this.playerExpanded) {
|
||||
const isCloseHandle = target.closest('.player-now-playing');
|
||||
const scroller = event.currentTarget?.classList?.contains('player-bar') ? event.currentTarget : null;
|
||||
if (!isCloseHandle || isDragBlocked || (scroller && scroller.scrollTop > 4)) return;
|
||||
} else if (isDragBlocked) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (this._playerDragTracking) this.endPlayerDrag({ type: 'pointercancel' });
|
||||
this.playerDragging = false;
|
||||
this._playerDragTracking = true;
|
||||
this._playerDragMode = this.playerExpanded ? 'close' : 'open';
|
||||
this._playerDragStartY = event.clientY;
|
||||
this._playerDragStartX = event.clientX;
|
||||
this._playerDragPointerId = event.pointerId;
|
||||
this._playerDragElement = event.currentTarget;
|
||||
this.playerDragOffset = 0;
|
||||
this.playerCloseOffset = 0;
|
||||
this._playerDragMove = e => this.movePlayerDrag(e);
|
||||
this._playerDragEnd = e => this.endPlayerDrag(e);
|
||||
window.addEventListener('pointermove', this._playerDragMove, { passive: false });
|
||||
window.addEventListener('pointerup', this._playerDragEnd, { passive: false });
|
||||
window.addEventListener('pointercancel', this._playerDragEnd, { passive: false });
|
||||
},
|
||||
movePlayerDrag(event) {
|
||||
if (!this._playerDragTracking) return;
|
||||
const delta = this._playerDragStartY - event.clientY;
|
||||
const absDelta = Math.abs(delta);
|
||||
if (!this.playerDragging) {
|
||||
const horizontalDelta = Math.abs(event.clientX - this._playerDragStartX);
|
||||
const wantsOpen = this._playerDragMode === 'open' && delta > 0;
|
||||
const wantsClose = this._playerDragMode === 'close' && delta < 0;
|
||||
if (absDelta < 8 || absDelta < horizontalDelta * 1.15 || (!wantsOpen && !wantsClose)) return;
|
||||
this.playerDragging = true;
|
||||
try {
|
||||
this._playerDragElement?.setPointerCapture?.(this._playerDragPointerId);
|
||||
} catch (_) {}
|
||||
}
|
||||
event.preventDefault();
|
||||
if (this._playerDragMode === 'close') {
|
||||
this.playerCloseOffset = Math.max(0, Math.min(window.innerHeight, -delta));
|
||||
} else {
|
||||
const max = Math.max(0, window.innerHeight - 132);
|
||||
this.playerDragOffset = Math.max(0, Math.min(max, delta));
|
||||
}
|
||||
},
|
||||
endPlayerDrag(event) {
|
||||
const openThreshold = Math.min(180, Math.max(90, window.innerHeight * 0.18));
|
||||
const closeThreshold = Math.min(110, Math.max(64, window.innerHeight * 0.1));
|
||||
const wasCancelled = event?.type === 'pointercancel';
|
||||
const wasDragging = this.playerDragging;
|
||||
if (wasDragging) this._playerSuppressClickUntil = Date.now() + 450;
|
||||
if (this._playerDragMode === 'close') {
|
||||
if (!wasCancelled && this.playerCloseOffset > closeThreshold) this.closePlayerFullscreen();
|
||||
else {
|
||||
this.playerCloseOffset = 0;
|
||||
this.playerDragging = false;
|
||||
}
|
||||
} else if (this._playerDragMode === 'open' && !wasCancelled && this.playerDragOffset > openThreshold) {
|
||||
this.openPlayerFullscreen();
|
||||
} else {
|
||||
this.playerDragOffset = 0;
|
||||
this.playerDragging = false;
|
||||
}
|
||||
try {
|
||||
if (this._playerDragPointerId !== null && this._playerDragElement?.hasPointerCapture?.(this._playerDragPointerId)) {
|
||||
this._playerDragElement.releasePointerCapture(this._playerDragPointerId);
|
||||
}
|
||||
} catch (_) {}
|
||||
if (this._playerDragMove) window.removeEventListener('pointermove', this._playerDragMove);
|
||||
if (this._playerDragEnd) {
|
||||
window.removeEventListener('pointerup', this._playerDragEnd);
|
||||
window.removeEventListener('pointercancel', this._playerDragEnd);
|
||||
}
|
||||
this._playerDragTracking = false;
|
||||
this._playerDragMode = null;
|
||||
this._playerDragPointerId = null;
|
||||
this._playerDragElement = null;
|
||||
this._playerDragMove = null;
|
||||
this._playerDragEnd = null;
|
||||
},
|
||||
});
|
||||
|
||||
Alpine.store('info', {
|
||||
@@ -1380,6 +1508,11 @@ document.addEventListener('alpine:init', () => {
|
||||
this.addToEnd([track]);
|
||||
},
|
||||
|
||||
upcoming(limit = 12) {
|
||||
const start = Math.max(0, this.currentIndex + 1);
|
||||
return this.tracks.slice(start, start + limit);
|
||||
},
|
||||
|
||||
addToEnd(tracks) {
|
||||
const items = this._trackList(tracks);
|
||||
if (!items.length) return;
|
||||
|
||||
+67
-34
@@ -483,19 +483,16 @@
|
||||
<span x-show="$store.library.hasPopularity(track)" x-text="$store.library.popularityLabel(track)"></span>
|
||||
<span x-show="!$store.library.hasPopularity(track)" class="info-letter">i</span>
|
||||
</button>
|
||||
<button class="track-action-btn play-btn" @click.stop="$store.library.playSearchTrack(idx)" title="{{ t.player_play }}">
|
||||
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>
|
||||
</button>
|
||||
<button class="like-btn" :class="{ liked: $store.likes.has(track.id) }" @click.stop="$store.likes.toggle(track.id)" title="{{ t.player_like }}">
|
||||
<svg viewBox="0 0 24 24" :fill="$store.likes.has(track.id) ? 'currentColor' : 'none'" stroke="currentColor" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78L12 21.23l8.84-8.84a5.5 5.5 0 000-7.78z"/></svg>
|
||||
</button>
|
||||
<button class="track-action-btn" @click.stop="$store.queue.addNextInQueue([track])" title="{{ t.player_play_next }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h14M5 12h8M5 18h14"/><path d="M17 10l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||||
<button class="track-action-btn queue-insert-btn queue-next-btn" @click.stop="$store.queue.addNextInQueue([track])" title="{{ t.player_play_next }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h10M5 12h7M5 18h10"/><path d="M17 9l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||||
</button>
|
||||
<button class="track-action-btn" @click.stop="$store.queue.addToEnd([track])" title="{{ t.player_add_to_queue }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
|
||||
<button class="track-action-btn queue-insert-btn queue-end-btn" @click.stop="$store.queue.addToEnd([track])" title="{{ t.player_add_to_queue }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h14M5 12h14M5 18h7"/><path d="M17 15l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||||
</button>
|
||||
<button class="track-action-btn" @click.stop="$store.playlists.showPicker([track.id])" title="{{ t.player_add_to_playlist }}">
|
||||
<button class="track-action-btn playlist-add-btn" @click.stop="$store.playlists.showPicker([track.id])" title="{{ t.player_add_to_playlist }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
@@ -663,19 +660,16 @@
|
||||
<span x-show="$store.library.hasPopularity(track)" x-text="$store.library.popularityLabel(track)"></span>
|
||||
<span x-show="!$store.library.hasPopularity(track)" class="info-letter">i</span>
|
||||
</button>
|
||||
<button class="track-action-btn play-btn" @click.stop="$store.queue.playRelease($store.library.currentArtist.featured_tracks, idx)" title="{{ t.player_play }}">
|
||||
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>
|
||||
</button>
|
||||
<button class="like-btn" :class="{ liked: $store.likes.has(track.id) }" @click.stop="$store.likes.toggle(track.id)" title="{{ t.player_like }}">
|
||||
<svg viewBox="0 0 24 24" :fill="$store.likes.has(track.id) ? 'currentColor' : 'none'" stroke="currentColor" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78L12 21.23l8.84-8.84a5.5 5.5 0 000-7.78z"/></svg>
|
||||
</button>
|
||||
<button class="track-action-btn" @click.stop="$store.queue.addNextInQueue([track])" title="{{ t.player_play_next }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h14M5 12h8M5 18h14"/><path d="M17 10l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||||
<button class="track-action-btn queue-insert-btn queue-next-btn" @click.stop="$store.queue.addNextInQueue([track])" title="{{ t.player_play_next }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h10M5 12h7M5 18h10"/><path d="M17 9l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||||
</button>
|
||||
<button class="track-action-btn" @click.stop="$store.queue.addToEnd([track])" title="{{ t.player_add_to_queue }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
|
||||
<button class="track-action-btn queue-insert-btn queue-end-btn" @click.stop="$store.queue.addToEnd([track])" title="{{ t.player_add_to_queue }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h14M5 12h14M5 18h7"/><path d="M17 15l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||||
</button>
|
||||
<button class="track-action-btn" @click.stop="$store.playlists.showPicker([track.id])" title="{{ t.player_add_to_playlist }}">
|
||||
<button class="track-action-btn playlist-add-btn" @click.stop="$store.playlists.showPicker([track.id])" title="{{ t.player_add_to_playlist }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
@@ -786,19 +780,16 @@
|
||||
<span x-show="$store.library.hasPopularity(track)" x-text="$store.library.popularityLabel(track)"></span>
|
||||
<span x-show="!$store.library.hasPopularity(track)" class="info-letter">i</span>
|
||||
</button>
|
||||
<button class="track-action-btn play-btn" @click.stop="$store.queue.playRelease([track], 0)" title="{{ t.player_play }}">
|
||||
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>
|
||||
</button>
|
||||
<button class="like-btn" :class="{ liked: $store.likes.has(track.id) }" @click.stop="$store.likes.toggle(track.id)" title="{{ t.player_like }}">
|
||||
<svg viewBox="0 0 24 24" :fill="$store.likes.has(track.id) ? 'currentColor' : 'none'" stroke="currentColor" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78L12 21.23l8.84-8.84a5.5 5.5 0 000-7.78z"/></svg>
|
||||
</button>
|
||||
<button class="track-action-btn" @click.stop="$store.queue.addNextInQueue([track])" title="{{ t.player_play_next }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h14M5 12h8M5 18h14"/><path d="M17 10l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||||
<button class="track-action-btn queue-insert-btn queue-next-btn" @click.stop="$store.queue.addNextInQueue([track])" title="{{ t.player_play_next }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h10M5 12h7M5 18h10"/><path d="M17 9l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||||
</button>
|
||||
<button class="track-action-btn" @click.stop="$store.queue.addToEnd([track])" title="{{ t.player_add_to_queue }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
|
||||
<button class="track-action-btn queue-insert-btn queue-end-btn" @click.stop="$store.queue.addToEnd([track])" title="{{ t.player_add_to_queue }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h14M5 12h14M5 18h7"/><path d="M17 15l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||||
</button>
|
||||
<button class="track-action-btn" @click.stop="$store.playlists.showPicker([track.id])" title="{{ t.player_add_to_playlist }}">
|
||||
<button class="track-action-btn playlist-add-btn" @click.stop="$store.playlists.showPicker([track.id])" title="{{ t.player_add_to_playlist }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
@@ -862,19 +853,16 @@
|
||||
<span x-show="$store.library.hasPopularity(track)" x-text="$store.library.popularityLabel(track)"></span>
|
||||
<span x-show="!$store.library.hasPopularity(track)" class="info-letter">i</span>
|
||||
</button>
|
||||
<button class="track-action-btn play-btn" @click.stop="$store.queue.playRelease($store.library.currentPlaylist.tracks, idx)" title="{{ t.player_play }}">
|
||||
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>
|
||||
</button>
|
||||
<button class="like-btn" :class="{ liked: $store.likes.has(track.id) }" @click.stop="$store.likes.toggle(track.id)" title="{{ t.player_like }}">
|
||||
<svg viewBox="0 0 24 24" :fill="$store.likes.has(track.id) ? 'currentColor' : 'none'" stroke="currentColor" stroke-width="2"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78L12 21.23l8.84-8.84a5.5 5.5 0 000-7.78z"/></svg>
|
||||
</button>
|
||||
<button class="track-action-btn" @click.stop="$store.queue.addNextInQueue([track])" title="{{ t.player_play_next }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h14M5 12h8M5 18h14"/><path d="M17 10l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||||
<button class="track-action-btn queue-insert-btn queue-next-btn" @click.stop="$store.queue.addNextInQueue([track])" title="{{ t.player_play_next }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h10M5 12h7M5 18h10"/><path d="M17 9l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||||
</button>
|
||||
<button class="track-action-btn" @click.stop="$store.queue.addToEnd([track])" title="{{ t.player_add_to_queue }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
|
||||
<button class="track-action-btn queue-insert-btn queue-end-btn" @click.stop="$store.queue.addToEnd([track])" title="{{ t.player_add_to_queue }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 6h14M5 12h14M5 18h7"/><path d="M17 15l4 3-4 3" fill="currentColor" stroke="none"/></svg>
|
||||
</button>
|
||||
<button class="track-action-btn" @click.stop="$store.playlists.showPicker([track.id])" title="{{ t.player_add_to_playlist }}">
|
||||
<button class="track-action-btn playlist-add-btn" @click.stop="$store.playlists.showPicker([track.id])" title="{{ t.player_add_to_playlist }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
@@ -955,11 +943,21 @@
|
||||
</div>
|
||||
|
||||
<!-- Player Bar -->
|
||||
<div class="player-bar">
|
||||
<div class="player-bar"
|
||||
:class="{ 'mobile-expanded': $store.mobile.playerExpanded, 'mobile-dragging': $store.mobile.playerDragging }"
|
||||
:style="$store.mobile.playerDragStyle()"
|
||||
@click.capture="$store.mobile.handlePlayerClick($event)"
|
||||
@pointerdown="$store.mobile.startPlayerDrag($event)">
|
||||
<button class="mobile-player-collapse-btn" type="button" @click.stop="$store.mobile.closePlayerFullscreen()" title="{{ t.player_close }}" aria-label="{{ t.player_close }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4">
|
||||
<path d="M6 9l6 6 6-6"/>
|
||||
</svg>
|
||||
</button>
|
||||
<div class="player-now-playing">
|
||||
<template x-if="$store.player.currentTrack">
|
||||
<div style="display:flex;align-items:center;gap:12px;overflow:hidden">
|
||||
<div class="player-cover">
|
||||
<div class="player-cover"
|
||||
@click.stop="$store.mobile.openPlayerFullscreen()">
|
||||
<template x-if="$store.player.currentTrack.cover_url">
|
||||
<img :src="$store.player.currentTrack.cover_url" :alt="$store.player.currentTrack.title">
|
||||
</template>
|
||||
@@ -989,6 +987,9 @@
|
||||
<span class="player-release-year" x-text="' · ' + $store.player.currentTrack.release_year"></span>
|
||||
</template>
|
||||
</div>
|
||||
<div class="player-track-release" x-show="$store.player.currentTrack.release_title">
|
||||
<a class="artist-link" @click.stop="$store.player.currentTrack.release_id && $store.library.openRelease($store.player.currentTrack.release_id)" x-text="$store.player.currentTrack.release_title"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1029,6 +1030,8 @@
|
||||
<div class="progress-bar-thumb"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="player-progress-strip-times"
|
||||
x-text="'-' + formatTime(Math.max(0, $store.player.duration - $store.player.currentTime)) + ' / ' + formatTime($store.player.duration)"></div>
|
||||
<span class="player-time" x-text="formatTime($store.player.duration)"></span>
|
||||
</div>
|
||||
<div class="player-version-chip">v{{ t.app_version() }}</div>
|
||||
@@ -1167,4 +1170,34 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mobile-expanded-queue">
|
||||
<div class="mobile-expanded-queue-title">{{ t.player_queue }}</div>
|
||||
<template x-if="$store.queue.upcoming().length === 0">
|
||||
<div class="mobile-expanded-queue-empty">{{ t.player_queue_empty }}</div>
|
||||
</template>
|
||||
<template x-for="(track, idx) in $store.queue.upcoming()" :key="'mobile-expanded-queue-' + track.id + '-' + idx">
|
||||
<button class="mobile-expanded-queue-row" type="button" @click="$store.queue.playFromIndex($store.queue.currentIndex + idx + 1)">
|
||||
<div class="mobile-expanded-queue-cover">
|
||||
<template x-if="track.cover_url">
|
||||
<img :src="track.cover_url" :alt="track.title" loading="lazy">
|
||||
</template>
|
||||
<template x-if="!track.cover_url">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>
|
||||
</template>
|
||||
</div>
|
||||
<div class="mobile-expanded-queue-info">
|
||||
<div class="mobile-expanded-queue-name" x-text="track.title"></div>
|
||||
<div class="mobile-expanded-queue-artist">
|
||||
<template x-for="(artist, artistIdx) in $store.library.trackArtistLinks(track)" :key="artist.label + '-' + artist.id + '-' + artistIdx">
|
||||
<span>
|
||||
<template x-if="artistIdx > 0"><span>, </span></template>
|
||||
<span x-text="artist.label"></span>
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<span class="mobile-expanded-queue-time" x-text="formatTime(track.duration_seconds)"></span>
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+627
-42
@@ -687,7 +687,7 @@ button.user-stat:hover {
|
||||
|
||||
.track-list-header {
|
||||
display: grid;
|
||||
grid-template-columns: 40px 1fr 1fr 120px 60px;
|
||||
grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) 154px 60px;
|
||||
padding: 8px 16px;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
color: var(--text-subdued);
|
||||
@@ -699,7 +699,7 @@ button.user-stat:hover {
|
||||
|
||||
.track-row {
|
||||
display: grid;
|
||||
grid-template-columns: 40px 1fr 1fr 120px 60px;
|
||||
grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) 154px 60px;
|
||||
padding: 8px 16px;
|
||||
border-radius: 4px;
|
||||
cursor: default;
|
||||
@@ -736,14 +736,18 @@ button.user-stat:hover {
|
||||
}
|
||||
|
||||
.track-album { font-size: 13px; color: var(--text-subdued); }
|
||||
.track-duration { font-size: 13px; color: var(--text-subdued); text-align: right; }
|
||||
.track-duration { font-size: 13px; color: var(--text-subdued); text-align: right; pointer-events: none; }
|
||||
|
||||
/* Track action buttons */
|
||||
.track-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
gap: 2px;
|
||||
opacity: 1;
|
||||
min-width: 0;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.track-action-btn {
|
||||
@@ -759,9 +763,22 @@ button.user-stat:hover {
|
||||
transition: color 0.15s, background 0.15s;
|
||||
}
|
||||
|
||||
.track-actions .track-action-btn,
|
||||
.track-actions .like-btn {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
flex: 0 0 28px;
|
||||
}
|
||||
|
||||
.track-actions .popularity-info-btn {
|
||||
width: auto;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.track-action-btn:hover { color: var(--text-primary); background: var(--bg-active); }
|
||||
.track-action-btn.play-btn:hover { color: var(--accent); }
|
||||
.track-action-btn svg { width: 16px; height: 16px; }
|
||||
.track-action-btn.queue-insert-btn svg { width: 17px; height: 17px; }
|
||||
|
||||
.info-btn {
|
||||
color: var(--text-subdued);
|
||||
@@ -1167,6 +1184,27 @@ button.user-stat:hover {
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.player-track-release {
|
||||
margin-top: 2px;
|
||||
font-size: 11px;
|
||||
color: var(--text-subdued);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.player-track-release .artist-link {
|
||||
color: var(--text-subdued);
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: inherit;
|
||||
}
|
||||
|
||||
.player-track-release .artist-link:hover {
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.player-controls {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -1223,6 +1261,10 @@ button.user-stat:hover {
|
||||
|
||||
.player-time { font-size: 11px; color: var(--text-subdued); min-width: 40px; text-align: center; }
|
||||
|
||||
.player-progress-strip-times {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
flex: 1;
|
||||
height: 4px;
|
||||
@@ -3052,7 +3094,7 @@ button.user-stat:hover {
|
||||
|
||||
.upload-tree-track {
|
||||
display: grid;
|
||||
grid-template-columns: 24px 30px minmax(0, 1fr) auto;
|
||||
grid-template-columns: 24px minmax(0, 1fr) auto;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-height: 44px;
|
||||
@@ -3151,7 +3193,7 @@ button.user-stat:hover {
|
||||
|
||||
.upload-track-display {
|
||||
display: grid;
|
||||
grid-template-columns: 34px minmax(0, 1fr) auto;
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
@@ -3409,6 +3451,11 @@ button.user-stat:hover {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.mobile-player-collapse-btn,
|
||||
.mobile-expanded-queue {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.playlist-action-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
@@ -3463,7 +3510,7 @@ button.user-stat:hover {
|
||||
|
||||
@media (max-width: 900px) {
|
||||
:root {
|
||||
--player-height: 118px;
|
||||
--player-height: 168px;
|
||||
--player-bar-space: calc(var(--player-height) + var(--safe-bottom));
|
||||
}
|
||||
|
||||
@@ -3597,54 +3644,175 @@ button.user-stat:hover {
|
||||
}
|
||||
|
||||
.player-bar {
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
grid-template-rows: auto auto;
|
||||
gap: 8px 12px;
|
||||
position: relative;
|
||||
grid-template-columns: auto minmax(0, 1fr);
|
||||
grid-template-rows: 62px 58px;
|
||||
grid-template-areas:
|
||||
"now now"
|
||||
"buttons actions";
|
||||
gap: 4px 10px;
|
||||
align-items: center;
|
||||
padding: 10px 12px calc(10px + var(--safe-bottom));
|
||||
padding: 34px 12px calc(9px + var(--safe-bottom));
|
||||
touch-action: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.player-now-playing {
|
||||
grid-column: 1;
|
||||
grid-row: 1;
|
||||
grid-area: now;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.player-now-playing > div {
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
gap: 10px !important;
|
||||
width: 100%;
|
||||
max-width: 620px;
|
||||
margin: 0 auto;
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
.player-cover {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.player-track-info {
|
||||
width: min(58vw, 360px);
|
||||
max-width: 360px;
|
||||
}
|
||||
|
||||
.player-track-title-row {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.player-current-like {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.player-track-title,
|
||||
.player-track-artist,
|
||||
.player-track-release {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.player-track-release {
|
||||
display: block;
|
||||
color: var(--text-subdued);
|
||||
font-size: 10px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.player-controls {
|
||||
grid-column: 1 / -1;
|
||||
grid-row: 2;
|
||||
gap: 6px;
|
||||
width: 100%;
|
||||
display: contents;
|
||||
}
|
||||
|
||||
.player-buttons {
|
||||
gap: 18px;
|
||||
grid-area: buttons;
|
||||
justify-self: start;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.player-bar:not(.mobile-expanded) .player-buttons .player-btn:first-child,
|
||||
.player-bar:not(.mobile-expanded) .player-buttons .player-btn:last-child {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.player-btn {
|
||||
min-width: 32px;
|
||||
min-height: 32px;
|
||||
min-width: 42px;
|
||||
min-height: 42px;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.player-btn svg {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
.player-btn-play {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
}
|
||||
|
||||
.player-btn-play svg {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.player-timeline {
|
||||
max-width: none;
|
||||
gap: 6px;
|
||||
gap: 5px;
|
||||
align-self: center;
|
||||
padding-right: 58px;
|
||||
}
|
||||
|
||||
.player-bar:not(.mobile-expanded) .player-timeline {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 21px;
|
||||
gap: 0;
|
||||
padding-right: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.player-bar:not(.mobile-expanded) .player-time {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.player-bar:not(.mobile-expanded) .progress-bar,
|
||||
.player-bar:not(.mobile-expanded) .progress-bar:hover {
|
||||
width: 100%;
|
||||
height: 21px;
|
||||
border-radius: 0;
|
||||
background: rgba(29, 185, 84, 0.18);
|
||||
}
|
||||
|
||||
.player-bar:not(.mobile-expanded) .progress-bar-fill {
|
||||
border-radius: 0;
|
||||
background: var(--accent);
|
||||
}
|
||||
|
||||
.player-bar:not(.mobile-expanded) .progress-bar-thumb {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.player-bar:not(.mobile-expanded) .player-progress-strip-times {
|
||||
position: absolute;
|
||||
top: 22px;
|
||||
right: 10px;
|
||||
height: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0;
|
||||
color: var(--text-subdued);
|
||||
font-size: 9px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
pointer-events: none;
|
||||
text-shadow: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.player-version-chip {
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
bottom: calc(12px + var(--safe-bottom));
|
||||
width: auto;
|
||||
max-width: none;
|
||||
margin-top: 0;
|
||||
padding-left: 0;
|
||||
opacity: 0.62;
|
||||
font-size: 9px;
|
||||
font-size: 8px;
|
||||
line-height: 1;
|
||||
opacity: 0.58;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.player-time {
|
||||
@@ -3653,17 +3821,35 @@ button.user-stat:hover {
|
||||
}
|
||||
|
||||
.player-right {
|
||||
grid-column: 2;
|
||||
grid-row: 1;
|
||||
grid-area: actions;
|
||||
justify-self: end;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(132px, 1fr) 40px 40px;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.volume-control {
|
||||
display: flex;
|
||||
display: grid;
|
||||
grid-template-columns: 30px minmax(112px, 1fr);
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.volume-btn {
|
||||
min-width: 30px;
|
||||
min-height: 36px;
|
||||
justify-content: center;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
.volume-slider {
|
||||
width: 88px;
|
||||
height: 6px;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 9px;
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
@@ -3672,18 +3858,365 @@ button.user-stat:hover {
|
||||
}
|
||||
|
||||
.volume-slider-thumb {
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
right: -8.5px;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
height: 6px;
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.progress-bar-fill {
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.progress-bar-thumb {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.queue-toggle-btn {
|
||||
min-width: 36px;
|
||||
min-height: 36px;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
.queue-toggle-btn svg,
|
||||
.volume-btn svg {
|
||||
width: 21px;
|
||||
height: 21px;
|
||||
}
|
||||
|
||||
.player-bar.mobile-dragging:not(.mobile-expanded) {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: calc(var(--player-bar-space) + var(--mobile-player-drag, 0px));
|
||||
z-index: 70;
|
||||
border-radius: 18px 18px 0 0;
|
||||
box-shadow: 0 -18px 54px rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
height: 100dvh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
gap: 16px;
|
||||
align-items: center;
|
||||
padding: calc(18px + env(safe-area-inset-top)) 18px calc(16px + var(--safe-bottom));
|
||||
border-top: 0;
|
||||
border-radius: 0;
|
||||
background: var(--bg-primary);
|
||||
box-shadow: none;
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
z-index: 80;
|
||||
transform: translateY(var(--mobile-player-close-drag, 0px));
|
||||
transition: transform 0.18s ease, height 0.18s ease;
|
||||
touch-action: pan-y;
|
||||
user-select: auto;
|
||||
}
|
||||
|
||||
.player-bar.mobile-dragging {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .mobile-player-collapse-btn {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
top: calc(12px + env(safe-area-inset-top));
|
||||
right: 12px;
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
border: 0;
|
||||
border-radius: 50%;
|
||||
background: rgba(255,255,255,0.08);
|
||||
color: var(--text-primary);
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.mobile-player-collapse-btn svg {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-now-playing {
|
||||
justify-content: center;
|
||||
align-self: stretch;
|
||||
width: 100%;
|
||||
min-height: max(300px, calc(100dvh - 248px));
|
||||
flex: 0 0 auto;
|
||||
overflow: visible;
|
||||
padding-top: 38px;
|
||||
touch-action: none;
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-now-playing > div {
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
gap: 18px !important;
|
||||
overflow: visible !important;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded.mobile-dragging .player-now-playing {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-cover {
|
||||
width: min(76vw, 38dvh, 360px);
|
||||
height: auto;
|
||||
aspect-ratio: 1;
|
||||
border-radius: 14px;
|
||||
box-shadow: 0 22px 62px rgba(0,0,0,0.48);
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-cover svg {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-track-info {
|
||||
width: min(100%, 520px);
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-track-title-row {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-track-title {
|
||||
font-size: 22px;
|
||||
font-weight: 800;
|
||||
white-space: normal;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-track-artist {
|
||||
margin-top: 5px;
|
||||
font-size: 14px;
|
||||
white-space: normal;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-current-like {
|
||||
display: flex;
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-track-release {
|
||||
margin-top: 4px;
|
||||
font-size: 13px;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-controls {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
flex: 0 0 auto;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-version-chip {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-buttons {
|
||||
justify-self: center;
|
||||
gap: 18px;
|
||||
order: 2;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-btn {
|
||||
min-width: 56px;
|
||||
min-height: 56px;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-btn svg {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-btn-play {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-timeline {
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
justify-self: center;
|
||||
align-self: center;
|
||||
padding-right: 0;
|
||||
order: 1;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .progress-bar {
|
||||
height: 7px;
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .progress-bar-thumb {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-right {
|
||||
position: static;
|
||||
grid-area: actions;
|
||||
justify-self: center;
|
||||
width: min(100%, 560px);
|
||||
flex: 0 0 auto;
|
||||
grid-template-columns: minmax(0, 1fr) 48px 48px;
|
||||
gap: 8px;
|
||||
padding: 0;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .volume-control {
|
||||
grid-template-columns: 44px minmax(0, 1fr);
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .volume-btn,
|
||||
.player-bar.mobile-expanded .queue-toggle-btn {
|
||||
min-width: 48px;
|
||||
min-height: 48px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .volume-btn {
|
||||
min-width: 44px;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .volume-slider {
|
||||
display: block;
|
||||
height: 7px;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .device-popover {
|
||||
position: fixed;
|
||||
top: auto;
|
||||
bottom: calc(90px + var(--safe-bottom));
|
||||
left: 12px;
|
||||
right: 12px;
|
||||
width: auto;
|
||||
max-width: none;
|
||||
max-height: 42dvh;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .mobile-expanded-queue {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-height: none;
|
||||
min-height: 0;
|
||||
overflow: visible;
|
||||
flex: 0 0 auto;
|
||||
margin-top: 8px;
|
||||
padding-top: 14px;
|
||||
padding-bottom: 24px;
|
||||
border-top: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.mobile-expanded-queue-title {
|
||||
margin: 0 0 8px;
|
||||
color: var(--text-subdued);
|
||||
font-size: 11px;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.mobile-expanded-queue-empty {
|
||||
padding: 18px 0;
|
||||
color: var(--text-subdued);
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.mobile-expanded-queue-row {
|
||||
width: 100%;
|
||||
min-height: 54px;
|
||||
border: 0;
|
||||
border-radius: 8px;
|
||||
background: transparent;
|
||||
color: var(--text-secondary);
|
||||
display: grid;
|
||||
grid-template-columns: 42px minmax(0, 1fr) auto;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 6px 4px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.mobile-expanded-queue-row:active {
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
|
||||
.mobile-expanded-queue-cover {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
background: var(--bg-elevated);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.mobile-expanded-queue-cover img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.mobile-expanded-queue-cover svg {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
color: var(--text-subdued);
|
||||
}
|
||||
|
||||
.mobile-expanded-queue-info {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.mobile-expanded-queue-name,
|
||||
.mobile-expanded-queue-artist {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.mobile-expanded-queue-name {
|
||||
color: var(--text-primary);
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.mobile-expanded-queue-artist,
|
||||
.mobile-expanded-queue-time {
|
||||
color: var(--text-subdued);
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 560px) {
|
||||
:root {
|
||||
--player-height: 132px;
|
||||
--player-height: 170px;
|
||||
--player-bar-space: calc(var(--player-height) + var(--safe-bottom));
|
||||
}
|
||||
|
||||
@@ -3960,7 +4493,7 @@ button.user-stat:hover {
|
||||
}
|
||||
|
||||
.upload-tree-track {
|
||||
grid-template-columns: 24px 30px minmax(0, 1fr);
|
||||
grid-template-columns: 24px minmax(0, 1fr);
|
||||
padding-left: 12px;
|
||||
}
|
||||
|
||||
@@ -3976,7 +4509,7 @@ button.user-stat:hover {
|
||||
}
|
||||
|
||||
.upload-track-display {
|
||||
grid-template-columns: 32px minmax(0, 1fr);
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.upload-track-actions {
|
||||
@@ -4121,11 +4654,24 @@ button.user-stat:hover {
|
||||
gap: 8px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
grid-template-rows: 60px 58px;
|
||||
}
|
||||
|
||||
.player-track-title { font-size: 12px; }
|
||||
.player-track-artist { font-size: 10px; }
|
||||
.player-buttons { gap: 10px; }
|
||||
.player-track-release { font-size: 9px; }
|
||||
.player-buttons { gap: 2px; }
|
||||
|
||||
.player-right {
|
||||
grid-template-columns: minmax(68px, 1fr) 34px 34px;
|
||||
width: 100%;
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.volume-control {
|
||||
grid-template-columns: 22px minmax(44px, 1fr);
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.player-version-chip {
|
||||
padding-left: 0;
|
||||
@@ -4138,26 +4684,65 @@ button.user-stat:hover {
|
||||
}
|
||||
|
||||
.volume-btn {
|
||||
min-width: 24px;
|
||||
min-height: 34px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.queue-toggle-btn {
|
||||
min-width: 34px;
|
||||
min-height: 34px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.volume-slider {
|
||||
width: 72px;
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.player-btn {
|
||||
min-width: 30px;
|
||||
min-height: 30px;
|
||||
min-width: 42px;
|
||||
min-height: 42px;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.player-btn svg {
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
.player-btn-play {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
}
|
||||
|
||||
.player-btn-play svg {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded {
|
||||
gap: 14px;
|
||||
padding-left: 14px;
|
||||
padding-right: 14px;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-cover {
|
||||
width: min(82vw, 36dvh, 340px);
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-buttons {
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-btn {
|
||||
min-width: 52px;
|
||||
min-height: 52px;
|
||||
}
|
||||
|
||||
.player-bar.mobile-expanded .player-btn-play {
|
||||
width: 68px;
|
||||
height: 68px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user