Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<screenshot>https://github.com/julien-nc/integration_tmdb/raw/main/img/screenshot2.jpg</screenshot>
<screenshot>https://github.com/julien-nc/integration_tmdb/raw/main/img/screenshot3.jpg</screenshot>
<dependencies>
<nextcloud min-version="27" max-version="31"/>
<nextcloud min-version="27" max-version="32"/>
</dependencies>
<settings>
<admin>OCA\Tmdb\Settings\Admin</admin>
Expand Down
1 change: 1 addition & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Nextcloud - Tmdb
*
Expand Down
248 changes: 176 additions & 72 deletions composer.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Nextcloud - Tmdb
*
Expand Down
5 changes: 3 additions & 2 deletions lib/Controller/ConfigController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Nextcloud - Tmdb
*
Expand Down Expand Up @@ -28,9 +29,9 @@ class ConfigController extends Controller {
public function __construct(
string $appName,
IRequest $request,
private IConfig $config,
private IConfig $config,
private ICrypto $crypto,
private ?string $userId
private ?string $userId,
) {
parent::__construct($appName, $request);
}
Expand Down
11 changes: 7 additions & 4 deletions lib/Controller/TmdbAPIController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Nextcloud - Tmdb
*
Expand All @@ -23,11 +24,13 @@

class TmdbAPIController extends OCSController {

public function __construct(string $appName,
IRequest $request,
public function __construct(
string $appName,
IRequest $request,
private TmdbAPIService $tmdbAPIService,
private IURLGenerator $urlGenerator,
?string $userId) {
private IURLGenerator $urlGenerator,
?string $userId,
) {
parent::__construct($appName, $request);
}

Expand Down
1 change: 1 addition & 0 deletions lib/Listener/TmdbReferenceListener.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @copyright Copyright (c) 2023 Julien Veyssier <[email protected]>
*
Expand Down
1 change: 1 addition & 0 deletions lib/Migration/Version2100Date202410231627.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down
7 changes: 5 additions & 2 deletions lib/Reference/TmdbReferenceProvider.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @copyright Copyright (c) 2023 Julien Veyssier <[email protected]>
*
Expand Down Expand Up @@ -42,14 +43,16 @@ class TmdbReferenceProvider extends ADiscoverableReferenceProvider implements IS
private const RICH_OBJECT_TYPE_PERSON = Application::APP_ID . '_person';
private const RICH_OBJECT_TYPE_TV = Application::APP_ID . '_tv';

public function __construct(private TmdbAPIService $tmdbAPIService,
public function __construct(
private TmdbAPIService $tmdbAPIService,
private IConfig $config,
private IL10N $l10n,
private IURLGenerator $urlGenerator,
private IReferenceManager $referenceManager,
private LinkReferenceProvider $linkReferenceProvider,
private UtilsService $utilsService,
private ?string $userId) {
private ?string $userId,
) {
}

/**
Expand Down
21 changes: 14 additions & 7 deletions lib/Search/TmdbSearchProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,22 @@
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\Search\IExternalProvider;
use OCP\Search\IProvider;
use OCP\Search\ISearchQuery;
use OCP\Search\SearchResult;
use OCP\Search\SearchResultEntry;

class TmdbSearchProvider implements IProvider {
class TmdbSearchProvider implements IProvider, IExternalProvider {

public function __construct(private IAppManager $appManager,
private IL10N $l10n,
private IConfig $config,
private IURLGenerator $urlGenerator,
private UtilsService $utilsService,
private TmdbAPIService $tmdbAPIService) {
public function __construct(
private IAppManager $appManager,
private IL10N $l10n,
private IConfig $config,
private IURLGenerator $urlGenerator,
private UtilsService $utilsService,
private TmdbAPIService $tmdbAPIService,
) {
}

/**
Expand Down Expand Up @@ -197,4 +200,8 @@ protected function getThumbnailUrl(array $entry): array {
);
return [false, $url];
}

public function isExternalProvider(): bool {
return true;
}
}
3 changes: 2 additions & 1 deletion lib/Service/TmdbAPIService.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Nextcloud - Tmdb
*
Expand Down Expand Up @@ -38,7 +39,7 @@ public function __construct(
private IConfig $config,
private ICrypto $crypto,
private IFactory $l10nFactory,
IClientService $clientService
IClientService $clientService,
) {
$this->client = $clientService->newClient();
}
Expand Down
7 changes: 5 additions & 2 deletions lib/Service/UtilsService.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Nextcloud - Tmdb
*
Expand All @@ -16,8 +17,10 @@

class UtilsService {

public function __construct(string $appName,
private IDateTimeFormatter $dateTimeFormatter) {
public function __construct(
string $appName,
private IDateTimeFormatter $dateTimeFormatter,
) {
}

public function formatDate(string $date, string $format = 'long'): string {
Expand Down
2 changes: 1 addition & 1 deletion lib/Settings/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private IConfig $config,
private IInitialState $initialStateService,
private ICrypto $crypto,
?string $userId
?string $userId,
) {
}

Expand Down
6 changes: 4 additions & 2 deletions lib/Settings/AdminSection.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

class AdminSection implements IIconSection {

public function __construct(private IURLGenerator $urlGenerator,
private IL10N $l) {
public function __construct(
private IURLGenerator $urlGenerator,
private IL10N $l,
) {
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Settings/Personal.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(
private IConfig $config,
private IInitialState $initialStateService,
private ICrypto $crypto,
private ?string $userId
private ?string $userId,
) {
}

Expand Down
6 changes: 4 additions & 2 deletions lib/Settings/PersonalSection.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

class PersonalSection implements IIconSection {

public function __construct(private IURLGenerator $urlGenerator,
private IL10N $l) {
public function __construct(
private IURLGenerator $urlGenerator,
private IL10N $l,
) {
}

/**
Expand Down
Loading