mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-25 06:27:59 +01:00
Merged development into master
This commit is contained in:
commit
97c548d61b
2 changed files with 10 additions and 9 deletions
|
@ -330,11 +330,11 @@
|
|||
DB::table('followers')->insert([
|
||||
'id' => $follower->id,
|
||||
'user_id' => $follower->follower_id,
|
||||
'artist_at' => $follower->user_at,
|
||||
'artist_id' => $follower->user_id,
|
||||
'created_at' => $follower->created_at,
|
||||
]);
|
||||
} catch (Exception $e) {
|
||||
$this->error('Could not sync follower ' . $fav->id . ' because ' . $e->getMessage());
|
||||
$this->error('Could not sync follower ' . $follower->id . ' because ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,17 +15,18 @@
|
|||
if (!$image)
|
||||
App::abort(404);
|
||||
|
||||
$response = Response::make('', 200);
|
||||
$filename = $image->getFile($coverType['id']);
|
||||
$lastModified = filemtime($filename);
|
||||
|
||||
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $lastModified == $_SERVER['HTTP_IF_MODIFIED_SINCE']) {
|
||||
header('HTTP/1.0 304 Not Modified');
|
||||
exit();
|
||||
if (Config::get('app.sendfile')) {
|
||||
$response->header('X-Sendfile', $filename);
|
||||
} else {
|
||||
$response->header('X-Accel-Redirect', $filename);
|
||||
}
|
||||
|
||||
header('Last-Modified: ' . $lastModified);
|
||||
header('Cache-Control: max-age=' . (60 * 60 * 24 * 7));
|
||||
$response->header('Content-Disposition', 'filename="' . $filename . '"');
|
||||
$response->header('Content-Type', 'image/png');
|
||||
|
||||
return File::inline($filename, $image->mime, $image->filename);
|
||||
return $response;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue