Earlopain / FoxTrove

E6 Upload Helper
GNU General Public License v3.0
6 stars 3 forks source link

Opinion on adding file mime type to the stats? #122

Closed Tarrgon closed 5 months ago

Tarrgon commented 5 months ago

On my local clone, I've added the mime type to show after the size, which I found to be very helpful in determining which duplicate to add to my backlog.

lekxph_18634 1

I was wondering if this would be worth adding directly to the app.

<div class="submission-file-stats">
  <%= site_icon artist_url %>
  <%= "#{submission_file.width}x#{submission_file.height}" %>, 
  <%= number_to_human_size submission_file.size %>, 
  <%= "#{submission_file.content_type.split('/', 2)[1]}" %>
</div>

Forgive me if this is some wildly inefficient way of doing this, ruby is not my best language.

faucetlol commented 5 months ago

I usually just mouseover the direct link to see the filename, but showing the MIME type probably isn't a bad thing. Especially since FA filenames frequently lie.

Tarrgon commented 5 months ago

Yeah I suppose I could do that, this just happened to save more time lol

Earlopain commented 5 months ago

Sounds fine to do. You can Marcel::TYPE_EXTS[content_type].first to get the extension which in theory also works for something like application/x-shockwave-flash and also gives the more familiar jpg. That's private API but whatever, existing tests should be good enough. Doing upcase might look better since everything else there already is as well

Tarrgon commented 5 months ago

Opened #123