Let users delete images, audio and projects from the library

Open
#12 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, node.js

Research direction

Start with the upload and route handlers in server/index.mjs, then read server/library.mjs and the Library and Projects dialog code in web/app.mjs and web/index.html. Run scripts/check.mjs to see the existing API checks. Implement image and project deletion with the requested open-project behavior, then extend the checks; audio listing, deletion, and validation are optional. Done when the required delete flows work and the checks cover the new project route.

Written by the indexing model from the issue text.

Description

enhancement help wanted

Everything is kept forever, and the UI offers no way to clean up:

  • Images. The server already has DELETE /api/library/:id, and scripts/check.mjs tests it, but the Library dialog only renders click-to-use tiles. There is no delete control.
  • Projects. There is no delete route at all: /api/projects/:id handles only PUT and GET, and library.mjs has no deleteProject. The Projects dialog can open projects but can't remove or rename them, and autosave creates a new file for every New project click.
  • Audio. Music uploads are written to library/audio/ and never listed or removable. They are also stored without any content check: any bytes sent as audio/mpeg are saved as .mp3, unlike images, which are sniffed in saveImage().

Task:

  1. Add a delete button to each Library tile. Decide what happens to scenes that reference the image, at least by warning when the open project uses it.
  2. Add DELETE /api/projects/:id with deleteProject() in library.mjs (reuse the projectFile id check), plus a delete button in the Projects dialog. Deleting the open project should start a new one.
  3. Optionally list and delete audio, and sniff common audio headers (ID3/MPEG frame, RIFF…WAVE, OggS, ftyp) on upload.
  4. Extend scripts/check.mjs for the new routes.

Where: server/index.mjs:109-119 (upload), server/index.mjs:138-142 (routes); server/library.mjs:49-54, server/library.mjs:56-77; web/app.mjs:493-504 (openLibrary), web/app.mjs:507-516 (openProjects); web/index.html:99-110; scripts/check.mjs:92-101.


Getting started: Node 22, no npm install needed: git clone, npm start, open http://127.0.0.1:4520 in Chrome or Edge, and run npm test and npm run check before the PR. Comment here to claim it. Questions → Discord.

Dominant language
JavaScript
Stars
42
Forks
6
Avg merge
12h 31m
Merged PRs (30d)
3

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from blixvip/GenMotion

All issues in blixvip/GenMotion

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.