Merged development into master

This commit is contained in:
NelsonLaQuet 2013-09-01 05:45:33 -05:00
commit 97c548d61b
2 changed files with 10 additions and 9 deletions

View file

@ -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());
} }
} }
} }

View file

@ -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;
} }
} }