Adding size of file to the DL link

Bug #255233 reported by Richard H.
4
Affects Status Importance Assigned to Milestone
Document Library
Fix Released
Wishlist
Unassigned

Bug Description

A wishlist item for the future; we might wish to add the size of the file to the list of metadata/properties that appear within a generated DL link.

File sizes can be important depending on the speed of your connection to the Internet, and knowing that you're downloading a large or a small file could be worth knowing before you click on the download.

Of course, the problem is that we offer up to three different versions of the download, so we'd have to think carefully about how we could do this in regards to the DL link layout.

Tags: augment
Revision history for this message
Martijn Faassen (faassen) wrote :

This now works. The following has been done:

* hurry.file has been extended so that the file size can be retrieved (both when tramline isn't used and when it is). This was released as hurry.file here:

http://pypi.python.org/pypi/hurry.file/

* the OAI-PMH protocol in the Document LIbrary has been extended so that a 'size' attribute is now available on the elements that specify the docuwnload URLs. This is an attribute in bytes.

* A small package was created for transforming a number of bytes into a human-readable file size:

http://pypi.python.org/pypi/hurry.filesize/0.9

* the DL integration for Silva was extended so that it reads filesize information and reports it.

In order to make this work on the Silva side, a complete reharvest is needed of the information in the DL so that the filesize information is picked up.

Kit Blake (kitblake)
tags: added: augment
Kit Blake (kitblake)
Changed in documentlibrary:
status: New → Fix Committed
Revision history for this message
Richard H. (richard-hewison) wrote :

It looks as if there is a double space between the text that describes the file type text and the filesize on a DL link, e.g.

pdf (175K)

I think it would look better with just one space and can the 'K' be lower case instead, e.g.

pdf (175k)

I've not seen a larger filesize yet, but if it isn't already, 'Mb' would be the preferred label, e.g.

pdf (1.1Mb)

Revision history for this message
Richard H. (richard-hewison) wrote :

I think the extra space is a styling issue, as the unstyled link does not include double spacing between the file type text and the filesize information.

Revision history for this message
Richard H. (richard-hewison) wrote :

To remain consistent, I think we should use the following conventions when displaying filesizes in DL links:

Kb
Mb
Gb

e.g. 175Kb
e.g. 1Mb
e.g. 1.1Gb (I doubt we'll ever see this one in use!!)

Kit Blake (kitblake)
Changed in documentlibrary:
status: Fix Committed → Confirmed
Revision history for this message
Sylvain Viollon (thefunny) wrote :

I fixed it in the SVN.

Changed in documentlibrary:
status: Confirmed → Fix Committed
Changed in documentlibrary:
importance: Undecided → Wishlist
Kit Blake (kitblake)
Changed in documentlibrary:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.