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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Import from cli #237

Closed
wants to merge 6 commits into from
Closed

WIP Import from cli #237

wants to merge 6 commits into from

Conversation

ildyria
Copy link
Member

@ildyria ildyria commented May 6, 2019

I found this lovely work by @Spotlight0xff 馃槂

@ildyria
Copy link
Member Author

ildyria commented May 6, 2019

I did not test this. @d7415 can you have a look ?

@ildyria ildyria requested a review from d7415 May 6, 2019 15:10
@kamil4
Copy link
Contributor

kamil4 commented May 6, 2019

Yeah, with the work that I'm planning, there should be no need for messing around with owner_id. Imported photos will simply inherit the ownership from the album.

Copy link
Contributor

@d7415 d7415 left a comment

Choose a reason for hiding this comment

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

I have yet to test this. It's a very good start, but I think it needs to (eventually) handle album creation.

The function description makes clear that it flattens everything (although the --flatten option may confuse matters) so I have no real objection to adding it in its current state once we've done some testing.

Going forward my suggestions (in rough order) would be:

  • Create a new album for new photos (still flat)
  • Support top-level albums based on directory names
  • Choose a parent, to optionally create as a subalbum
  • (Optionally) Copy directory structure into album structure.

There are definitely some UI/UX considerations for how to implement the user side of these.

The basics seem to be there though. Good work @Spotlight0xff!

if ($album_title != null) {
$this->line('No album '.$album_title.' found. Try again.');
}
$album_title = $this->ask('album to insert into (title)?');
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're providing a list of IDs with the titles, wouldn't it be easier to ask for the ID? Also potentially less typing, less chance of special characters...

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I don't think that titles need to be unique...

Choose a reason for hiding this comment

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

Definitely! It was more for testing, not meant to be production-ready :)

public function handle()
{
$directory = $this->argument('dir');
$flatten = $this->option('flatten');
Copy link
Contributor

Choose a reason for hiding this comment

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

Good idea, but unused.

@ildyria
Copy link
Member Author

ildyria commented May 6, 2019

I am also thinking if we could not re-use the following : https://github.com/LycheeOrg/Lychee-Laravel/blob/master/app/Http/Controllers/ImportController.php#L168 or so we don't have code duplication.

@Spotlight0xff
Copy link

Hey guys!

Yeah this was written in order to allow me to sync my google photos to the lychee instance.
I wanted a way to just sync all the photos (which are downloaded using timeliner, with subfolders corresponding to the years/months) to a single album.
I don't have experience writing PHP-Laravel code, so the code is definitely not ideal.

Very cool that you found it and consider it to include it somehow though!

@ildyria ildyria changed the title Import from cli WIP Import from cli May 7, 2019
@alex-phillips
Copy link
Contributor

FWIW, I'm working on a standalone CLI for lychee (both API versions supported) that allows uploading, tagging, searching, filtering, etc. of all photos in lychee. I will update the README with more info, but you can find the repo here: https://github.com/alex-phillips/lychee-cli

@ildyria
Copy link
Member Author

ildyria commented May 9, 2019

Niiiice 馃槷

@codecov-io
Copy link

codecov-io commented Dec 27, 2019

Codecov Report

Merging #237 into master will increase coverage by 0.51%.
The diff coverage is n/a.

@ildyria ildyria mentioned this pull request Jan 6, 2020
@ildyria
Copy link
Member Author

ildyria commented Feb 8, 2020

This has been fixed with #427 I believe.

@ildyria ildyria closed this Feb 8, 2020
@ildyria ildyria deleted the import-from-cli branch February 8, 2020 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants