mirror of
https://github.com/koel/koel
synced 2024-12-11 05:02:27 +00:00
24 lines
588 B
PHP
24 lines
588 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API;
|
|
|
|
use App\Models\Song;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\Request;
|
|
|
|
class ScrobbleController extends Controller
|
|
{
|
|
/**
|
|
* Create a Last.fm scrobble entry for a song.
|
|
*
|
|
* @param Request $request
|
|
* @param Song $song
|
|
* @param string $timestamp The UNIX timestamp when the song started playing.
|
|
*
|
|
* @return JsonResponse
|
|
*/
|
|
public function store(Request $request, Song $song, $timestamp)
|
|
{
|
|
return response()->json($song->scrobble($request->user(), $timestamp));
|
|
}
|
|
}
|