Skip to content
This repository
Browse code

Add the following new API methods: artist.getCorrection, chart.getHyp…

…edArtists, chart.getHypedTracks, chart.getLovedTracks, chart.getTopArtists, chart.getTopTags, chart.getTopTracks, geo.getMetros, group.getHype, radio.search, tag.getInfo, tasteometer.compareGroup, track.getCorrection, track.getFingerprintMetadata, track.getShouts, track.scrobble, track.unban, track.unlove, track.updateNowPlaying, user.getBannedTracks, user.getPersonalTracks. And fix a small bug. :-)
  • Loading branch information...
commit 0ed41c78ed0fc7e0b21d1c89f5dd1ebf0fff5dc9 1 parent 8be684e
Felix Bruns authored

Showing 1 changed file with 105 additions and 1 deletion. Show diff stats Hide diff stats

  1. +105 1 lastfm.api.js
106 lastfm.api.js
@@ -254,6 +254,10 @@ function LastFM(options){
254 254 signedCall('artist.addTags', params, session, callbacks, 'POST');
255 255 },
256 256
  257 + getCorrection : function(params, callbacks){
  258 + call('artist.getCorrection', params, callbacks);
  259 + },
  260 +
257 261 getEvents : function(params, callbacks){
258 262 call('artist.getEvents', params, callbacks);
259 263 },
@@ -358,6 +362,33 @@ function LastFM(options){
358 362 }
359 363 };
360 364
  365 + /* Chart methods. */
  366 + this.chart = {
  367 + getHypedArtists : function(params, session, callbacks){
  368 + call('chart.getHypedArtists', params, callbacks);
  369 + },
  370 +
  371 + getHypedTracks : function(params, session, callbacks){
  372 + call('chart.getHypedTracks', params, callbacks);
  373 + },
  374 +
  375 + getLovedTracks : function(params, session, callbacks){
  376 + call('chart.getLovedTracks', params, callbacks);
  377 + },
  378 +
  379 + getTopArtists : function(params, session, callbacks){
  380 + call('chart.getTopArtists', params, callbacks);
  381 + },
  382 +
  383 + getTopTags : function(params, session, callbacks){
  384 + call('chart.getTopTags', params, callbacks);
  385 + },
  386 +
  387 + getTopTracks : function(params, session, callbacks){
  388 + call('chart.getTopTracks', params, callbacks);
  389 + }
  390 + };
  391 +
