MTDb - Ultimate Movie&TV Database

MTDb - Ultimate Movie&TV Database v3.2.4 - Patch Update

No permission to download

eeeeeeeee1

New member
Banned User
Jun 3, 2022
0
0
0
Hello everyone. Anyone know how to automatically download an episode? only season and title are imported, no episode is shown, please help :)
 

TheViking

Well-known member
Trusted Uploader
Apr 22, 2019
1,225
793
113
very not friendly big guys, dont be rude friends, please be friend with other new poople.
Not very friendly you say....? How would you react if somebody came into your home without even bothering to say hello before they started to dig in of your goods...?? You would have kicked their sorry ass out of there I'm sure!
 

zombra

New member
Apr 9, 2021
0
0
0
Good afternoon friends.
when I import series ("the good doctor", "game of Thrones", "La Casa de Papel")(MTDB v3.2.4) I get the error SQLSTATE [21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 16 (SQL: insert into `people` (` adult`, `created_at`,` fully_synced`, `gender`,` imdb_
I don't know about codes.
Will they have a solution?
I appreciate your time to respond, Greetings.
 
Last edited:

prosenjit85

New member
Jul 13, 2022
0
0
0
Good afternoon friends.
when I import series ("the good doctor", "game of Thrones", "La Casa de Papel")(MTDB v3.2.4) I get the error SQLSTATE [21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 16 (SQL: insert into `people` (` adult`, `created_at`,` fully_synced`, `gender`,` imdb_
I don't know about codes.
Will they have a solution?
I appreciate your time to respond, Greetings.

Hi, I think i can resolve it. This change work with 3.2.3 I didnt test on 3.2.4.
1 - make a backup of your site, i dont have resposability if anything goes wrong.

2 - replace the file called ''person.php'' on website/app

Please tell me if worked.

Thank you

PHP:
<?php

namespace App;

use App\Services\Data\Contracts\DataProvider;
use App\Services\Data\Local\LocalDataProvider;
use App\Services\Data\Tmdb\TmdbApi;
use Carbon\Carbon;
use Common\Settings\Settings;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;


/**
* @property boolean $allow_update;
* @property boolean $fully_synced;
* @property integer $tmdb_id;
* @property Carbon $updated_at;
* @property-read Collection|Title[] $credits;
* @property string known_for
* @property string description
* @method static Person findOrFail($id, $columns = ['*'])
*/
class Person extends Model
{
    const PERSON_TYPE = 'person';

    protected $guarded = ['id', 'relation_data', 'type'];
    protected $appends = ['type'];

    protected $casts = [
        'id' => 'integer',
        'tmdb_id' => 'integer',
        'allow_update' => 'boolean',
        'fully_synced' => 'boolean',
        'adult' => 'boolean',
    ];

    /**
     * @param Collection $people
     * @param string $uniqueKey
     * @return Collection
     */
    public function insertOrRetrieve(Collection $people, $uniqueKey)
    {
        $people = $people->map(function($value) {
            unset($value['relation_data']);
            unset($value['type']);
            unset($value['id']);
            $value['known_for'] = isset($value['known_for']) ? $value['known_for'] : '';
            $value['popularity'] = isset($value['popularity']) ? $value['popularity'] : '';
            return $value;
        });

        $existing = $this->whereIn($uniqueKey, $people->pluck($uniqueKey))
            ->get()
            ->mapWithKeys(function($person) use($uniqueKey) {
                return [$person[$uniqueKey] => $person];
            });

        $new = $people->filter(function($person) use($existing, $uniqueKey) {
           return !isset($existing[$person[$uniqueKey]]);
        });

        if ($new->isNotEmpty()) {
            $new->transform(function($person) {
                $person['created_at'] = Arr::get($person, 'created_at', Carbon::now());
                return $person;
            });

            $this->insert($new->toArray());
            return $this->whereIn($uniqueKey, $people->pluck($uniqueKey))->get();
        } else {
            return $existing;
        }
    }

    public function needsUpdating($forceAutomation = false)
    {
        // auto update disabled in settings
        if ( ! $forceAutomation && app(Settings::class)->get('content.people_provider') === Title::LOCAL_PROVIDER) return false;

        // person was never synced from external site
        if ( ! $this->exists || ($this->allow_update && ! $this->fully_synced)) return true;

        // sync every week
        return ($this->allow_update && $this->updated_at->lessThan(Carbon::now()->subWeek()));
    }

    public function getTypeAttribute()
    {
        return self::PERSON_TYPE;
    }

    /**
     * @return BelongsToMany
     */
    public function credits()
    {
        return $this->morphedByMany(Title::class, 'creditable')
            ->select('titles.id', 'is_series', 'poster', 'backdrop', 'popularity', 'name', 'year')
            ->withPivot(['id', 'job', 'department', 'order', 'character'])
            ->orderBy('titles.year', 'desc')
            ->where('titles.adult', 0);
    }

    /**
     * @return BelongsToMany
     */
    public function popularCredits()
    {
        return $this->morphedByMany(Title::class, 'creditable')
            ->select('titles.id', 'is_series', 'name', 'year')
            ->orderBy('titles.popularity', 'desc')
            ->where('titles.adult', 0);
    }

    /**
     * @param int|null $tileId
     * @return BelongsToMany
     */
    public function episodeCredits($tileId = null)
    {
        $query = $this->morphedByMany(Episode::class, 'creditable');
        if ($tileId) {
            $query->where('episodes.title_id', $tileId);
        }
        $query->select('episodes.id', 'episodes.title_id', 'name', 'year', 'season_number', 'episode_number')
            ->withPivot(['job', 'department', 'order', 'character'])
            ->orderBy('episodes.season_number', 'desc')
            ->orderBy('episodes.episode_number', 'desc');
        return $query;
    }

    /**
     * @param int|null $tileId
     * @return BelongsToMany
     */
    public function seasonCredits($tileId = null)
    {
        $query = $this->morphedByMany(Season::class, 'creditable');
        if ($tileId) {
            $query->where('seasons.title_id', $tileId);
        }
        $query->select('seasons.id', 'seasons.title_id')
            ->withPivot(['job', 'department', 'order', 'character'])
            ->orderBy('seasons.number', 'desc');
        return $query;
    }

    /**
     * @return DataProvider
     */
    public static function dataProvider()
    {
        if (app(Settings::class)->get('content.people_provider') !== Title::LOCAL_PROVIDER) {
            return app(TmdbApi::class);
        } else {
            return app(LocalDataProvider::class);
        }
    }
}
 
Last edited:
  • Like
Reactions: zombra

zombra

New member
Apr 9, 2021
0
0
0
I found it in the path public_html / app / Person.php
I replaced it, but it did not work.
My other question is, does this error only occur with the nulled version? the same thing happens with the original version?
I appreciate your time in answering. Thanks for the help.
 

prosenjit85

New member
Jul 13, 2022
0
0
0
I found it in the path public_html / app / Person.php
I replaced it, but it did not work.
My other question is, does this error only occur with the nulled version? the same thing happens with the original version?
I appreciate your time in answering. Thanks for the help.
I have a friend and I ask to him to resolve this problem on 3.2.4, when he answer I post here.
 

prosenjit85

New member
Jul 13, 2022
0
0
0
Thanks for the help

Hi try again, I teste on 3.2.4 and worked. Edit file person.php

PHP:
<?php

namespace App;

use App\Services\Data\Contracts\DataProvider;
use App\Services\Data\Local\LocalDataProvider;
use App\Services\Data\Tmdb\TmdbApi;
use Carbon\Carbon;
use Common\Search\Searchable;
use Common\Settings\Settings;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;

/**
 * @property boolean $allow_update;
 * @property boolean $fully_synced;
 * @property integer $tmdb_id;
 * @property Carbon $updated_at;
 * @property-read Collection|Title[] $credits;
 * @property string known_for
 * @property string description
 * @method static Person findOrFail($id, $columns = ['*'])
 */
class Person extends Model
{
    use Searchable;

    const MODEL_TYPE = 'person';

    protected $guarded = ['id', 'relation_data', 'model_type'];
    protected $appends = ['model_type'];

    protected $casts = [
        'id' => 'integer',
        'tmdb_id' => 'integer',
        'allow_update' => 'boolean',
        'fully_synced' => 'boolean',
        'adult' => 'boolean',
    ];

    /**
     * @param Collection $people
     * @param string $uniqueKey
     * @return Collection
     */
    public function insertOrRetrieve(Collection $people, $uniqueKey)
    {
        $people = $people->map(function ($value) {
            unset($value['relation_data']);
            unset($value['model_type']);
            unset($value['id']);
            $value['known_for'] = isset($value['known_for']) ? $value['known_for'] : '';
            $value['popularity'] = isset($value['popularity']) ? $value['popularity'] : '';
            return $value;
        });

        $existing = $this->whereIn($uniqueKey, $people->pluck($uniqueKey))
            ->get()
            ->mapWithKeys(function ($person) use ($uniqueKey) {
                return [$person[$uniqueKey] => $person];
            });

        $new = $people->filter(function ($person) use ($existing, $uniqueKey) {
            return !isset($existing[$person[$uniqueKey]]);
        });

        if ($new->isNotEmpty()) {
            $new->transform(function ($person) {
                $person['created_at'] = Arr::get(
                    $person,
                    'created_at',
                    Carbon::now(),
                );
                return $person;
            });
            $this->insert($new->toArray());
            return $this->whereIn(
                $uniqueKey,
                $people->pluck($uniqueKey),
            )->get();
        } else {
            return $existing;
        }
    }

    public function needsUpdating($forceAutomation = false)
    {
        // auto update disabled in settings
        if (
            !$forceAutomation &&
            app(Settings::class)->get('content.people_provider') ===
                Title::LOCAL_PROVIDER
        ) {
            return false;
        }

        // person was never synced from external site
        if (!$this->exists || ($this->allow_update && !$this->fully_synced)) {
            return true;
        }

        // sync every week
        return $this->allow_update &&
            $this->updated_at->lessThan(Carbon::now()->subWeek());
    }

    public static function getModelTypeAttribute(): string
    {
        return self::MODEL_TYPE;
    }

    /**
     * @return BelongsToMany
     */
    public function credits()
    {
        return $this->morphedByMany(Title::class, 'creditable')
            ->select(
                'titles.id',
                'is_series',
                'poster',
                'backdrop',
                'popularity',
                'name',
                'year',
            )
            ->withPivot(['id', 'job', 'department', 'order', 'character'])
            ->orderBy('titles.year', 'desc')
            ->where('titles.adult', 0);
    }

    public function popularCredits(): BelongsToMany
    {
        return $this->morphedByMany(Title::class, 'creditable')
            ->select('titles.id', 'is_series', 'name', 'year')
            ->orderBy('titles.popularity', 'desc')
            ->where('titles.adult', 0);
    }

    /**
     * @param int|null $tileId
     * @return BelongsToMany
     */
    public function episodeCredits($tileId = null)
    {
        $query = $this->morphedByMany(Episode::class, 'creditable');
        if ($tileId) {
            $query->where('episodes.title_id', $tileId);
        }
        $query
            ->select(
                'episodes.id',
                'episodes.title_id',
                'name',
                'year',
                'season_number',
                'episode_number',
            )
            ->withPivot(['job', 'department', 'order', 'character'])
            ->orderBy('episodes.season_number', 'desc')
            ->orderBy('episodes.episode_number', 'desc');
        return $query;
    }

    /**
     * @param int|null $tileId
     * @return BelongsToMany
     */
    public function seasonCredits($tileId = null)
    {
        $query = $this->morphedByMany(Season::class, 'creditable');
        if ($tileId) {
            $query->where('seasons.title_id', $tileId);
        }
        $query
            ->select('seasons.id', 'seasons.title_id')
            ->withPivot(['job', 'department', 'order', 'character'])
            ->orderBy('seasons.number', 'desc');
        return $query;
    }

    /**
     * @return DataProvider
     */
    public static function dataProvider()
    {
        if (
            app(Settings::class)->get('content.people_provider') !==
            Title::LOCAL_PROVIDER
        ) {
            return app(TmdbApi::class);
        } else {
            return app(LocalDataProvider::class);
        }
    }

    public function toSearchableArray(): array
    {
        return [
            'id' => $this->id,
            'name' => $this->name,
            'created_at' => $this->created_at->timestamp ?? '_null',
            'updated_at' => $this->updated_at->timestamp ?? '_null',
        ];
    }

    public static function filterableFields(): array
    {
        return ['id', 'created_at', 'updated_at'];
    }

    public function toNormalizedArray(): array
    {
        return [
            'id' => $this->id,
            'name' => $this->name,
            'image' => $this->poster,
            'model_type' => self::MODEL_TYPE,
        ];
    }
}
 

eeeeeeeee1

New member
Banned User
Jun 3, 2022
0
0
0
Hello, does anyone know why the lists I created on the home page do not update automatically?
 

Tyty21

New member
May 10, 2022
0
7
2
Make sure that "Auto Update With" is set correctly and the CRON job too. Unless there are other factors/issues you're facing.
 
Last edited:

eeeeeeeee1

New member
Banned User
Jun 3, 2022
0
0
0
Make sure that "Auto Update With" is set correctly and the CRON job too. Unless there are other factors/issues you're facing.
I have CRON tasks set up every minute as described in the manual :) but despite that, the lists created on the home page do not update automatically.
 

lostkid

Active member
Mar 18, 2021
131
54
28
25
I have CRON tasks set up every minute as described in the manual :) but despite that, the lists created on the home page do not update automatically.
ensure settings->content->automation->title data provider and list data provider are set to the movie database.
Then try testing it by running the schedule command in the terminal
 

eeeeeeeee1

New member
Banned User
Jun 3, 2022
0
0
0
ensure settings->content->automation->title data provider and list data provider are set to the movie database.
Then try testing it by running the schedule command in the terminal
Thank you for your response :) Title Data Provider i set to TMDb and List Data Provider i have set local provider.
 

eeeeeeeee1

New member
Banned User
Jun 3, 2022
0
0
0
I also have one more question. After entering the movies or series tab, sorting is set to popularity by default. How can you change it so that it is set to the added date by default?
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu