sync-party icon indicating copy to clipboard operation
sync-party copied to clipboard

Allow adding local files

Open trickypr opened this issue 1 year ago • 3 comments

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

trickypr avatar Nov 26 '23 10:11 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 :)

steeelydan avatar Dec 11 '23 16:12 steeelydan

Sorry for the log wait. That should fix all of your concerns.

trickypr avatar Jan 12 '24 04:01 trickypr

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.

steeelydan avatar Feb 19 '24 18:02 steeelydan