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

Add OCC comand add-photo-to-album #2172

Merged
merged 9 commits into from
Dec 13, 2023
Merged

Conversation

mchugh19
Copy link
Contributor

@mchugh19 mchugh19 commented Dec 4, 2023

Creates a simple CLI for creating an album and adding a photo file to an album.

# occ photos:albums:create xian "Picnic 2023"

# occ photos:albums:create --help
Description:
  Create a new album for a user

Usage:
  photos:albums:create [options] [--] <user> <album>

Arguments:
  user                     User to own album
  album                    Album name

Options:
  -l, --location=LOCATION  Set album location (optional) [default: ""]
# occ photos:albums:add xian "Picnic 2023" "Photos/2023/08/P1010138.JPG"

# occ photos:albums:add --help
Description:
  Add specified photo to album

Usage:
  photos:albums:add <user> <album> <file>

Arguments:
  user                  User owning the album
  album                 Album name
  file                  Path of file to add to the album. It must already be scanned and available in NextCloud. Example: Photos/picture1.jpg

@mchugh19
Copy link
Contributor Author

mchugh19 commented Dec 5, 2023

Not sure what you'd like for the UI. It seems like a couple of commands would be useful from OCC. Right now there's creating an album and adding pictures to it. This covers my main scripting use-cases, but if more features should be exposed to to occ, perhaps it makes sense to define if you'd like them in a single command file vs the multiple I have done here.

lib/Command/AlbumCreateCommand.php Outdated Show resolved Hide resolved
lib/Command/AlbumCreateCommand.php Outdated Show resolved Hide resolved
@artonge
Copy link
Collaborator

artonge commented Dec 5, 2023

The title is also misleading

Copy link
Collaborator

@artonge artonge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, didn't see the other file, the title is not so misleading :)

lib/Command/AlbumAddCommand.php Outdated Show resolved Hide resolved
lib/Command/AlbumAddCommand.php Outdated Show resolved Hide resolved
lib/Command/AlbumAddCommand.php Outdated Show resolved Hide resolved
@mchugh19
Copy link
Contributor Author

mchugh19 commented Dec 5, 2023

I think I've addressed the comments and it's looking alright now.

@mchugh19 mchugh19 requested a review from artonge December 5, 2023 23:16
@artonge
Copy link
Collaborator

artonge commented Dec 6, 2023

Some CI steps are failing.

For php-cs, can you run:

composer run cs:fix

And then commit.

For DCO, can you run:

git rebase HEAD~8 --signoff

And then push.

@mchugh19
Copy link
Contributor Author

mchugh19 commented Dec 6, 2023

Thanks for the instruction, I've never worked in a php environment before.
I think this is done.

@artonge
Copy link
Collaborator

artonge commented Dec 6, 2023

You might have changed too many commits when running the DCO command :/

@mchugh19 mchugh19 force-pushed the occ-albumAdd branch 2 times, most recently from f127386 to 7b9c80e Compare December 6, 2023 19:16
@mchugh19
Copy link
Contributor Author

mchugh19 commented Dec 6, 2023

You might have changed too many commits when running the DCO command :/

Indeed! Alright, Nth time's the charm! DCO seems happy now, so I think this might be getting close.

lib/Album/AlbumMapper.php Outdated Show resolved Hide resolved
@mchugh19 mchugh19 requested a review from artonge December 7, 2023 18:33
Copy link
Collaborator

@artonge artonge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks perfect 👍

mchugh19 and others added 9 commits December 13, 2023 10:52
Signed-off-by: Christian McHugh <mchugh19@hotmail.com>
Signed-off-by: Christian McHugh <mchugh19@hotmail.com>
Signed-off-by: Christian McHugh <mchugh19@hotmail.com>
Signed-off-by: Christian McHugh <mchugh19@hotmail.com>
Co-authored-by: Louis <louis@chmn.me>
Signed-off-by: Christian McHugh <mchugh19@hotmail.com>
Signed-off-by: Christian McHugh <mchugh19@hotmail.com>
Signed-off-by: Christian McHugh <mchugh19@hotmail.com>
Signed-off-by: Christian McHugh <mchugh19@hotmail.com>
Signed-off-by: Christian McHugh <mchugh19@hotmail.com>
@artonge artonge merged commit 42764bc into nextcloud:master Dec 13, 2023
30 checks passed
Copy link
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the reviewing process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR reviewing process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants