1
0
mirror of https://github.com/devfake/flox.git synced 2024-11-15 06:32:34 +01:00

fix settings auth problem

This commit is contained in:
devfake 2016-10-19 09:53:35 +02:00
parent cad5894673
commit 16051a0b17
3 changed files with 5 additions and 4 deletions

View File

@ -102,7 +102,7 @@
$date = $settings ? $settings->show_date : 1;
return [
'username' => Auth::user()->username,
'username' => Auth::check() ? Auth::user()->username : '',
'genre' => $genre,
'date' => $date
];

View File

@ -113,10 +113,10 @@
$items = collect($this->createItems($response));
$allID = $items->pluck('tmdb_id');
// Get all movies from trendig which already in database.
// Get all movies from trendig / upcoming which already in database.
$inDB = Item::whereIn('tmdb_id', $allID)->get()->toArray();
// Remove all inDB movies from trending.
// Remove all inDB movies from trending / upcoming.
$filtered = $items->filter(function($item) use ($inDB) {
return ! in_array($item['tmdb_id'], array_column($inDB, 'tmdb_id'));
});

View File

@ -11,12 +11,13 @@
Route::get('/trending', 'TMDBController@trending');
Route::get('/upcoming', 'TMDBController@upcoming');
Route::get('/settings', 'SettingController@settings');
Route::group(['middleware' => 'auth'], function() {
Route::get('/export', 'SettingController@export');
Route::post('/import', 'SettingController@import');
Route::get('/update-genre', 'SettingController@updateGenre');
Route::get('/settings', 'SettingController@settings');
Route::patch('/settings', 'SettingController@changeSettings');
Route::patch('/userdata', 'UserController@changeUserData');