remove user settings json object from db and appearance settings from

frontend in favor of custom css stylesheets
This commit is contained in:
FrenchGithubUser
2025-12-06 14:59:28 +01:00
parent 667748518e
commit d8a65e38bd
23 changed files with 38 additions and 477 deletions

View File

@@ -1,56 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT\n id,\n upload_factor,\n download_factor,\n seeders,\n leechers,\n times_completed,\n CASE\n WHEN deleted_at IS NOT NULL THEN TRUE\n ELSE FALSE\n END AS \"is_deleted!\"\n FROM torrents\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int4"
},
{
"ordinal": 1,
"name": "upload_factor",
"type_info": "Int2"
},
{
"ordinal": 2,
"name": "download_factor",
"type_info": "Int2"
},
{
"ordinal": 3,
"name": "seeders",
"type_info": "Int8"
},
{
"ordinal": 4,
"name": "leechers",
"type_info": "Int8"
},
{
"ordinal": 5,
"name": "times_completed",
"type_info": "Int4"
},
{
"ordinal": 6,
"name": "is_deleted!",
"type_info": "Bool"
}
],
"parameters": {
"Left": []
},
"nullable": [
false,
false,
false,
false,
false,
false,
null
]
},
"hash": "46d7eee133e0653d9f11ab67f5d6faec7050c9b4c6a8c78e2097015d3e0fb7fb"
}

View File

@@ -181,26 +181,21 @@
},
{
"ordinal": 33,
"name": "settings",
"type_info": "Jsonb"
},
{
"ordinal": 34,
"name": "passkey",
"type_info": "Varchar"
},
{
"ordinal": 35,
"ordinal": 34,
"name": "warned",
"type_info": "Bool"
},
{
"ordinal": 36,
"ordinal": 35,
"name": "banned",
"type_info": "Bool"
},
{
"ordinal": 37,
"ordinal": 36,
"name": "staff_note",
"type_info": "Text"
}
@@ -247,7 +242,6 @@
false,
false,
false,
false,
false
]
},

View File

@@ -1,26 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT\n id,\n passkey as \"passkey: Passkey\"\n FROM users\n WHERE banned = FALSE\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int4"
},
{
"ordinal": 1,
"name": "passkey: Passkey",
"type_info": "Varchar"
}
],
"parameters": {
"Left": []
},
"nullable": [
false,
false
]
},
"hash": "4edda78ffd766d9ec15eb015fe5b985755924b0f0b44d5cf9411059cfbc5c757"
}

View File

@@ -1,26 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n INSERT INTO peers (\n peer_id,\n ip,\n port,\n agent,\n uploaded,\n downloaded,\n \"left\",\n active,\n seeder,\n created_at,\n updated_at,\n torrent_id,\n user_id\n )\n SELECT\n t.peer_id,\n t.ip,\n t.port,\n t.agent,\n t.uploaded,\n t.downloaded,\n t.\"left\",\n t.active,\n t.seeder,\n -- stored as timestamp without time zone in DB\n (t.created_at AT TIME ZONE 'UTC')::timestamp,\n (t.updated_at AT TIME ZONE 'UTC')::timestamp,\n t.torrent_id,\n t.user_id\n FROM (\n SELECT * FROM unnest(\n $1::bytea[],\n $2::inet[],\n $3::int[],\n $4::varchar[],\n $5::bigint[],\n $6::bigint[],\n $7::bigint[],\n $8::boolean[],\n $9::boolean[],\n $10::timestamptz[],\n $11::timestamptz[],\n $12::int[],\n $13::int[]\n ) AS t(\n peer_id,\n ip,\n port,\n agent,\n uploaded,\n downloaded,\n \"left\",\n active,\n seeder,\n created_at,\n updated_at,\n torrent_id,\n user_id\n )\n ) AS t\n ON CONFLICT (user_id, torrent_id, peer_id) DO UPDATE SET\n ip = EXCLUDED.ip,\n port = EXCLUDED.port,\n agent = EXCLUDED.agent,\n uploaded = EXCLUDED.uploaded,\n downloaded = EXCLUDED.downloaded,\n \"left\" = EXCLUDED.\"left\",\n active = EXCLUDED.active,\n seeder = EXCLUDED.seeder,\n updated_at = EXCLUDED.updated_at\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"ByteaArray",
"InetArray",
"Int4Array",
"VarcharArray",
"Int8Array",
"Int8Array",
"Int8Array",
"BoolArray",
"BoolArray",
"TimestamptzArray",
"TimestamptzArray",
"Int4Array",
"Int4Array"
]
},
"nullable": []
},
"hash": "599587c7ce69b090843274603171c411af859ae256fc01eaf66af2aa2a922900"
}

