Opened 10 years ago

Closed 7 years ago

Last modified 7 years ago

#915 closed enhancement (fixed)

Add collection option to 'addmedia' cli uploading

Reported by: Stéphane Péchard Owned by:
Priority: minor Milestone:
Component: programming Keywords: test
Cc: Parent Tickets:

Description

Add a collection option to 'addmedia' command line uploading functionnality. Specify the collection with its slug.

Use like this:

gmg addmedia user file.jpg -c collection-slug

Here's the patch

This is my first contribution, please tell me what I did wrong :-)

Change History (8)

comment:1 by Stéphane Péchard, 10 years ago

Status: newreview

comment:2 by Stéphane Péchard, 10 years ago

now that I think about it, I should have check the collection before using it in add_media_to_collection()...

comment:3 by Christopher Allan Webber, 10 years ago

Owner: set to Stéphane Péchard
Status: reviewin_progress

This looks pretty nice generally, but:

  • One problem with it is that it only takes the collection slug... collections are not unique on slugs, but rather on creator + slug. Maybe making it so that it matches the user uploading plus the slug will be good enough?
  • I think you're right, checking that the collection first is a good idea.

I'm not sure what happens when you add media that's not processed yet to a collection, but I see no reason that the mediagoblin machinery shouldn't be smart enough to handle it, so that should be fine I think...

Anyway, if you could address the above two points, I think this would be mergable (though I haven't tested it yet!)

comment:4 by ShawnRisk, 10 years ago

Keywords: test added

comment:5 by Stéphane Péchard, 10 years ago

Owner: Stéphane Péchard removed
Status: in_progressreview

As requested, I've specified the creator of the collection as the uploading user.
Plus, I now check the collection first.

Commit is here: https://gitorious.org/mediagoblin/spechards-mediagoblin/commit/e119aed22900b682c7dd2cce979f694282f5dbe5

comment:6 by cpence, 8 years ago

Has there been any progress on this patch? I am migrating a large set of media from Flickr to a new MediaGoblin instance, and would love to be able to both command-line-upload my media and organize it into the same collections into which it was sorted originally.

comment:7 by Boris Bobrov, 7 years ago

Resolution: fixed
Status: reviewclosed

Merged

comment:8 by Boris Bobrov, 7 years ago

Merged in f86dafe

Note: See TracTickets for help on using tickets.