Opened 3 years ago

Closed 5 months ago

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

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 :-)

Subtickets

Change History (8)

comment:1 Changed 3 years ago by spechard

  • Status changed from new to review

comment:2 Changed 3 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 3 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 3 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: https://gitorious.org/mediagoblin/spechards-mediagoblin/commit/e119aed22900b682c7dd2cce979f694282f5dbe5

comment:6 Changed 13 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 5 months ago by breton

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

Merged

comment:8 Changed 5 months ago by breton

Merged in f86dafe

Note: See TracTickets for help on using tickets.