View File

@@ -1,18 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n UPDATE users\n SET\n uploaded = uploaded + updates.uploaded_delta,\n downloaded = downloaded + updates.downloaded_delta,\n real_uploaded = real_uploaded + updates.uploaded_delta,\n real_downloaded = real_downloaded + updates.downloaded_delta\n FROM (\n SELECT * FROM unnest($1::int[], $2::bigint[], $3::bigint[], $4::bigint[], $5::bigint[]) AS\n t(user_id, uploaded_delta, downloaded_delta, real_uploaded_delta, real_downloaded_delta)\n ) AS updates\n WHERE users.id = updates.user_id\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Int4Array",
"Int8Array",
"Int8Array",
"Int8Array",
"Int8Array"
]
},
"nullable": []
},
"hash": "68c566af855b2cb1e46b77cd829934488b1d4da1086f74b7491d7468753f539a"
}

View File

@@ -1,16 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n DELETE FROM peers\n WHERE (user_id, torrent_id, peer_id) IN (\n SELECT t.user_id, t.torrent_id, t.peer_id\n FROM (\n SELECT * FROM unnest(\n $1::int[],\n $2::int[],\n $3::bytea[]\n ) AS t(user_id, torrent_id, peer_id)\n ) AS t\n )\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Int4Array",
"Int4Array",
"ByteaArray"
]
},
"nullable": []
},
"hash": "7da73662a96a68e239d011598ace3bc5b287a82c5b0c34ce9543842a1bed0ea4"
}

View File

@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "\n INSERT INTO users (username, email, password_hash, registered_from_ip, settings, passkey)\n VALUES ($1, $2, $3, $4, $5, $6)\n RETURNING *\n ",
"query": "\n INSERT INTO users (username, email, password_hash, registered_from_ip, passkey)\n VALUES ($1, $2, $3, $4, $5)\n RETURNING *\n ",
"describe": {
"columns": [
{
@@ -181,26 +181,21 @@
},
{
"ordinal": 33,
"name": "settings",
"type_info": "Jsonb"
},
{
"ordinal": 34,
"name": "passkey",
"type_info": "Varchar"
},
{
"ordinal": 35,
"ordinal": 34,
"name": "warned",
"type_info": "Bool"
},
{
"ordinal": 36,
"ordinal": 35,
"name": "banned",
"type_info": "Bool"
},
{
"ordinal": 37,
"ordinal": 36,
"name": "staff_note",
"type_info": "Text"
}
@@ -211,7 +206,6 @@
"Varchar",
"Varchar",
"Inet",
"Jsonb",
"Varchar"
]
},
@@ -252,9 +246,8 @@
false,
false,
false,
false,
false
]
},
"hash": "1ba3d0500ac2e8ea8e74eb40aaae30120571f581ff3597c25cf04502dd7c9fc9"
"hash": "aaf68bfe32bb1b08287cfbba92bd39f56e810e4a82cc21a8f66fa4867bac75c0"
}

View File

@@ -181,26 +181,21 @@
},
{
"ordinal": 33,
"name": "settings",
"type_info": "Jsonb"
},
{
"ordinal": 34,
"name": "passkey",
"type_info": "Varchar"
},
{
"ordinal": 35,
"ordinal": 34,
"name": "warned",
"type_info": "Bool"
},
{
"ordinal": 36,
"ordinal": 35,
"name": "banned",
"type_info": "Bool"
},
{
"ordinal": 37,
"ordinal": 36,
"name": "staff_note",
"type_info": "Text"
}
@@ -247,7 +242,6 @@
false,
false,
false,
false,
false
]
},

