Opened 4 years ago

Closed 14 months ago

Last modified 14 months ago

#915 closed enhancement (fixed)

Add collection option to 'addmedia' cli uploading

Reported by: spechard 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 4 years ago by spechard

  • Status changed from new to review

comment:2 Changed 4 years ago by spechard

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

comment:3 Changed 4 years ago by cwebber

  • Owner set to spechard
  • Status changed from review to in_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 4 years ago by ShawnRisk

  • Keywords test added

comment:5 Changed 3 years ago by spechard

  • Owner spechard deleted
  • Status changed from in_progress to review

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 22 months ago by cpence

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 14 months ago by breton

  • Resolution set to fixed
  • Status changed from review to closed


comment:8 Changed 14 months ago by breton

Merged in f86dafe

Note: See TracTickets for help on using tickets.