Skip to content

Commit

Permalink
Fix TV shows lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIII committed Mar 5, 2018
1 parent eb2b160 commit d40425b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 121 deletions.
113 changes: 0 additions & 113 deletions Blacklight/config/ircscraper_settings_example.php

This file was deleted.

3 changes: 2 additions & 1 deletion Blacklight/processing/Videos.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ protected function getLocalZoneFromVideoID($videoID): string
*/
protected function getVideoIDFromSiteID($siteColumn, $siteID)
{
$result = null;
if (\in_array($siteColumn, self::$sites, false)) {
$result = Video::query()->where($siteColumn, '=', $siteID)->first(['id']);
$result = Video::query()->where($siteColumn, $siteID)->first(['id']);
}

return $result !== null ? $result->id : false;
Expand Down
8 changes: 4 additions & 4 deletions Blacklight/processing/tv/TV.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,14 @@ public function add(array $show = []): int
if ($show[$column] > 0) {
$videoId = $this->getVideoIDFromSiteID($column, $show[$column]);
}
if ($videoId !== null) {
if ($videoId !== false) {
break;
}
}

if ($videoId === null) {
if ($videoId === false) {
// Insert the Show
$videoId = Video::create(
$videoId = Video::query()->insertGetId(
[
'type' => $show['type'],
'title' => $show['title'],
Expand All @@ -241,7 +241,7 @@ public function add(array $show = []): int
'imdb' => $show['imdb'],
'tmdb' => $show['tmdb'],
]
)->id;
);
// Insert the supplementary show info
TvInfo::query()
->insert(
Expand Down
8 changes: 5 additions & 3 deletions Blacklight/processing/tv/TVMaze.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ class TVMaze extends TV
public $posterUrl;

/**
* Construct. Instantiate TVMaze Client Class.
* TVMaze constructor.
*
* @param array $options Class instances.
* @param array $options
*
* @throws \Exception
*/
public function __construct(array $options = [])
{
Expand Down Expand Up @@ -263,7 +265,7 @@ protected function getShowInfo($cleanName)
*
* @return array|bool
*/
private function matchShowInfo($shows, $cleanName)
private function matchShowInfo(array $shows, $cleanName)
{
$return = false;
$highestMatch = 0;
Expand Down
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
2018-03-05 DariusIII
* Fix: Fix TV shows lookups
* Chg: Add irc server setting to env.example file
* Chg: Update ssl and irc settings handling
* Chg: Update config settings handling
Expand Down

0 comments on commit d40425b

Please sign in to comment.