View File

@@ -1,38 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT\n id,\n passkey as \"passkey: Passkey\",\n 0::INT AS \"num_seeding!\",\n 0::INT AS \"num_leeching!\"\n FROM users\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int4"
},
{
"ordinal": 1,
"name": "passkey: Passkey",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "num_seeding!",
"type_info": "Int4"
},
{
"ordinal": 3,
"name": "num_leeching!",
"type_info": "Int4"
}
],
"parameters": {
"Left": []
},
"nullable": [
false,
false,
null,
null
]
},
"hash": "bb66b1b13123112781db47d98cd02b28d11470b7c84d7aec56ec102fee20264d"
}

View File

@@ -1,17 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n UPDATE torrents\n SET\n seeders = seeders + updates.seeder_delta,\n leechers = leechers + updates.leecher_delta,\n times_completed = times_completed + updates.times_completed_delta\n FROM (\n SELECT * FROM unnest($1::int[], $2::bigint[], $3::bigint[], $4::bigint[]) AS\n t(torrent_id, seeder_delta, leecher_delta, times_completed_delta)\n ) AS updates\n WHERE torrents.id = updates.torrent_id\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Int4Array",
"Int8Array",
"Int8Array",
"Int8Array"
]
},
"nullable": []
},
"hash": "c45f235654a1b2aa8c849c5644443fe34ea7a4dd976fe6b4405e7b4a585a1325"
}

View File

@@ -181,26 +181,21 @@
},
{
"ordinal": 33,
"name": "settings",
"type_info": "Jsonb"
},
{
"ordinal": 34,
"name": "passkey",
"type_info": "Varchar"
},
{
"ordinal": 35,
"ordinal": 34,
"name": "warned",
"type_info": "Bool"
},
{
"ordinal": 36,
"ordinal": 35,
"name": "banned",
"type_info": "Bool"
},
{
"ordinal": 37,
"ordinal": 36,
"name": "staff_note",
"type_info": "Text"
}
@@ -247,7 +242,6 @@
false,
false,
false,
false,
false
]
},

View File

@@ -1,26 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT\n id,\n info_hash as \"info_hash: InfoHash\"\n FROM torrents\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int4"
},
{
"ordinal": 1,
"name": "info_hash: InfoHash",
"type_info": "Bytea"
}
],
"parameters": {
"Left": []
},
"nullable": [
false,
false
]
},
"hash": "d94c7cf9c02a4f060345d02ac4bd2434069fc46d43e6f3e7e3618737c2dcd547"
}

View File

@@ -1,74 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT\n peers.ip AS \"ip_address: IpAddr\",\n peers.user_id AS \"user_id\",\n peers.torrent_id AS \"torrent_id\",\n peers.port AS \"port\",\n peers.seeder AS \"is_seeder: bool\",\n peers.active AS \"is_active: bool\",\n peers.updated_at AS \"updated_at: DateTime<Utc>\",\n peers.uploaded AS \"uploaded\",\n peers.downloaded AS \"downloaded\",\n peers.peer_id AS \"peer_id: PeerId\"\n FROM peers\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "ip_address: IpAddr",
"type_info": "Inet"
},
{
"ordinal": 1,
"name": "user_id",
"type_info": "Int4"
},
{
"ordinal": 2,
"name": "torrent_id",
"type_info": "Int4"
},
{
"ordinal": 3,
"name": "port",
"type_info": "Int4"
},
{
"ordinal": 4,
"name": "is_seeder: bool",
"type_info": "Bool"
},
{
"ordinal": 5,
"name": "is_active: bool",
"type_info": "Bool"
},
{
"ordinal": 6,
"name": "updated_at: DateTime<Utc>",
"type_info": "Timestamp"
},
{
"ordinal": 7,
"name": "uploaded",
"type_info": "Int8"
},
{
"ordinal": 8,
"name": "downloaded",
"type_info": "Int8"
},
{
"ordinal": 9,
"name": "peer_id: PeerId",
"type_info": "Bytea"
}
],
"parameters": {
"Left": []
},
"nullable": [
false,
false,
false,
false,
false,
false,
true,
false,
false,
false
]
},
"hash": "f6d849721ff84614c129c14455d9a6adbe0ad29b7876963d5bd9015c0f73ba9d"
}

