mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-28 23:57: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([
|
DB::table('followers')->insert([
|
||||||
'id' => $follower->id,
|
'id' => $follower->id,
|
||||||
'user_id' => $follower->follower_id,
|
'user_id' => $follower->follower_id,
|
||||||
'artist_at' => $follower->user_at,
|
'artist_id' => $follower->user_id,
|
||||||
'created_at' => $follower->created_at,
|
'created_at' => $follower->created_at,
|
||||||
]);
|
]);
|
||||||
} catch (Exception $e) {
|
} 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)
|
if (!$image)
|
||||||
App::abort(404);
|
App::abort(404);
|
||||||
|
|
||||||
|
$response = Response::make('', 200);
|
||||||
$filename = $image->getFile($coverType['id']);
|
$filename = $image->getFile($coverType['id']);
|
||||||
$lastModified = filemtime($filename);
|
|
||||||
|
|
||||||
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $lastModified == $_SERVER['HTTP_IF_MODIFIED_SINCE']) {
|
if (Config::get('app.sendfile')) {
|
||||||
header('HTTP/1.0 304 Not Modified');
|
$response->header('X-Sendfile', $filename);
|
||||||
exit();
|
} else {
|
||||||
|
$response->header('X-Accel-Redirect', $filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Last-Modified: ' . $lastModified);
|
$response->header('Content-Disposition', 'filename="' . $filename . '"');
|
||||||
header('Cache-Control: max-age=' . (60 * 60 * 24 * 7));
|
$response->header('Content-Type', 'image/png');
|
||||||
|
|
||||||
return File::inline($filename, $image->mime, $image->filename);
|
return $response;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue