captn3m0 / muzi-android

The native Android port of Muzi
0 stars 0 forks source link

Requests Structure #4

Open captn3m0 opened 11 years ago

captn3m0 commented 11 years ago

This issue basically describes what requests should be made and when; and whether or not it should be cached.

On Launch Make a background request to /album/list.php and /band/list.php. Both these requests are cached for exactly one day. The cache borderline is 12 'o' clock midnight. So basically, we check the date on the device and compare it against the date of the cache. If its greater, we make a fresh request to both these urls and save them again. If the user browses to Artists or Albums while this request is being made, we show the stale data from cache. When the user browses to Artists/Albums, use the current language filter to decide which rows to show.

Click on an Album

  1. Make a request to /album/?id=ID. Show the tracks and cover art. For track numbers:
  2. Check the track number in the first song. If it is zero, use natural numbering for songs to show as their track numbers. If it is not zero, use the track numbers from the request.
  3. Make a request to the first track in background (/track/?id=1282) and get the year of release and show it, if its not 0.
captn3m0 commented 11 years ago

On search

  1. Check if there are minimum of 3 characters in the search box.
  2. Send a request to /search/?search=TEXT.
  3. Parse the results and show them to the user in 3 tabs
  4. Go to a populated tab only. For instance, if there are no Artist results, go to Albums. If there are no albums as well, go to Track results. If no results were found anywhere, give an alert about it.
  5. Also show the artist+album art on the Tracks tab.
  6. Show the album artist and big album art on the Albums tab.
captn3m0 commented 11 years ago

Top Tracks

  1. Make a request to /track/top.php
  2. Parse and show the title,artist, and album art.

Sample JSON data

captn3m0 commented 11 years ago

Top Albums

  1. Make a request to /album/top.php.
  2. Parse through the results and show the albums
  3. Also show the Album artist

Sample JSON data

shivam-mangla commented 10 years ago

I've just realized that the app is not showing the album art. What's the request structure for the same?

captn3m0 commented 10 years ago

The album art for any track is reached by:

<pics_root>/<albumId>.jpg

For instance, muzi's pic_root is https://cdn.sdslabs.co.in/music_pics/ and the album art for album id 13651 can be reached at https://cdn.sdslabs.co.in/music_pics/13651.jpg

Album art