Search

Categories

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Send mail to the author(s) E-mail

# Saturday, February 28, 2015
( Spotify )

Annoying that some of the album date times are not there:

image_thumb[9]

Some dates are in different formats.. just deal with it in code/use release_date_precision

image_thumb[11]

image_thumb[13]

| | # 
( Spotify )

image_thumb[7]

Very annoying that when I select “She Talk to Angels” above

  • Its the wrong album – I want the original, not the compilation..
    • Shake Your Money Maker (1990)
  • It will get the wrong date for the track (as its a compilation)

First thing to do is to get dates into the list of all Artists albums:
https://developer.spotify.com/web-api/get-several-albums/

Find just Studio Albums

https://developer.spotify.com/web-api/get-artists-albums/

Filter on album_type: album  (so not single or compilation)
Filter out anything with no available markets?
Exclude: "[Collectors Edition]" and "(Collector's Edition)" etc..  Live?.. filter out Remastered?

| | # 
( Spotify )

I gave an internal presentation on this side project.  It was great fun.  Some notes:

https://github.com/djhmateer/githubscratch

source: https://github.com/djhmateer/davesmusic live on: http://dmusic.azurewebsites.net/

image
As a programmer, Bob comes to Dmusic, browses top tracks, and adds his favourite tracks which then get sync'd to his Spotify.

image
As a programmer, Alice comes back to Dmusic, logs in via Spotify, and adds tracks to her playlist via searching

This story isn’t quite working, but as an Admin I can add “Spotify Top Tracks” to the “Top Tracks” page

Some musical highlights:

And from me, the best Abba cover versions of all time!
http://dmusic.azurewebsites.net/Artists/Details/5kcL6tVVEBIgiHkXW9JVWo

| | # 
# Friday, February 20, 2015
( Spotify )

image

image

Firstly get playlist uploading for different users!

Each of these screens has button that says “Add” or “Remove”.. then goes to “My Playlist” which uploads it to Spotify

AJAX

To get a button that doesn’t post, I need some form of Ajax. 

http://bobcravens.com/2009/11/ajax-calls-to-asp-net-mvc-action-methods-using-jquery/

<script src="~/Scripts/jquery-1.10.2.min.js"></script> <script type="text/javascript"> function addTrack(trackId) { $.get('@Url.Action("AddTrack","Home")', { trackId: trackId }, function (data) { $("#message").html(data); }); } </script> <button onclick="addTrack(12345)">Add</button> <div id="message"></div>

And controller:
public string AddTrack(string trackId) { return trackId + " added to my playlist"; }

image
| | # 
# Wednesday, February 11, 2015
( Spotify )

image

Next goal is to have tick boxes and a button that says add albums to my DavesMusic playlist.

http://stackoverflow.com/questions/23639808/mvc-view-viewmodel-httppost-return-value-is-always-null
Modelbinder is not returning my ViewModel back to the HttpPost method on the controller.  Possibly it is because I have class names the same as properties.

http://stackoverflow.com/questions/7986991/mvc3-how-to-bind-multiple-checkboxes-to-1-property-in-viewmodel
No not that – interesting issue.

http://sampathloku.blogspot.co.uk/2012/10/how-to-use-viewmodel-with-aspnet-mvc.html – This is a good post on getting a ViewModel working in MVC.  The issue was I wasn’t displaying and posting back the ViewModel data.

I can use Html.HiddenFor helper to pass back data

http://stackoverflow.com/questions/12078808/how-to-pass-an-entire-viewmodel-back-to-the-controller – someone with the same issue.

http://stackoverflow.com/questions/20063695/viewmodel-not-being-passed-back-to-controller-in-post-method – a detailed explanation including passing back collections.

passback to the ID and checked or not – This worked

| | # 
# Thursday, February 05, 2015
( Git )

git config --global core.autocrlf false

http://stackoverflow.com/questions/17628305/windows-git-warning-lf-will-be-replaced-by-crlf-is-that-warning-tail-backwar

“The warning "LF will be replaced by CRLF" says that you (having autocrlf=true) will lose your unix-style LF after commit-checkout cycle (it will be replaced by windows-style CRLF). Git doesn't expect you to use unix-style LF under windows”

http://stackoverflow.com/a/20653073/5351

So ‘true’  might be better because Git will eventually fix (after commit and then checkout) any files that for some reason end up having LF in them

The down side of it is that we will sometimes get this warning if we’ve got some weird tools that keep putting LFs in

| | # 
( VB.NET )

image
to make method signatures look nice!

| | # 
# Tuesday, February 03, 2015
( msbuild )

msbuild xyz.sln /t:rebuild
msbuild xyz.sln /t:rebuild;clean

| | # 
# Monday, February 02, 2015
( Spotify )

https://github.com/thelinmichael/spotify-web-api-java

Looks very complete (author works at Spotify in Stockholm) http://www.michaelthelin.se/

  • Authentication/Authorisation
  • Async explore

https://github.com/plamere/spotipy (Paul Lamere http://MusicMachinery.com)

Other libraries (including 2 .NET) https://developer.spotify.com/web-api/code-examples/

https://github.com/guilhermesad/rspotify – Ruby.. 297 commits!

| | # 
( Spotify )

image

Great searching

| | #