I'll put it on my list.  Not going to worry about it too much for now,
though.


On Mon, May 6, 2013 at 1:19 AM, Shad Laws <notifications@github.com> wrote:

> In modules/gallery/classes/Gallery/Controller/Items.php:
>
> > +
> > +    // Find the item by its URL, check access, and increment the view count.
> > +    $item_url = $this->request->param("item_url");
> > +    if (empty($item_url)) {
> > +      $item = Item::root();
> > +    } else {
> > +      $item = Item::find_by_relative_url($item_url);
> > +      if (!$item->loaded()) {
> > +        throw HTTP_Exception::factory(404);
> > +      }
> > +    }
> > +    Access::required("view", $item);
> > +    $item->increment_view_count();
> > +
> > +    // Build the view.  Photos and movies are nearly identical, but albums are different.
> > +    if ($item->is_album()) {
>
> I agree - it's too long. But I don't think this is specifically because
> it's an album - it's because it's a collection.
>
> In Controller_Search::action_index() and Controller_Tag::action_show(), we
> see that a large block of this code is essentially triplicated. IMHO, we
> should unify all three of these in View_Theme. This would also make contrib
> modules like favorites a bit simpler.
>
> I'm knee deep in forms, dialogs, and routing at the moment and haven't
> really looked into it much more than that... wanna take a stab?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/gallery/gallery3/pull/349/files#r4089933>
> .
>