FreeMusicNinja / api.freemusic.ninja

Django-powered API for Free Music Ninja
http://api.freemusic.ninja/
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

Query Free Music Archive for track data #36

Closed macro1 closed 9 years ago

macro1 commented 9 years ago

This adds a new app, fma, to store queried data from the FMA API. I did not work on migrating FMAArtist from artists, I opted to make a duplicate Artist model in fma for now. I did add the FMAArtist admin page though, and added a list action for kicking off the track query from that perspective. It will only query for artists that have not been modified in a week.

If we're fine with this new layout for storing the data, we can work on migrating the existing FMA data into the new app, and decide on how we're going to update and back-fill the album and track data. I think there may be some additional fields we could take advantage of in the query as well.

I'm not capturing all of the data. I'm thinking of adding them as part of this PR. Here is an example of a single track's data:

{  
  "track_id":"11773",
  "track_title":"05 Too Complex Instrumental     {6th Sense & The Kid Daytona}.mp3",
  "track_url":"http:\/\/freemusicarchive.org\/music\/6th_Sense\/Its_A_6th_Sense_Beat_Yo\/05_Too_Complex_Instrumental_____6th_Sense_amp_The_Kid_Daytonamp3",
  "track_image_file":"http:\/\/freemusicarchive.org\/file\/images\/tracks\/6th_Sense_-_05_-_05_Too_Complex_Instrumental_____6th_Sense__The_Kid_Daytonamp3_-_20120713140037047.jpg",
  "artist_id":"3089",
  "artist_name":"6th Sense",
  "artist_url":"http:\/\/freemusicarchive.org\/music\/6th_Sense\/",
  "artist_website":"http:\/\/notherground.blogspot.com",
  "album_id":"2898",
  "album_title":"It's A 6th Sense Beat Yo!!",
  "album_url":"http:\/\/freemusicarchive.org\/music\/6th_Sense\/Its_A_6th_Sense_Beat_Yo\/",
  "license_title":"Attribution-NonCommercial 3.0 International",
  "license_url":"http:\/\/creativecommons.org\/licenses\/by-nc\/3.0\/",
  "track_language_code":"en",
  "track_duration":"01:51",
  "track_number":"5",
  "track_disc_number":"1",
  "track_explicit":null,
  "track_explicit_notes":null,
  "track_copyright_c":null,
  "track_copyright_p":null,
  "track_composer":null,
  "track_lyricist":null,
  "track_publisher":null,
  "track_instrumental":"1",
  "track_information":null,
  "track_date_recorded":null,
  "track_comments":"0",
  "track_favorites":"31",
  "track_listens":"27513",
  "track_interest":"35034",
  "track_bit_rate":"192000",
  "track_date_created":"4\/30\/2009 10:10:21 AM",
  "track_file":"music\/Notherground_Music\/6th_Sense\/Its_A_6th_Sense_Beat_Yo\/6th_Sense_-_05_-_05_Too_Complex_Instrumental_____6th_Sense__The_Kid_Daytona.mp3",
  "license_image_file":"http:\/\/i.creativecommons.org\/l\/by-nc\/3.0\/88x31.png",
  "license_image_file_large":"http:\/\/fma-files.s3.amazonaws.com\/resources\/img\/licenses\/by-nc.png",
  "license_parent_id":null,
  "tags":[  ],
  "track_genres":[  
    {  
      "genre_id":"21",
      "genre_title":"Hip-Hop",
      "genre_url":"http:\/\/freemusicarchive.org\/genre\/Hip-Hop\/"
    }
  ]
}
treyhunner commented 9 years ago

Should we trigger an Artist model instance to be created whenever an FMA Artist is created?

treyhunner commented 9 years ago

I can try to make a data migration to move the old FMAArtist data into the new fma Artist model. Then we could migrate the fixture data and delete the old model.

macro1 commented 9 years ago

Probably create a artists.Hyperlink on new fma.Artist. We can create a new artists.Artist as part of saving Hyperlinks. I think I did this with the bandcamp app as well.