mirror of
https://github.com/devfake/flox.git
synced 2024-11-15 22:52:32 +01:00
c901232f16
migrations swap sqlite file with memory set and update alternative titles simplify alternative titles change request limit handling move limitRemaining to method
32 lines
609 B
PHP
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;
|
|
}
|
|
} |