361 392 /* Event methods. */
362 393 this.event = {
363 394 attend : function(params, session, callbacks){
@@ -424,6 +455,10 @@ function LastFM(options){
424 455 call('geo.getMetroWeeklyChartlist', params, callbacks);
425 456 },
426 457
  458 + getMetros : function(params, callbacks){
  459 + call('geo.getMetros', params, callbacks);
  460 + },
  461 +
427 462 getTopArtists : function(params, callbacks){
428 463 call('geo.getTopArtists', params, callbacks);
429 464 },
@@ -435,6 +470,10 @@ function LastFM(options){
435 470
436 471 /* Group methods. */
437 472 this.group = {
  473 + getHype : function(params, callbacks){
  474 + call('group.getHype', params, callbacks);
  475 + },
  476 +
438 477 getMembers : function(params, callbacks){
439 478 call('group.getMembers', params, callbacks);
440 479 },
@@ -444,7 +483,7 @@ function LastFM(options){
444 483 },
445 484
446 485 getWeeklyArtistChart : function(params, callbacks){
447   - call('group.group.getWeeklyArtistChart', params, callbacks);
  486 + call('group.getWeeklyArtistChart', params, callbacks);
448 487 },
449 488
450 489 getWeeklyChartList : function(params, callbacks){
@@ -504,6 +543,10 @@ function LastFM(options){
504 543 signedCall('radio.getPlaylist', params, session, callbacks);
505 544 },
506 545
  546 + search : function(params, session, callbacks){
  547 + signedCall('radio.search', params, session, callbacks);
  548 + },
  549 +
507 550 tune : function(params, session, callbacks){
508 551 signedCall('radio.tune', params, session, callbacks);
509 552 }
@@ -511,6 +554,10 @@ function LastFM(options){
511 554
512 555 /* Tag methods. */
513 556 this.tag = {
  557 + getInfo : function(params, callbacks){
  558 + call('tag.getInfo', params, callbacks);
  559 + },
  560 +
514 561 getSimilar : function(params, callbacks){
515 562 call('tag.getSimilar', params, callbacks);
516 563 },
@@ -548,6 +595,10 @@ function LastFM(options){
548 595 this.tasteometer = {
549 596 compare : function(params, callbacks){
550 597 call('tasteometer.compare', params, callbacks);
  598 + },
  599 +
  600 + compareGroup : function(params, callbacks){
  601 + call('tasteometer.compareGroup', params, callbacks);
551 602 }
552 603 };
553 604
@@ -565,10 +616,22 @@ function LastFM(options){
565 616 call('track.getBuylinks', params, callbacks);
566 617 },
567 618
  619 + getCorrection : function(params, callbacks){
  620 + call('track.getCorrection', params, callbacks);
  621 + },
  622 +
  623 + getFingerprintMetadata : function(params, callbacks){
  624 + call('track.getFingerprintMetadata', params, callbacks);
  625 + },
  626 +
568 627 getInfo : function(params, callbacks){
569 628 call('track.getInfo', params, callbacks);
570 629 },
571 630
  631 + getShouts : function(params, callbacks){
  632 + call('track.getShouts', params, callbacks);
  633 + },
  634 +
572 635 getSimilar : function(params, callbacks){
573 636 call('track.getSimilar', params, callbacks);
574 637 },
@@ -593,6 +656,23 @@ function LastFM(options){
593 656 signedCall('track.removeTag', params, session, callbacks, 'POST');
594 657 },
595 658
  659 + scrobble : function(params, callbacks){
  660 + /* Flatten an array of multiple tracks into an object with "array notation". */
  661 + if(params.constructor.toString().indexOf("Array") != -1){
  662 + var p = {};
  663 +
  664 + for(i in params){
  665 + for(j in params[i]){
  666 + p[j + '[' + i + ']'] = params[i][j];
  667 + }
  668 + }
  669 +
  670 + params = p;
  671 + }
  672 +
  673 + signedCall('track.scrobble', params, session, callbacks, 'POST');
  674 + },
  675 +
596 676 search : function(params, callbacks){
597 677 call('track.search', params, callbacks);
598 678 },
@@ -604,6 +684,18 @@ function LastFM(options){
604 684 }
605 685
606 686 signedCall('track.share', params, session, callbacks, 'POST');
  687 + },
  688 +
  689 + unban : function(params, session, callbacks){
  690 + signedCall('track.unban', params, session, callbacks, 'POST');
  691 + },
  692 +
  693 + unlove : function(params, session, callbacks){
  694 + signedCall('track.unlove', params, session, callbacks, 'POST');
  695 + },
  696 +
  697 + updateNowPlaying : function(params, session, callbacks){
  698 + signedCall('track.updateNowPlaying', params, session, callbacks, 'POST');
607 699 }
608 700 };
609 701
@@ -613,6 +705,10 @@ function LastFM(options){
613 705 call('user.getArtistTracks', params, callbacks);
614 706 },
615 707
  708 + getBannedTracks : function(params, callbacks){
  709 + call('user.getBannedTracks', params, callbacks);
  710 + },
  711 +
616 712 getEvents : function(params, callbacks){
617 713 call('user.getEvents', params, callbacks);
618 714 },
@@ -633,10 +729,18 @@ function LastFM(options){
633 729 call('user.getNeighbours', params, callbacks);
634 730 },
635 731
  732 + getNewReleases : function(params, callbacks){
  733 + call('user.getNewReleases', params, callbacks);
  734 + },
  735 +
636 736 getPastEvents : function(params, callbacks){
637 737 call('user.getPastEvents', params, callbacks);
638 738 },
639 739
  740 + getPersonalTracks : function(params, callbacks){
  741 + call('user.getPersonalTracks', params, callbacks);
  742 + },
  743 +
640 744 getPlaylists : function(params, callbacks){
641 745 call('user.getPlaylists', params, callbacks);
642 746 },

0 comments on commit 0ed41c7

Please sign in to comment.
Something went wrong with that request. Please try again.