Opened 6 years ago

Closed 4 years ago

Last modified 4 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:


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 Changed 6 years ago by Stéphane Péchard

Status: newreview

comment:2 Changed 6 years ago by Stéphane Péchard

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

comment:3 Changed 6 years ago by Christopher Allan Webber

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 Changed 6 years ago by ShawnRisk

Keywords: test added

comment:5 Changed 6 years ago by Stéphane Péchard

Owner: Stéphane Péchard deleted
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:

comment:6 Changed 4 years ago by C. Pence

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 Changed 4 years ago by Boris Bobrov

Resolution: fixed
Status: reviewclosed


comment:8 Changed 4 years ago by Boris Bobrov

Merged in f86dafe

Note: See TracTickets for help on using tickets.