sync-party
sync-party copied to clipboard
Allow adding local files
This allows manually adding files to the webUI if they are already in the uploads/ folder. E.g. If you use scp to copy the file to your vps.
For example, if I uploaded spring.webm, I would add it via
npm run cli add-file spring.webm "Spring (Blender, vp9)" trickypr
Hi, good idea. I have tested your feature and it works.
I would suggest the following changes:
- Rename the file with the ID as prefix, following the present convention
- Give the user a feedback that
- The file was added successfully
- The file was renamed to
(new name)
- I'd prefer
add-file <FILE_NAME> <TITLE> <OWNER_USERNAME>in the readme
I noticed that you're working on a Docker setup for Sync Party, very nice :)
Sorry for the log wait. That should fix all of your concerns.
Hey, thanks & sorry on my side for the long delay!
At the moment the file naming logic is too brittle for my taste. Let's say you do
npm run cli add-file ./music.mp3 "Some Music" myUser. In this case it adds the "./" into the filename, which is wrong and crashes the app afterwards. I'd suggest using path.basename(myPath).
Apart from that:
- "filePath" was a better name than "url" in my opinion. I acknowledge that my own naming is bad here, though ;)
- We have to make clear in the README that the file has to be placed in /data/uploads.
- Some nitpicking: In
operations.ts, please sort the imports in a way that types come last.