diff --git a/defs/api/stations/[station]/files/[file]/metadata/PATCH/Output.ts b/defs/api/stations/[station]/files/[file]/metadata/PUT/Output.ts similarity index 100% rename from defs/api/stations/[station]/files/[file]/metadata/PATCH/Output.ts rename to defs/api/stations/[station]/files/[file]/metadata/PUT/Output.ts diff --git a/defs/api/stations/[station]/files/[file]/metadata/PATCH/Payload.ts b/defs/api/stations/[station]/files/[file]/metadata/PUT/Payload.ts similarity index 100% rename from defs/api/stations/[station]/files/[file]/metadata/PATCH/Payload.ts rename to defs/api/stations/[station]/files/[file]/metadata/PUT/Payload.ts diff --git a/front/app/src/routes/(root)/(online)/(app)/accounts/[account]/stations/[station]/playlist/+page.svelte b/front/app/src/routes/(root)/(online)/(app)/accounts/[account]/stations/[station]/playlist/+page.svelte index e0b865e6..98365cc4 100644 --- a/front/app/src/routes/(root)/(online)/(app)/accounts/[account]/stations/[station]/playlist/+page.svelte +++ b/front/app/src/routes/(root)/(online)/(app)/accounts/[account]/stations/[station]/playlist/+page.svelte @@ -4,7 +4,7 @@ import { invalidate } from "$app/navigation"; import Page from "$lib/components/Page.svelte"; import { ripple } from "$share/ripple"; - import { action, ClientError, _delete, _get, _post, _put, _request } from "$share/net.client"; + import { action, ClientError, _delete, _get, _post, _put, _request, _patch } from "$share/net.client"; import { mdiPlay, mdiPause, mdiAlertDecagram, mdiCheck, mdiTimerPauseOutline, mdiCircleEditOutline, mdiTrashCanOutline, mdiAutorenew, mdiCheckboxIntermediate, mdiCheckboxBlankOutline, mdiContentSaveOutline, mdiDrag, mdiMusic, mdiShuffleVariant, mdiShuffleDisabled, mdiRestart } from "@mdi/js"; import Icon from "$share/Icon.svelte"; import { onMount } from "svelte"; @@ -484,7 +484,7 @@ const edit_save = action(async () => { if(audio_item_to_edit == null) return; - const payload: import("$api/stations/[station]/files/[file]/metadata/PATCH/Payload").Payload = { + const payload: import("$api/stations/[station]/files/[file]/metadata/PUT/Payload").Payload = { title: edit_current_title.trim() || null, artist: edit_current_artist.trim() || null, album: edit_current_album.trim() || null, diff --git a/front/package.json b/front/package.json index 86b0265d..037025f4 100644 --- a/front/package.json +++ b/front/package.json @@ -24,7 +24,8 @@ "ci:share": "cd share && npm ci", "ci:server": "cd server && npm ci", "ci:admin": "cd admin && npm ci", - "ci:app": "cd app && npm ci" + "ci:app": "cd app && npm ci", + "start": "cd server && npm run start" }, "keywords": [], "author": "", diff --git a/front/server/src/api/shared-api.ts b/front/server/src/api/shared-api.ts index 195a2b99..9c4d871e 100644 --- a/front/server/src/api/shared-api.ts +++ b/front/server/src/api/shared-api.ts @@ -240,7 +240,7 @@ export const shared_api = ({ api.route("/stations/:station/files/:file/metadata") .put(json(async req => { - return await client.stations.files.patch_metadata(ip(req), ua(req), get_token(req), req.params.station, req.params.file, req.body); + return await client.stations.files.put_metadata(ip(req), ua(req), get_token(req), req.params.station, req.params.file, req.body); })) api.route("/stations/:station/now-playing") diff --git a/front/server/src/client.ts b/front/server/src/client.ts index 7ca6737e..83362d83 100644 --- a/front/server/src/client.ts +++ b/front/server/src/client.ts @@ -590,8 +590,8 @@ export class StationFiles { return await this.client.get_json_body(res) } - async patch_metadata(ip: string | null, ua: string | null, token: string, station_id: string, file_id: string, payload: import("$api/stations/[station]/files/[file]/metadata/PATCH/Payload").Payload): Promise { - return await this.client.patch(ip, ua, token, `/stations/${station_id}/files/${file_id}/metadata`, payload); + async put_metadata(ip: string | null, ua: string | null, token: string, station_id: string, file_id: string, payload: import("$api/stations/[station]/files/[file]/metadata/PATCH/Payload").Payload): Promise { + return await this.client.put(ip, ua, token, `/stations/${station_id}/files/${file_id}/metadata`, payload); } async shuffle(ip: string | null, ua: string | null, token: string, station_id: string): Promise { diff --git a/rs/packages/api/src/routes/mod.rs b/rs/packages/api/src/routes/mod.rs index c06d383f..2f1a97de 100644 --- a/rs/packages/api/src/routes/mod.rs +++ b/rs/packages/api/src/routes/mod.rs @@ -388,7 +388,7 @@ pub fn router( app .at("/stations/:station/files/:file/metadata") - .put(stations::files::metadata::patch::Endpoint {}.into_handler()); + .put(stations::files::metadata::put::Endpoint {}.into_handler()); app .at("/stations/:station/files/:file/order/swap") diff --git a/rs/packages/api/src/routes/stations/files/metadata.rs b/rs/packages/api/src/routes/stations/files/metadata.rs index e75d1992..6f725ee4 100644 --- a/rs/packages/api/src/routes/stations/files/metadata.rs +++ b/rs/packages/api/src/routes/stations/files/metadata.rs @@ -9,7 +9,7 @@ use mongodb::bson::doc; use prex::Request; use serde::{Deserialize, Serialize}; -pub mod patch { +pub mod put { use db::run_transaction; use prex::request::ReadBodyJsonError; @@ -23,7 +23,7 @@ pub mod patch { #[derive(Debug, Default, Serialize, Deserialize, PartialEq, Eq, Clone, TS)] #[ts( export, - export_to = "../../../defs/api/stations/[station]/files/[file]/metadata/PATCH/" + export_to = "../../../defs/api/stations/[station]/files/[file]/metadata/PUT/" )] #[serde(rename_all = "snake_case")] pub struct Payload { @@ -107,7 +107,7 @@ pub mod patch { #[derive(Debug, Clone, Serialize, Deserialize, TS)] #[ts( export, - export_to = "../../../defs/api/stations/[station]/files/[file]/metadata/PATCH/" + export_to = "../../../defs/api/stations/[station]/files/[file]/metadata/PUT/" )] #[serde(rename_all = "snake_case")] pub struct Output {