prabhjas / chirpradio

Automatically exported from code.google.com/p/chirpradio
0 stars 0 forks source link

Browse entire library alphabetically #144

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As a DJ I to be able to see everything in the library in a browsable list form 
so that I can see what is 
available to play when putting together my show. At present, the "Read more 
reviews..." feature 
accomplishes this to some extent, but there is no rhyme or reason to the way 
the albums are listed.

As music director, I could envision a separate page for each letter of the 
alphabet, sorted by artist 
(ie the A page would have Animal Collective and Appleseed Cast, rather than 
albums that started 
with A), with a row of linked letters (A B C D E F G...) at the top of each 
page, where clicking on a 
given letter would take me to the page for that letter.

Ideally, these list pages would indicate whether there is a review in place for 
a given album, and 
even better, would give the user the option of choosing between seeing all 
results or only albums 
that have been reviewed.

Original issue reported on code.google.com by billyk...@gmail.com on 24 May 2010 at 8:22

GoogleCodeExporter commented 9 years ago

Original comment by kumar.mcmillan on 16 Aug 2010 at 1:26

GoogleCodeExporter commented 9 years ago
Done, except for reviews part. It's not obvious to me how to do that, since GAE 
does not support JOIN operations in queries. Therefore, paging becomes 
problematic when displaying only albums with reviews.

Original comment by jawax...@gmail.com on 24 Aug 2010 at 6:20

GoogleCodeExporter commented 9 years ago
One easy solution would be to add a reviewed field to albums.

Original comment by jawax...@gmail.com on 24 Aug 2010 at 6:21

GoogleCodeExporter commented 9 years ago
Oh duh, that's already there. Nevermind.

Original comment by jawax...@gmail.com on 24 Aug 2010 at 6:23

GoogleCodeExporter commented 9 years ago
Argh. But there is another problem. GAE does not support multiple inequality 
filters on different properties in the same query. Hence, paging is problematic 
for displaying, for example, all reviewed (num_reviews > 0) albums starting 
with the letter D (title >=D and title < D + \uffff). We can choose to display 
all reviewed albums, but then GAE requires that the resulting list be sorted by 
num_reviews (not by title).

Original comment by jawax...@gmail.com on 24 Aug 2010 at 7:25

GoogleCodeExporter commented 9 years ago
you can't just chain them together?
q = filter('num reviews >', 0).filter('title >=', 'D').filter('title <', D + 
\uffff)

Original comment by kumar.mcmillan on 24 Aug 2010 at 8:10

GoogleCodeExporter commented 9 years ago
No, you'll get a BadFilterError exception since GAE does not support inequality 
filters on different properties in the same query. If you need to do that, you 
need to post-process the results of a query. However, this is problematic for 
efficient paging, which relies on single queries. I have been thinking of 
writing a Pager wrapper to deal with the post-processing in a transparent 
manner. So, if you get multiple inequality filters in a single query, run the 
query on the first inequality with the normal Pager. Then post process on the 
other filters. The result may yield less entries than the page size. So loop on 
the original query until you fill up the page. You need to keep track of the 
next page bookmark while doing so. Using this method, you will only be able to 
sort on the first inequality field.

An alternative for this particular issue is to add a boolean property to albums 
"is_reviewed". Then you can add a filter using equality, which is permissible.

Original comment by jawax...@gmail.com on 29 Aug 2010 at 10:49

GoogleCodeExporter commented 9 years ago
Done. Added an is_reviewed field to artists and tracks.

Original comment by jawax...@gmail.com on 5 May 2011 at 7:07