about summary refs log tree commit diff
path: root/laravel/app/Http/Controllers
diff options
context:
space:
mode:
Diffstat (limited to 'laravel/app/Http/Controllers')
-rw-r--r--laravel/app/Http/Controllers/PlaylistController.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/laravel/app/Http/Controllers/PlaylistController.php b/laravel/app/Http/Controllers/PlaylistController.php
index c055601..96b2dad 100644
--- a/laravel/app/Http/Controllers/PlaylistController.php
+++ b/laravel/app/Http/Controllers/PlaylistController.php
@@ -27,4 +27,9 @@ class PlaylistController extends Controller
         // Do people want to see the favorites playlist when they've added to it, or stay on the song?
         return redirect()->route('playlist.show', [ 'playlist' => $playlistName]);
     }
+    public function m3u($playlistName)
+    {
+        $pl = Playlist::where('name', $playlistName)->firstOrFail();
+        return response($pl->m3u, 200)->header('Content-Type', 'audio/x-mpegurl');
+    }
 }