Fixes #201. Per MC discussion, we want Archive pages to match the existing 'Read by' label on our catalog pages:
All types of group projects show 'LibriVox Volunteers', regardless of reader count.
Solo projects show the first reader result returned from the database, or 'Solo' if there are none.
Along with this change, I've refactored get_project_readers and create_project_reader_list into get_solo_reader:
get_project_readers was called only from catalog pages, but only for solo projects, and only to get the first reader result.
create_project_reader_list is no longer needed. It was called only from Iarchive_upload, which should also only need to call it for solo projects.
If you think it would be better to have the group vs solo check be in the model rather than the controllers, we could do that at the cost of a second (but quick) database query. Open to that, or other suggestions!
Fixes #201. Per MC discussion, we want Archive pages to match the existing 'Read by' label on our catalog pages:
Along with this change, I've refactored
get_project_readers
andcreate_project_reader_list
intoget_solo_reader
:get_project_readers
was called only from catalog pages, but only for solo projects, and only to get the first reader result.create_project_reader_list
is no longer needed. It was called only from Iarchive_upload, which should also only need to call it for solo projects.If you think it would be better to have the group vs solo check be in the model rather than the controllers, we could do that at the cost of a second (but quick) database query. Open to that, or other suggestions!