1
0
mirror of https://github.com/devfake/flox.git synced 2024-11-14 22:22:39 +01:00

sync scout in settings

This commit is contained in:
devfake 2016-10-19 11:19:34 +02:00
parent 16051a0b17
commit 62c94dd740
7 changed files with 70 additions and 52 deletions

View File

@ -89,11 +89,6 @@ You can also set options to display release date and/or genre of your own movie
* Give `backend/storage`, `public/assets` and `public/exports` recursive write access.
### Todo
* Settings
* Sync scout driver
### Further Development
* Multi User

View File

@ -20,6 +20,7 @@
try {
$this->info('TRYING TO SYNC YOUR MOVIES TO ' . strtoupper($scoutDriver));
$this->call('scout:flush', ['model' => 'App\\Item']);
$this->call('scout:import', ['model' => 'App\\Item']);
$this->info('SYNCHRONIZATION COMPLETED');
} catch(\Exception $e) {

View File

@ -4,6 +4,8 @@ namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Laravel\Scout\Console\FlushCommand;
use Laravel\Scout\Console\ImportCommand;
class Kernel extends ConsoleKernel
{
@ -16,6 +18,8 @@ class Kernel extends ConsoleKernel
Commands\Init::class,
Commands\DB::class,
Commands\Sync::class,
ImportCommand::class,
FlushCommand::class,
];
/**

View File

@ -7,6 +7,7 @@
use App\Services\Storage;
use App\Services\TMDB;
use App\Setting;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Input;
@ -88,6 +89,14 @@
}
}
/**
* Sync Flox with laravel scout driver in settings.
*/
public function syncScout()
{
Artisan::call('flox:sync');
}
/**
* Return user settings for frontend.
*

87
backend/composer.lock generated
View File

@ -214,16 +214,16 @@
},
{
"name": "guzzlehttp/guzzle",
"version": "6.2.1",
"version": "6.2.2",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "3f808fba627f2c5b69e2501217bf31af349c1427"
"reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/3f808fba627f2c5b69e2501217bf31af349c1427",
"reference": "3f808fba627f2c5b69e2501217bf31af349c1427",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/ebf29dee597f02f09f4d5bbecc68230ea9b08f60",
"reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60",
"shasum": ""
},
"require": {
@ -272,7 +272,7 @@
"rest",
"web service"
],
"time": "2016-07-15 17:22:37"
"time": "2016-10-08 15:01:37"
},
{
"name": "guzzlehttp/promises",
@ -530,16 +530,16 @@
},
{
"name": "laravel/framework",
"version": "v5.3.16",
"version": "v5.3.19",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "9932861dee0fef30138f9839102fb00ddd6ddce1"
"reference": "f1a5bb417b3e0d1949fe84617eacd1a14d75d7f1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/9932861dee0fef30138f9839102fb00ddd6ddce1",
"reference": "9932861dee0fef30138f9839102fb00ddd6ddce1",
"url": "https://api.github.com/repos/laravel/framework/zipball/f1a5bb417b3e0d1949fe84617eacd1a14d75d7f1",
"reference": "f1a5bb417b3e0d1949fe84617eacd1a14d75d7f1",
"shasum": ""
},
"require": {
@ -621,7 +621,7 @@
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~2.0).",
"symfony/css-selector": "Required to use some of the crawler integration testing tools (3.1.*).",
"symfony/dom-crawler": "Required to use most of the crawler integration testing tools (3.1.*).",
"symfony/psr-http-message-bridge": "Required to psr7 bridging features (0.2.*)."
"symfony/psr-http-message-bridge": "Required to use psr7 bridging features (0.2.*)."
},
"type": "library",
"extra": {
@ -654,20 +654,20 @@
"framework",
"laravel"
],
"time": "2016-10-04 16:05:47"
"time": "2016-10-17 19:35:14"
},
{
"name": "laravel/scout",
"version": "v1.1.5",
"version": "v1.1.8",
"source": {
"type": "git",
"url": "https://github.com/laravel/scout.git",
"reference": "e8209540a39ab19c3e5849ab7b7bf57b4a1454a6"
"reference": "31e07d8734d0b0c9d7311d762cef9b9f39840251"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/scout/zipball/e8209540a39ab19c3e5849ab7b7bf57b4a1454a6",
"reference": "e8209540a39ab19c3e5849ab7b7bf57b4a1454a6",
"url": "https://api.github.com/repos/laravel/scout/zipball/31e07d8734d0b0c9d7311d762cef9b9f39840251",
"reference": "31e07d8734d0b0c9d7311d762cef9b9f39840251",
"shasum": ""
},
"require": {
@ -717,24 +717,24 @@
"laravel",
"search"
],
"time": "2016-09-27 13:41:14"
"time": "2016-10-17 21:22:21"
},
{
"name": "league/flysystem",
"version": "1.0.27",
"version": "1.0.30",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "50e2045ed70a7e75a5e30bc3662904f3b67af8a9"
"reference": "75138bb14160f3ba963750aa95e08d1d394fb198"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/50e2045ed70a7e75a5e30bc3662904f3b67af8a9",
"reference": "50e2045ed70a7e75a5e30bc3662904f3b67af8a9",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/75138bb14160f3ba963750aa95e08d1d394fb198",
"reference": "75138bb14160f3ba963750aa95e08d1d394fb198",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
"php": ">=5.5.9"
},
"conflict": {
"league/flysystem-sftp": "<1.0.6"
@ -800,7 +800,7 @@
"sftp",
"storage"
],
"time": "2016-08-10 08:55:11"
"time": "2016-10-18 16:20:02"
},
{
"name": "monolog/monolog",
@ -1024,16 +1024,16 @@
},
{
"name": "paragonie/random_compat",
"version": "v2.0.2",
"version": "v2.0.3",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
"reference": "088c04e2f261c33bed6ca5245491cfca69195ccf"
"reference": "c0125896dbb151380ab47e96c621741e79623beb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/088c04e2f261c33bed6ca5245491cfca69195ccf",
"reference": "088c04e2f261c33bed6ca5245491cfca69195ccf",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/c0125896dbb151380ab47e96c621741e79623beb",
"reference": "c0125896dbb151380ab47e96c621741e79623beb",
"shasum": ""
},
"require": {
@ -1068,7 +1068,7 @@
"pseudorandom",
"random"
],
"time": "2016-04-03 06:00:07"
"time": "2016-10-17 15:23:22"
},
{
"name": "psr/http-message",
@ -1122,16 +1122,16 @@
},
{
"name": "psr/log",
"version": "1.0.1",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "5277094ed527a1c4477177d102fe4c53551953e0"
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/5277094ed527a1c4477177d102fe4c53551953e0",
"reference": "5277094ed527a1c4477177d102fe4c53551953e0",
"url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"shasum": ""
},
"require": {
@ -1165,7 +1165,7 @@
"psr",
"psr-3"
],
"time": "2016-09-19 16:02:08"
"time": "2016-10-10 12:19:37"
},
{
"name": "psy/psysh",
@ -2912,16 +2912,16 @@
},
{
"name": "phpunit/phpunit",
"version": "5.5.6",
"version": "5.6.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "146e0fe0bb7f44d1cefade0c93e86fe0b206dd79"
"reference": "60c32c5b5e79c2248001efa2560f831da11cc2d7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/146e0fe0bb7f44d1cefade0c93e86fe0b206dd79",
"reference": "146e0fe0bb7f44d1cefade0c93e86fe0b206dd79",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/60c32c5b5e79c2248001efa2560f831da11cc2d7",
"reference": "60c32c5b5e79c2248001efa2560f831da11cc2d7",
"shasum": ""
},
"require": {
@ -2955,7 +2955,6 @@
"ext-pdo": "*"
},
"suggest": {
"ext-tidy": "*",
"ext-xdebug": "*",
"phpunit/php-invoker": "~1.1"
},
@ -2965,7 +2964,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "5.5.x-dev"
"dev-master": "5.6.x-dev"
}
},
"autoload": {
@ -2991,20 +2990,20 @@
"testing",
"xunit"
],
"time": "2016-10-03 07:48:45"
"time": "2016-10-07 13:03:26"
},
{
"name": "phpunit/phpunit-mock-objects",
"version": "3.3.1",
"version": "3.4.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "03500345483e1e17b52e2e4d34a89c9408ab2902"
"reference": "238d7a2723bce689c79eeac9c7d5e1d623bb9dc2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/03500345483e1e17b52e2e4d34a89c9408ab2902",
"reference": "03500345483e1e17b52e2e4d34a89c9408ab2902",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/238d7a2723bce689c79eeac9c7d5e1d623bb9dc2",
"reference": "238d7a2723bce689c79eeac9c7d5e1d623bb9dc2",
"shasum": ""
},
"require": {
@ -3050,7 +3049,7 @@
"mock",
"xunit"
],
"time": "2016-10-04 11:03:26"
"time": "2016-10-09 07:01:45"
},
{
"name": "sebastian/code-unit-reverse-lookup",

View File

@ -17,6 +17,7 @@
Route::get('/export', 'SettingController@export');
Route::post('/import', 'SettingController@import');
Route::get('/sync-scout', 'SettingController@syncScout');
Route::get('/update-genre', 'SettingController@updateGenre');
Route::patch('/settings', 'SettingController@changeSettings');

View File

@ -13,7 +13,7 @@
</div>
<div class="settings-box">
<span class="nothing-found">Export / Import</span>
<a :href="exportLink" class="export-btn">Export movies</a>
<a :href="exportLink" class="export-btn">Export Movies</a>
<form class="login-form" @submit.prevent="importMovies()">
<span class="import-info">OR</span>
<input type="file" @change="upload" class="file-btn" required>
@ -23,7 +23,9 @@
</div>
<div class="settings-box">
<span class="nothing-found">Misc</span>
<button @click="updateGenre()" class="export-btn">Update genre</button>
<button @click="updateGenre()" class="export-btn">Update Genre</button>
<span class="import-info">OR</span>
<button @click="syncScout()" class="export-btn">Sync Laravel Scout</button>
<span class="import-info">OR</span>
<div class="checkbox">
<input type="checkbox" value="genre" v-model="displayGenre" id="genre" @change="updateSettings"><label for="genre">Display Genre</label>
@ -132,7 +134,14 @@
this.SET_LOADING(true);
this.$http.get(`${config.api}/update-genre`).then(value => {
console.log(value);
this.SET_LOADING(false);
});
},
syncScout() {
this.SET_LOADING(true);
this.$http.get(`${config.api}/sync-scout`).then(value => {
this.SET_LOADING(false);
});
},