View File

@@ -39,7 +39,6 @@ CREATE TABLE users (
invitations SMALLINT NOT NULL DEFAULT 0,
bonus_points BIGINT NOT NULL DEFAULT 0,
freeleech_tokens INT NOT NULL DEFAULT 0,
settings JSONB NOT NULL DEFAULT '{}',
passkey VARCHAR(32) NOT NULL,
warned BOOLEAN NOT NULL DEFAULT FALSE,
banned BOOLEAN NOT NULL DEFAULT FALSE,
@@ -47,8 +46,8 @@ CREATE TABLE users (
UNIQUE(passkey)
);
INSERT INTO users (username, email, password_hash, registered_from_ip, settings, passkey)
VALUES ('creator', 'none@domain.com', 'none', '127.0.0.1', '{}'::jsonb, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
INSERT INTO users (username, email, password_hash, registered_from_ip, passkey)
VALUES ('creator', 'none@domain.com', 'none', '127.0.0.1', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
CREATE TABLE api_keys (
id BIGSERIAL PRIMARY KEY,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),

View File

@@ -27,11 +27,11 @@ INSERT INTO public._sqlx_migrations VALUES (20250312215600, 'initdb', '2025-09-1
-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: arcadia
--
INSERT INTO public.users VALUES (1, 'creator', NULL, 'none@domain.com', 'none', '127.0.0.1', '2025-09-17 12:42:13.702455+00', '', 0, 0, 1, 1, 0, 0, '2025-09-17 12:42:13.702455+00', 'newbie', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '{}', '111111111111111111111111111111111', false, false, '');
INSERT INTO public.users VALUES (5, 'waterbottle', 'https://i.pinimg.com/736x/a6/27/12/a6271204df8d387c3e614986c106f549.jpg', 'user2@example.com', 'hashedpassword2', '192.168.1.2', '2025-03-30 16:24:57.388152+00', '', 0, 0, 1, 1, 0, 0, '2025-03-30 16:24:57.388152+00', 'newbie', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '{"site_appearance": {"item_detail_layout": "sidebar_right"}}', '22222222222222222222222222222222', false, false, '''''');
INSERT INTO public.users VALUES (3, 'coolguy', 'https://i.pinimg.com/474x/c1/5a/6c/c15a6c91515e22f6ea8b766f89c12f0c.jpg', 'user3@example.com', 'hashedpassword3', '192.168.1.3', '2025-03-30 16:24:57.388152+00', '', 0, 0, 1, 1, 0, 0, '2025-03-30 16:24:57.388152+00', 'newbie', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '{"site_appearance": {"item_detail_layout": "sidebar_right"}}', '33333333333333333333333333333333', false, false, '''''');
INSERT INTO public.users VALUES (4, 'test', NULL, 'test@test.tsttt', '$argon2id$v=19$m=19456,t=2,p=1$yaA+WqA4OfSyAqR3iXhDng$/Ngv7VeJvVNHli9rBgQG0d/O2W+qoI2yHhQxZSxxW2M', '127.0.0.1', '2025-04-10 19:15:51.036818+00', '', 979900000000, 0, 1, 1, 0, 0, '2025-09-17 09:15:44.322914+00', 'newbie', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99999000, 0, '{"site_appearance": {"item_detail_layout": "sidebar_right"}}', '55555555555555555555555555555555', false, false, '''''');
INSERT INTO public.users VALUES (2, 'picolo', 'https://img.freepik.com/premium-vector/random-people-line-art-vector_567805-63.jpg', 'user1@example.com', '$argon2id$v=19$m=19456,t=2,p=1$s4XJtCUk9IrGgNsTfP6Ofw$ktoGbBEoFaVgdiTn19Gh9h45LjFiv7AUEL5KHhzm4d0', '192.168.1.1', '2025-03-30 16:24:57.388152+00', '', 10000, 0, 1, 1, 0, 0, '2025-11-28 17:29:24.968105+00', 'staff', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 999999410, 0, '{"site_appearance": {"item_detail_layout": "sidebar_right"}}', '44444444444444444444444444444444', false, false, '''''');
INSERT INTO public.users VALUES (1, 'creator', NULL, 'none@domain.com', 'none', '127.0.0.1', '2025-09-17 12:42:13.702455+00', '', 0, 0, 1, 1, 0, 0, '2025-09-17 12:42:13.702455+00', 'newbie', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '111111111111111111111111111111111', false, false, '');
INSERT INTO public.users VALUES (5, 'waterbottle', 'https://i.pinimg.com/736x/a6/27/12/a6271204df8d387c3e614986c106f549.jpg', 'user2@example.com', 'hashedpassword2', '192.168.1.2', '2025-03-30 16:24:57.388152+00', '', 0, 0, 1, 1, 0, 0, '2025-03-30 16:24:57.388152+00', 'newbie', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '22222222222222222222222222222222', false, false, '''''');
INSERT INTO public.users VALUES (3, 'coolguy', 'https://i.pinimg.com/474x/c1/5a/6c/c15a6c91515e22f6ea8b766f89c12f0c.jpg', 'user3@example.com', 'hashedpassword3', '192.168.1.3', '2025-03-30 16:24:57.388152+00', '', 0, 0, 1, 1, 0, 0, '2025-03-30 16:24:57.388152+00', 'newbie', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '33333333333333333333333333333333', false, false, '''''');
INSERT INTO public.users VALUES (4, 'test', NULL, 'test@test.tsttt', '$argon2id$v=19$m=19456,t=2,p=1$yaA+WqA4OfSyAqR3iXhDng$/Ngv7VeJvVNHli9rBgQG0d/O2W+qoI2yHhQxZSxxW2M', '127.0.0.1', '2025-04-10 19:15:51.036818+00', '', 979900000000, 0, 1, 1, 0, 0, '2025-09-17 09:15:44.322914+00', 'newbie', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99999000, 0, '55555555555555555555555555555555', false, false, '''''');
INSERT INTO public.users VALUES (2, 'picolo', 'https://img.freepik.com/premium-vector/random-people-line-art-vector_567805-63.jpg', 'user1@example.com', '$argon2id$v=19$m=19456,t=2,p=1$s4XJtCUk9IrGgNsTfP6Ofw$ktoGbBEoFaVgdiTn19Gh9h45LjFiv7AUEL5KHhzm4d0', '192.168.1.1', '2025-03-30 16:24:57.388152+00', '', 10000, 0, 1, 1, 0, 0, '2025-11-28 17:29:24.968105+00', 'staff', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 999999410, 0, '44444444444444444444444444444444', false, false, '''''');
--

View File

@@ -8,36 +8,6 @@ use utoipa::ToSchema;
use super::peer::Peer;
use super::title_group::TitleGroupHierarchyLite;
// TODO: deserialize the settings field to a rust struct, currently doesn't seem possible
// https://github.com/launchbadge/sqlx/issues/3153#issuecomment-2798756953
// #[derive(Serialize, Deserialize, Debug, sqlx::Type)]
// #[sqlx(type_name = "item_detail_layout")]
// pub enum ItemDetailLayout {
// #[sqlx(rename = "header")]
// #[serde(rename = "header")]
// Header,
// #[sqlx(rename = "sidebar_right")]
// #[serde(rename = "sidebar_right")]
// SideBarRight,
// #[sqlx(rename = "sidebar_left")]
// #[serde(rename = "sidebar_left")]
// SideBarLeft,
// }
// #[derive(Serialize, Deserialize, Debug, FromRow, sqlx::Type)]
// pub struct SiteAppearanceSettings {
// pub item_detail_layout: ItemDetailLayout,
// }
// #[derive(Serialize, Deserialize, Debug, FromRow, sqlx::Type)]
// // #[sqlx(type_name = "user_settings")]
// pub struct UserSettings {
// pub site_appearance: SiteAppearanceSettings,
// }
// causes errors
// https://github.com/launchbadge/sqlx/issues/3869
#[derive(Debug, Serialize, Deserialize, FromRow, ToSchema)]
pub struct User {
pub id: i32,
@@ -76,7 +46,6 @@ pub struct User {
pub invitations: i16,
pub bonus_points: i64,
pub freeleech_tokens: i32,
pub settings: serde_json::Value,
pub warned: bool,
pub banned: bool,
pub staff_note: String,

View File

@@ -51,21 +51,17 @@ impl ConnectionPool {
return Err(Error::UsernameAlreadyExists);
}
let settings =
serde_json::json!({"site_appearance":{"item_detail_layout": "sidebar_right"}});
let registered_user = sqlx::query_as_unchecked!(
User,
r#"
INSERT INTO users (username, email, password_hash, registered_from_ip, settings, passkey)
VALUES ($1, $2, $3, $4, $5, $6)
INSERT INTO users (username, email, password_hash, registered_from_ip, passkey)
VALUES ($1, $2, $3, $4, $5)
RETURNING *
"#,
&user.username,
&user.email,
password_hash,
from_ip,
settings,
passkey
)
.fetch_one(self.borrow())

View File

@@ -98,19 +98,12 @@ a {
}
}
.sidebar-right {
.with-sidebar {
display: flex;
.main {
margin-right: 20px;
}
}
.sidebar-left {
display: flex;
flex-direction: row-reverse;
.main {
margin-left: 20px;
}
}
.slim-header {
margin-bottom: 20px;
}

View File

@@ -5,17 +5,7 @@ export type Peer = components['schemas']['Peer']
export type UserLite = components['schemas']['UserLite']
// TODO: update when we can deserialize the settings field to a rust struct and get the type for
// this field generated automatically
// https://github.com/launchbadge/sqlx/issues/3153#issuecomment-2798756953
type UserSettings = {
settings: {
site_appearance: {
item_detail_layout: 'header' | 'sidebar_right' | 'sidebar_left'
}
}
}
export type User = components['schemas']['User'] & UserSettings
export type User = components['schemas']['User']
export type PublicUser = components['schemas']['PublicUser']

View File

@@ -1,15 +1,7 @@
<template>
<div
v-if="artist"
id="artist-view"
:class="{
'sidebar-right': userStore.settings.site_appearance.item_detail_layout == 'sidebar_right',
'sidebar-left': userStore.settings.site_appearance.item_detail_layout == 'sidebar_left',
}"
>
<div v-if="artist" id="artist-view" class="with-sidebar">
<div class="main">
<ArtistFullHeader :artist v-if="userStore.settings.site_appearance.item_detail_layout == 'header'" />
<ArtistSlimHeader v-else class="slim-header" :artist @artistEdited="artist = $event" />
<ArtistSlimHeader class="slim-header" :artist @artistEdited="artist = $event" />
<ContentContainer v-if="title_group_preview_mode == 'cover-only'">
<div class="title-groups">
<TitleGroupPreviewCoverOnly v-for="title_group in title_groups" :key="title_group.id" :titleGroup="title_group" />
@@ -26,17 +18,14 @@
<script setup lang="ts">
import { ref, watch } from 'vue'
import { useRoute } from 'vue-router'
import { useUserStore } from '@/stores/user'
import ContentContainer from '@/components/ContentContainer.vue'
import ArtistSidebar from '@/components/artist/ArtistSidebar.vue'
import TitleGroupPreviewCoverOnly from '@/components/title_group/TitleGroupPreviewCoverOnly.vue'
import TitleGroupPreviewTable from '@/components/title_group/TitleGroupPreviewTable.vue'
import ArtistFullHeader from '@/components/artist/ArtistFullHeader.vue'
import ArtistSlimHeader from '@/components/artist/ArtistSlimHeader.vue'
import { getArtist, type Artist, type TitleGroupHierarchyLite } from '@/services/api/artistService'
const route = useRoute()
const userStore = useUserStore()
const artist = ref<Artist>()
const title_groups = ref<TitleGroupHierarchyLite[]>([])

View File

@@ -1,31 +1,12 @@
<template>
<!-- TODO: use skeletons while the data is loading -->
<div
v-if="titleGroupAndAssociatedData"
id="title-group-view"
:class="{
'sidebar-right': userStore.settings.site_appearance.item_detail_layout == 'sidebar_right',
'sidebar-left': userStore.settings.site_appearance.item_detail_layout == 'sidebar_left',
}"
>
<div v-if="titleGroupAndAssociatedData" id="title-group-view" class="with-sidebar">
<div
:class="{
main: true,
'with-sidebar': userStore.settings.site_appearance.item_detail_layout.includes('sidebar'),
}"
>
<TitleGroupFullHeader
:title_group="titleGroupAndAssociatedData.title_group"
:series="titleGroupAndAssociatedData.series"
:affiliatedArtists="titleGroupAndAssociatedData.affiliated_artists"
v-if="userStore.settings.site_appearance.item_detail_layout == 'header'"
/>
<TitleGroupSlimHeader
v-else
:titleGroup="titleGroupAndAssociatedData.title_group"
:series="titleGroupAndAssociatedData.series"
class="slim-header title"
/>
<TitleGroupSlimHeader :titleGroup="titleGroupAndAssociatedData.title_group" :series="titleGroupAndAssociatedData.series" class="slim-header title" />
<div class="actions">
<div>
<i v-if="togglingSubscription" class="pi pi-hourglass" />
@@ -112,7 +93,7 @@
/>
<TitleGroupComments :comments="titleGroupAndAssociatedData.title_group_comments" @newComment="newComment" />
</div>
<div class="sidebar" v-if="userStore.settings.site_appearance.item_detail_layout.includes('sidebar')">
<div class="sidebar">
<TitleGroupSidebar
:title_group="titleGroupAndAssociatedData.title_group"
:inSameMasterGroup="titleGroupAndAssociatedData.in_same_master_group"
@@ -167,7 +148,6 @@ import Accordion from 'primevue/accordion'
import AccordionPanel from 'primevue/accordionpanel'
import AccordionHeader from 'primevue/accordionheader'
import AccordionContent from 'primevue/accordioncontent'
import TitleGroupFullHeader from '@/components/title_group/TitleGroupFullHeader.vue'
import TitleGroupSlimHeader from '@/components/title_group/TitleGroupSlimHeader.vue'
import { subscribeToTitleGroupTorrents, unsubscribeToTitleGroupTorrents } from '@/services/api/subscriptionService'
import { useTitleGroupStore } from '@/stores/titleGroup'
@@ -310,7 +290,7 @@ watch(() => route.params.id, fetchTitleGroup, { immediate: true })
</script>
<style scoped>
.main.with-sidebar {
.main {
width: 75%;
}
.sidebar {

View File

@@ -1,15 +1,7 @@
<template>
<div
id="series-view"
v-if="series"
:class="{
'sidebar-right': userStore.settings.site_appearance.item_detail_layout == 'sidebar_right',
'sidebar-left': userStore.settings.site_appearance.item_detail_layout == 'sidebar_left',
}"
>
<div id="series-view" v-if="series" class="with-sidebar">
<div class="main">
<SeriesFullHeader :series v-if="userStore.settings.site_appearance.item_detail_layout == 'header'" />
<SeriesSlimHeader v-else class="slim-header" :series />
<SeriesSlimHeader class="slim-header" :series />
<ContentContainer v-if="title_group_preview_mode == 'cover-only'">
<div class="title-groups">
<TitleGroupPreviewCoverOnly v-for="title_group in title_groups" :key="title_group.id" :titleGroup="title_group" />
@@ -19,25 +11,22 @@
<TitleGroupPreviewTable v-for="title_group in title_groups" :key="title_group.id" :title_group="title_group" class="preview-table" />
</div>
</div>
<SeriesSidebar :series v-if="userStore.settings.site_appearance.item_detail_layout.includes('sidebar')" />
<SeriesSidebar :series />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useRoute } from 'vue-router'
import { useUserStore } from '@/stores/user'
import { getSeries } from '@/services/api/seriesService'
import SeriesSlimHeader from '@/components/series/SeriesSlimHeader.vue'
import ContentContainer from '@/components/ContentContainer.vue'
import TitleGroupPreviewCoverOnly from '@/components/title_group/TitleGroupPreviewCoverOnly.vue'
import TitleGroupPreviewTable from '@/components/title_group/TitleGroupPreviewTable.vue'
import SeriesFullHeader from '@/components/series/SeriesFullHeader.vue'
import SeriesSidebar from '@/components/series/SeriesSidebar.vue'
import type { TitleGroupHierarchyLite } from '@/services/api/artistService'
import type { Series } from '@/services/api/seriesService'
const userStore = useUserStore()
const route = useRoute()
const series = ref<Series | null>(null)

View File

@@ -1,26 +1,7 @@
<template>
<div
v-if="torrentRequestAndAssociatedData"
id="title-group-view"
:class="{
'sidebar-right': userStore.settings.site_appearance.item_detail_layout == 'sidebar_right',
'sidebar-left': userStore.settings.site_appearance.item_detail_layout == 'sidebar_left',
}"
>
<div
:class="{
main: true,
'with-sidebar': userStore.settings.site_appearance.item_detail_layout.includes('sidebar'),
}"
>
<TitleGroupFullHeader
:title_group="torrentRequestAndAssociatedData.title_group"
:affiliatedArtists="torrentRequestAndAssociatedData.affiliated_artists"
:series="torrentRequestAndAssociatedData.series"
v-if="userStore.settings.site_appearance.item_detail_layout == 'header'"
/>
<div v-if="torrentRequestAndAssociatedData" id="title-group-view" class="with-sidebar">
<div class="main">
<TitleGroupSlimHeader
v-else
:titleGroup="torrentRequestAndAssociatedData.title_group"
:series="torrentRequestAndAssociatedData.series"
:nameLink="`/title-group/${torrentRequestAndAssociatedData.title_group.id}`"
@@ -82,7 +63,7 @@
</ContentContainer>
<!-- <TitleGroupComments :comments="titleGroupAndAssociatedData.title_group_comments" @newComment="newComment" /> -->
</div>
<div class="sidebar" v-if="userStore.settings.site_appearance.item_detail_layout.includes('sidebar')">
<div class="sidebar">
<TitleGroupSidebar
:title_group="torrentRequestAndAssociatedData.title_group"
:affiliatedArtists="torrentRequestAndAssociatedData.affiliated_artists"
@@ -94,7 +75,6 @@
<script setup lang="ts">
import { ref, onMounted, watch } from 'vue'
import { useUserStore } from '@/stores/user'
import BBCodeRenderer from '@/components/community/BBCodeRenderer.vue'
import TitleGroupSidebar from '@/components/title_group/TitleGroupSidebar.vue'
import ContentContainer from '@/components/ContentContainer.vue'
@@ -106,7 +86,6 @@ import TorrentRequestVotesTable from '@/components/torrent_request/TorrentReques
// import AccordionPanel from 'primevue/accordionpanel'
// import AccordionHeader from 'primevue/accordionheader'
// import AccordionContent from 'primevue/accordioncontent'
import TitleGroupFullHeader from '@/components/title_group/TitleGroupFullHeader.vue'
import TitleGroupSlimHeader from '@/components/title_group/TitleGroupSlimHeader.vue'
// import { subscribeToItem, unsubscribeToItem } from '@/services/api/generalService'
// import { useTitleGroupStore } from '@/stores/titleGroup'
@@ -123,7 +102,6 @@ const router = useRouter()
const route = useRoute()
const { t } = useI18n()
const userStore = useUserStore()
// const titleGroupStore = useTitleGroupStore()
const torrentRequestAndAssociatedData = ref<TorrentRequestAndAssociatedData>()
@@ -196,7 +174,7 @@ watch(() => route.params.id, fetchTorrentRequest, { immediate: true })
</script>
<style scoped>
.main.with-sidebar {
.main {
width: 75%;
}
.sidebar {