show file size of archived courses when unarchiving#3047
Conversation
|
This now has a few styling changes too, in separate commits. |
drgrice1
left a comment
There was a problem hiding this comment.
I think it would be better to just update the listArchivedCourses method (instead of adding the statArchivedCourses method), and use the same format for showing archive files in the UI in the two places that is done (and the only two places where the listArchivedCourses method is used before this pull request). The two places are when unarchiving courses and on the main course admin page that lists courses and archived courses.
|
Part of the reason that I suggest just updating the If the two methods were combined much of that inefficiency and code clutter could be cleaned up. You just have to update lines 68-70 of Actually, I have put in a pull request to this branch that does the things I have mentioned. |
The `listArchiveCourses` also stats the archive files found and returns the files as a hash whose keys are the course ids and the values are references to hashes containing the `filename` (the basename of the file including the `.tar.gz` extension) and file `size` Both of the places that use the `listArchiveCourses` method are updated to use this return value.
Combine the `listArchiveCourses` and `statArchiveCourses` methods.
drgrice1
left a comment
There was a problem hiding this comment.
There are a few changes to the latest additions needed.
15c4542 to
298e24b
Compare
|
Thanks for those notes. I applied them and squashed them in with the commit that moved to using the tarball's top folder. |
When at the Unarchive courses page, the list of courses now leaves off the ".tar.gz" and includes the size of the file to be unarchived. This will help me identify inefficiencies with how RS users are handling their courses. If I am about to unarchive a particularly large course, I will then go into it and see what can be trimmed. Usually, the faculty have put course archive files in their course. Or they are using images inefficiently. Or they copied entire folder trees for backup before editing local pg files.
I did this in a way to make it extensible. Perhaps there would be interest in also showing the date the archive file was last modified. Perhaps this is of tangential interest to @drdrew42 with #3043 in that the displayed course name could be the actual internal course name, not the file name with
.tar.gztruncated off.