Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow adding local files #45

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

trickypr
Copy link

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

@steeelydan
Copy link
Owner

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 steeelydan self-assigned this Dec 11, 2023
@steeelydan steeelydan added the enhancement New feature or request label Dec 11, 2023
@trickypr
Copy link
Author

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

@steeelydan
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants