Added URL handling to a few more existing info providers

This commit is contained in:
Jan Böhmer 2026-02-01 21:18:06 +01:00
parent 10acc2e130
commit 24f0f0d23c
5 changed files with 115 additions and 19 deletions

View file

@ -32,7 +32,7 @@ use App\Services\InfoProviderSystem\DTOs\PurchaseInfoDTO;
use App\Services\InfoProviderSystem\DTOs\SearchResultDTO;
use App\Settings\InfoProviderSystem\TMESettings;
class TMEProvider implements InfoProviderInterface
class TMEProvider implements InfoProviderInterface, URLHandlerInfoProviderInterface
{
private const VENDOR_NAME = 'TME';
@ -296,4 +296,22 @@ class TMEProvider implements InfoProviderInterface
ProviderCapabilities::PRICE,
];
}
public function getHandledDomains(): array
{
return ['tme.eu'];
}
public function getIDFromURL(string $url): ?string
{
//Input: https://www.tme.eu/de/details/fi321_se/kuhler/alutronic/
//The ID is the part after the details segment and before the next slash
$matches = [];
if (preg_match('#/details/([^/]+)/#', $url, $matches) === 1) {
return $matches[1];
}
return null;
}
}