1
0
mirror of https://github.com/devfake/flox.git synced 2024-11-16 07:02:31 +01:00
flox/backend/app/Services/FileParser.php
devfake c901232f16 start file parser
migrations

swap sqlite file with memory

set and update alternative titles

simplify alternative titles

change request limit handling

move limitRemaining to method
2017-02-13 21:17:25 +01:00

32 lines
609 B
PHP

<?php
namespace App\Services;
use App\Item;
class FileParser {
protected $response;
public function __construct()
{
$this->response = $this->parseMediaFiles();
$this->item = new Item();
}
public function parseMediaFiles()
{
return file_get_contents(base_path('tests/fixtures/media_files.json'));
}
public function getTmdbId($title)
{
$item = $this->item->where('title', $title)->orWhere('original_title', $title)->first(['id', 'tmdb_id']);
if( ! $item) {
return null;
}
return $item->tmdb_id;
}
}