xml.server.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. /**
  3. * ownCloud - media plugin
  4. *
  5. * @author Robin Appelman
  6. * @copyright 2010 Robin Appelman icewind1991@gmail.com
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  10. * License as published by the Free Software Foundation; either
  11. * version 3 of the License, or any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. OCP\App::checkAppEnabled('media');
  23. require_once(OC::$APPSROOT . '/apps/media/lib_collection.php');
  24. require_once(OC::$APPSROOT . '/apps/media/lib_ampache.php');
  25. $arguments=$_POST;
  26. if(!isset($_POST['action']) and isset($_GET['action'])){
  27. $arguments=$_GET;
  28. }
  29. foreach($arguments as &$argument){
  30. $argument=stripslashes($argument);
  31. }
  32. @ob_clean();
  33. if(isset($arguments['action'])){
  34. OCP\Util::writeLog('media','ampache '.$arguments['action'].' request', OCP\Util::DEBUG);
  35. switch($arguments['action']){
  36. case 'songs':
  37. OC_MEDIA_AMPACHE::songs($arguments);
  38. break;
  39. case 'url_to_song':
  40. OC_MEDIA_AMPACHE::url_to_song($arguments);
  41. break;
  42. case 'play':
  43. OC_MEDIA_AMPACHE::play($arguments);
  44. break;
  45. case 'handshake':
  46. OC_MEDIA_AMPACHE::handshake($arguments);
  47. break;
  48. case 'ping':
  49. OC_MEDIA_AMPACHE::ping($arguments);
  50. break;
  51. case 'artists':
  52. OC_MEDIA_AMPACHE::artists($arguments);
  53. break;
  54. case 'artist_songs':
  55. OC_MEDIA_AMPACHE::artist_songs($arguments);
  56. break;
  57. case 'artist_albums':
  58. OC_MEDIA_AMPACHE::artist_albums($arguments);
  59. break;
  60. case 'albums':
  61. OC_MEDIA_AMPACHE::albums($arguments);
  62. break;
  63. case 'album_songs':
  64. OC_MEDIA_AMPACHE::album_songs($arguments);
  65. break;
  66. case 'search_songs':
  67. OC_MEDIA_AMPACHE::search_songs($arguments);
  68. break;
  69. case 'song':
  70. OC_MEDIA_AMPACHE::song($arguments);
  71. break;
  72. }
  73. }
  74. ?>