cs fix
This commit is contained in:
parent
4d6f0061a6
commit
93e4998394
@ -19,13 +19,11 @@ class Application extends App implements IBootstrap
|
|||||||
private const GPODDERSYNC_ID = 'gpoddersync';
|
private const GPODDERSYNC_ID = 'gpoddersync';
|
||||||
private const GPODDERSYNC_MIN_VERSION = '3.8.1';
|
private const GPODDERSYNC_MIN_VERSION = '3.8.1';
|
||||||
|
|
||||||
public function __construct()
|
public function __construct() {
|
||||||
{
|
|
||||||
parent::__construct(self::APP_ID);
|
parent::__construct(self::APP_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function boot(IBootContext $context): void
|
public function boot(IBootContext $context): void {
|
||||||
{
|
|
||||||
/** @psalm-suppress DeprecatedInterface */
|
/** @psalm-suppress DeprecatedInterface */
|
||||||
$appContainer = $context->getAppContainer();
|
$appContainer = $context->getAppContainer();
|
||||||
|
|
||||||
@ -44,12 +42,9 @@ class Application extends App implements IBootstrap
|
|||||||
Util::connectHook('\OCP\Config', 'js', $this, 'extendJsConfig');
|
Util::connectHook('\OCP\Config', 'js', $this, 'extendJsConfig');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function register(IRegistrationContext $context): void
|
public function register(IRegistrationContext $context): void {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function extendJsConfig(array $settings): void
|
public static function extendJsConfig(array $settings): void {
|
||||||
{
|
|
||||||
/** @var IAppManager $appManager */
|
/** @var IAppManager $appManager */
|
||||||
$appManager = Server::get(IAppManager::class);
|
$appManager = Server::get(IAppManager::class);
|
||||||
|
|
||||||
|
@ -22,16 +22,14 @@ class EpisodesController extends Controller
|
|||||||
parent::__construct(Application::APP_ID, $request);
|
parent::__construct(Application::APP_ID, $request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function list(string $url): JSONResponse
|
public function list(string $url): JSONResponse {
|
||||||
{
|
|
||||||
$client = $this->clientService->newClient();
|
$client = $this->clientService->newClient();
|
||||||
$feed = $client->get($url);
|
$feed = $client->get($url);
|
||||||
|
|
||||||
return new JSONResponse($this->episodeActionReader->parseRssXml((string) $feed->getBody()), $feed->getStatusCode());
|
return new JSONResponse($this->episodeActionReader->parseRssXml((string) $feed->getBody()), $feed->getStatusCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function action(string $url): JSONResponse
|
public function action(string $url): JSONResponse {
|
||||||
{
|
|
||||||
$action = $this->episodeActionReader->findByEpisodeUrl($url);
|
$action = $this->episodeActionReader->findByEpisodeUrl($url);
|
||||||
|
|
||||||
if ($action) {
|
if ($action) {
|
||||||
|
@ -14,8 +14,7 @@ use OCP\Util;
|
|||||||
|
|
||||||
class PageController extends Controller
|
class PageController extends Controller
|
||||||
{
|
{
|
||||||
public function __construct(IRequest $request, private IConfig $config)
|
public function __construct(IRequest $request, private IConfig $config) {
|
||||||
{
|
|
||||||
parent::__construct(Application::APP_ID, $request);
|
parent::__construct(Application::APP_ID, $request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,8 +22,7 @@ class PageController extends Controller
|
|||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
* @NoCSRFRequired
|
* @NoCSRFRequired
|
||||||
*/
|
*/
|
||||||
public function index(): TemplateResponse
|
public function index(): TemplateResponse {
|
||||||
{
|
|
||||||
Util::addScript(Application::APP_ID, 'repod-main');
|
Util::addScript(Application::APP_ID, 'repod-main');
|
||||||
|
|
||||||
$csp = new ContentSecurityPolicy();
|
$csp = new ContentSecurityPolicy();
|
||||||
|
@ -24,8 +24,7 @@ class PodcastController extends Controller
|
|||||||
parent::__construct(Application::APP_ID, $request);
|
parent::__construct(Application::APP_ID, $request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index(string $url): JSONResponse
|
public function index(string $url): JSONResponse {
|
||||||
{
|
|
||||||
$podcast = $this->podcastDataReader->tryGetCachedPodcastData($url);
|
$podcast = $this->podcastDataReader->tryGetCachedPodcastData($url);
|
||||||
|
|
||||||
if ($podcast) {
|
if ($podcast) {
|
||||||
|
@ -24,8 +24,7 @@ class SearchController extends Controller
|
|||||||
parent::__construct(Application::APP_ID, $request);
|
parent::__construct(Application::APP_ID, $request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index(string $value): JSONResponse
|
public function index(string $value): JSONResponse {
|
||||||
{
|
|
||||||
$podcasts = [];
|
$podcasts = [];
|
||||||
$providers = [$this->fyydService, $this->itunesService];
|
$providers = [$this->fyydService, $this->itunesService];
|
||||||
|
|
||||||
|
@ -24,8 +24,7 @@ class ToplistController extends Controller
|
|||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
* @NoCSRFRequired
|
* @NoCSRFRequired
|
||||||
*/
|
*/
|
||||||
public function index(): JSONResponse
|
public function index(): JSONResponse {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
return new JSONResponse($this->fyydService->hot());
|
return new JSONResponse($this->fyydService->hot());
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
@ -56,46 +56,38 @@ class EpisodeActionExtraData implements \JsonSerializable
|
|||||||
$this->episodeAction = $episodeAction;
|
$this->episodeAction = $episodeAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __toString(): string
|
public function __toString(): string {
|
||||||
{
|
|
||||||
return $this->episodeUrl ?? '/no episodeUrl/';
|
return $this->episodeUrl ?? '/no episodeUrl/';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEpisodeGuid(): string
|
public function getEpisodeGuid(): string {
|
||||||
{
|
|
||||||
return $this->episodeGuid;
|
return $this->episodeGuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEpisodePubDate(): ?\DateTime
|
public function getEpisodePubDate(): ?\DateTime {
|
||||||
{
|
|
||||||
return $this->episodePubDate;
|
return $this->episodePubDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEpisodeFilesize(): ?int
|
public function getEpisodeFilesize(): ?int {
|
||||||
{
|
|
||||||
return $this->episodeFilesize;
|
return $this->episodeFilesize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEpisodeDuration(): ?int
|
public function getEpisodeDuration(): ?int {
|
||||||
{
|
|
||||||
return $this->episodeDuration;
|
return $this->episodeDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEpisodeAction(): ?EpisodeAction
|
public function getEpisodeAction(): ?EpisodeAction {
|
||||||
{
|
|
||||||
return $this->episodeAction;
|
return $this->episodeAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEpisodeUrl(): ?string
|
public function getEpisodeUrl(): ?string {
|
||||||
{
|
|
||||||
return $this->episodeUrl;
|
return $this->episodeUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return EpisodeActionExtraDataType
|
* @return EpisodeActionExtraDataType
|
||||||
*/
|
*/
|
||||||
public function toArray(): array
|
public function toArray(): array {
|
||||||
{
|
|
||||||
return
|
return
|
||||||
[
|
[
|
||||||
'podcastName' => $this->podcastName,
|
'podcastName' => $this->podcastName,
|
||||||
@ -116,33 +108,27 @@ class EpisodeActionExtraData implements \JsonSerializable
|
|||||||
/**
|
/**
|
||||||
* @return EpisodeActionExtraDataType
|
* @return EpisodeActionExtraDataType
|
||||||
*/
|
*/
|
||||||
public function jsonSerialize(): mixed
|
public function jsonSerialize(): mixed {
|
||||||
{
|
|
||||||
return $this->toArray();
|
return $this->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPodcastName(): ?string
|
public function getPodcastName(): ?string {
|
||||||
{
|
|
||||||
return $this->podcastName;
|
return $this->podcastName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEpisodeName(): ?string
|
public function getEpisodeName(): ?string {
|
||||||
{
|
|
||||||
return $this->episodeName;
|
return $this->episodeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEpisodeLink(): ?string
|
public function getEpisodeLink(): ?string {
|
||||||
{
|
|
||||||
return $this->episodeLink;
|
return $this->episodeLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFetchedAtUnix(): int
|
public function getFetchedAtUnix(): int {
|
||||||
{
|
|
||||||
return $this->fetchedAtUnix;
|
return $this->fetchedAtUnix;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEpisodeImage(): ?string
|
public function getEpisodeImage(): ?string {
|
||||||
{
|
|
||||||
return $this->episodeImage;
|
return $this->episodeImage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,11 +13,9 @@ class EpisodeActionReader
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
private EpisodeActionRepository $episodeActionRepository,
|
private EpisodeActionRepository $episodeActionRepository,
|
||||||
private UserService $userService
|
private UserService $userService
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
public function findByEpisodeUrl(string $episodeUrl): ?EpisodeAction
|
public function findByEpisodeUrl(string $episodeUrl): ?EpisodeAction {
|
||||||
{
|
|
||||||
return $this->episodeActionRepository->findByEpisodeUrl($episodeUrl, $this->userService->getUserUID());
|
return $this->episodeActionRepository->findByEpisodeUrl($episodeUrl, $this->userService->getUserUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,8 +24,7 @@ class EpisodeActionReader
|
|||||||
*
|
*
|
||||||
* @throws \Exception if the XML data could not be parsed
|
* @throws \Exception if the XML data could not be parsed
|
||||||
*/
|
*/
|
||||||
public function parseRssXml(string $xmlString, ?int $fetchedAtUnix = null): array
|
public function parseRssXml(string $xmlString, ?int $fetchedAtUnix = null): array {
|
||||||
{
|
|
||||||
$episodes = [];
|
$episodes = [];
|
||||||
$xml = new \SimpleXMLElement($xmlString);
|
$xml = new \SimpleXMLElement($xmlString);
|
||||||
$channel = $xml->channel;
|
$channel = $xml->channel;
|
||||||
@ -129,8 +126,7 @@ class EpisodeActionReader
|
|||||||
/**
|
/**
|
||||||
* @param null|\SimpleXMLElement|string $value
|
* @param null|\SimpleXMLElement|string $value
|
||||||
*/
|
*/
|
||||||
private function stringOrNull($value): ?string
|
private function stringOrNull($value): ?string {
|
||||||
{
|
|
||||||
if ($value) {
|
if ($value) {
|
||||||
return (string) $value;
|
return (string) $value;
|
||||||
}
|
}
|
||||||
|
@ -20,11 +20,9 @@ class FyydService implements IProvider
|
|||||||
private IFactory $l10n,
|
private IFactory $l10n,
|
||||||
private IUserSession $userSession,
|
private IUserSession $userSession,
|
||||||
private LoggerInterface $logger
|
private LoggerInterface $logger
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
public function search(string $value): array
|
public function search(string $value): array {
|
||||||
{
|
|
||||||
$podcasts = [];
|
$podcasts = [];
|
||||||
|
|
||||||
$client = $this->clientService->newClient();
|
$client = $this->clientService->newClient();
|
||||||
@ -57,8 +55,7 @@ class FyydService implements IProvider
|
|||||||
/**
|
/**
|
||||||
* @return PodcastData[]
|
* @return PodcastData[]
|
||||||
*/
|
*/
|
||||||
public function hot(int $count = 10): array
|
public function hot(int $count = 10): array {
|
||||||
{
|
|
||||||
$podcasts = [];
|
$podcasts = [];
|
||||||
$language = 'en';
|
$language = 'en';
|
||||||
$userLang = $this->userService->getLangCode();
|
$userLang = $this->userService->getLangCode();
|
||||||
|
@ -14,11 +14,9 @@ class ItunesService implements IProvider
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
private IClientService $clientService,
|
private IClientService $clientService,
|
||||||
private UserService $userService
|
private UserService $userService
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
public function search(string $value): array
|
public function search(string $value): array {
|
||||||
{
|
|
||||||
$podcasts = [];
|
$podcasts = [];
|
||||||
|
|
||||||
$client = $this->clientService->newClient();
|
$client = $this->clientService->newClient();
|
||||||
|
@ -12,30 +12,25 @@ class UserService
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
private IFactory $l10n,
|
private IFactory $l10n,
|
||||||
private IUserSession $userSession
|
private IUserSession $userSession
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
public function getUserUID(): string
|
public function getUserUID(): string {
|
||||||
{
|
|
||||||
$user = $this->userSession->getUser();
|
$user = $this->userSession->getUser();
|
||||||
|
|
||||||
return $user ? $user->getUID() : '';
|
return $user ? $user->getUID() : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIsoCode(): string
|
public function getIsoCode(): string {
|
||||||
{
|
|
||||||
return $this->l10n->getUserLanguage($this->userSession->getUser());
|
return $this->l10n->getUserLanguage($this->userSession->getUser());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCountryCode(): string
|
public function getCountryCode(): string {
|
||||||
{
|
|
||||||
$isoCodes = explode('_', $this->getIsoCode());
|
$isoCodes = explode('_', $this->getIsoCode());
|
||||||
|
|
||||||
return isset($isoCodes[1]) ? $isoCodes[1] : 'us';
|
return isset($isoCodes[1]) ? $isoCodes[1] : 'us';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLangCode(): string
|
public function getLangCode(): string {
|
||||||
{
|
|
||||||
$isoCodes = explode('_', $this->getIsoCode());
|
$isoCodes = explode('_', $this->getIsoCode());
|
||||||
|
|
||||||
return $isoCodes[0];
|
return $isoCodes[0];
|
||||||
|
@ -29,76 +29,55 @@ class EpisodeAction
|
|||||||
private int $total,
|
private int $total,
|
||||||
private ?string $guid,
|
private ?string $guid,
|
||||||
private ?int $id
|
private ?int $id
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getPodcast()
|
public function getPodcast() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getEpisode()
|
public function getEpisode() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getAction()
|
public function getAction() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getTimestamp()
|
public function getTimestamp() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getStarted()
|
public function getStarted() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getPosition()
|
public function getPosition() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getTotal()
|
public function getTotal() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ?string
|
* @return ?string
|
||||||
*/
|
*/
|
||||||
public function getGuid()
|
public function getGuid() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getId()
|
public function getId() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return EpisodeActionType
|
* @return EpisodeActionType
|
||||||
*/
|
*/
|
||||||
public function toArray()
|
public function toArray() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,5 @@ class EpisodeActionReader
|
|||||||
* @return EpisodeAction[]
|
* @return EpisodeAction[]
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function fromArray(array $episodeActionsArray)
|
public function fromArray(array $episodeActionsArray) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -13,13 +13,10 @@ class EpisodeActionSaver
|
|||||||
private EpisodeActionRepository $episodeActionRepository,
|
private EpisodeActionRepository $episodeActionRepository,
|
||||||
private EpisodeActionWriter $episodeActionWriter,
|
private EpisodeActionWriter $episodeActionWriter,
|
||||||
private EpisodeActionReader $episodeActionReader
|
private EpisodeActionReader $episodeActionReader
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function saveEpisodeActions(array $episodeActionsArray, string $userId)
|
public function saveEpisodeActions(array $episodeActionsArray, string $userId) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -15,21 +15,15 @@ namespace OCA\GPodderSync\Core\PodcastData;
|
|||||||
*/
|
*/
|
||||||
class PodcastActionCounts implements \JsonSerializable
|
class PodcastActionCounts implements \JsonSerializable
|
||||||
{
|
{
|
||||||
public function incrementAction(string $action): void
|
public function incrementAction(string $action): void {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return PodcastActionCountsType
|
* @return PodcastActionCountsType
|
||||||
*/
|
*/
|
||||||
public function toArray()
|
public function toArray() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return PodcastActionCountsType
|
* @return PodcastActionCountsType
|
||||||
*/
|
*/
|
||||||
public function jsonSerialize(): mixed
|
public function jsonSerialize(): mixed {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -25,89 +25,64 @@ class PodcastData implements \JsonSerializable
|
|||||||
private ?string $imageUrl,
|
private ?string $imageUrl,
|
||||||
private int $fetchedAtUnix,
|
private int $fetchedAtUnix,
|
||||||
private ?string $imageBlob = null
|
private ?string $imageBlob = null
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return PodcastData
|
* @return PodcastData
|
||||||
* @throws \Exception if the XML data could not be parsed
|
* @throws \Exception if the XML data could not be parsed
|
||||||
*/
|
*/
|
||||||
public static function parseRssXml(string $xmlString, ?int $fetchedAtUnix = null)
|
public static function parseRssXml(string $xmlString, ?int $fetchedAtUnix = null) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ?string
|
* @return ?string
|
||||||
*/
|
*/
|
||||||
public function getTitle()
|
public function getTitle() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ?string
|
* @return ?string
|
||||||
*/
|
*/
|
||||||
public function getAuthor()
|
public function getAuthor() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ?string
|
* @return ?string
|
||||||
*/
|
*/
|
||||||
public function getLink()
|
public function getLink() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ?string
|
* @return ?string
|
||||||
*/
|
*/
|
||||||
public function getDescription()
|
public function getDescription() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ?string
|
* @return ?string
|
||||||
*/
|
*/
|
||||||
public function getImageUrl()
|
public function getImageUrl() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ?int
|
* @return ?int
|
||||||
*/
|
*/
|
||||||
public function getFetchedAtUnix()
|
public function getFetchedAtUnix() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ?string
|
* @return ?string
|
||||||
*/
|
*/
|
||||||
public function getImageBlob()
|
public function getImageBlob() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setImageBlob(?string $blob): void
|
public function setImageBlob(?string $blob): void {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return PodcastDataType
|
* @return PodcastDataType
|
||||||
*/
|
*/
|
||||||
public function toArray()
|
public function toArray() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return PodcastDataType
|
* @return PodcastDataType
|
||||||
*/
|
*/
|
||||||
public function jsonSerialize(): mixed
|
public function jsonSerialize(): mixed {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param PodcastDataType $data
|
* @param PodcastDataType $data
|
||||||
* @return PodcastData
|
* @return PodcastData
|
||||||
*/
|
*/
|
||||||
public static function fromArray(array $data)
|
public static function fromArray(array $data) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -9,28 +9,20 @@ class PodcastDataReader
|
|||||||
/**
|
/**
|
||||||
* @return ?PodcastData
|
* @return ?PodcastData
|
||||||
*/
|
*/
|
||||||
public function getCachedOrFetchPodcastData(string $url, string $userId)
|
public function getCachedOrFetchPodcastData(string $url, string $userId) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ?PodcastData
|
* @return ?PodcastData
|
||||||
*/
|
*/
|
||||||
public function fetchPodcastData(string $url, string $userId)
|
public function fetchPodcastData(string $url, string $userId) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ?PodcastData
|
* @return ?PodcastData
|
||||||
*/
|
*/
|
||||||
public function tryGetCachedPodcastData(string $url)
|
public function tryGetCachedPodcastData(string $url) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function trySetCachedPodcastData(string $url, PodcastData $data)
|
public function trySetCachedPodcastData(string $url, PodcastData $data) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -17,45 +17,32 @@ class PodcastMetrics implements \JsonSerializable
|
|||||||
private string $url,
|
private string $url,
|
||||||
private int $listenedSeconds = 0,
|
private int $listenedSeconds = 0,
|
||||||
private ?PodcastActionCounts $actionCounts = null
|
private ?PodcastActionCounts $actionCounts = null
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getUrl()
|
public function getUrl() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return PodcastActionCounts
|
* @return PodcastActionCounts
|
||||||
*/
|
*/
|
||||||
public function getActionCounts()
|
public function getActionCounts() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getListenedSeconds()
|
public function getListenedSeconds() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function addListenedSeconds(int $seconds): void
|
public function addListenedSeconds(int $seconds): void {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return PodcastMetricsType
|
* @return PodcastMetricsType
|
||||||
*/
|
*/
|
||||||
public function toArray()
|
public function toArray() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return PodcastMetricsType
|
* @return PodcastMetricsType
|
||||||
*/
|
*/
|
||||||
public function jsonSerialize(): mixed
|
public function jsonSerialize(): mixed {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,5 @@ class PodcastMetricsReader
|
|||||||
/**
|
/**
|
||||||
* @return PodcastMetrics[]
|
* @return PodcastMetrics[]
|
||||||
*/
|
*/
|
||||||
public function metrics(string $userId)
|
public function metrics(string $userId) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -9,20 +9,15 @@ class SubscriptionChange
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
private string $url,
|
private string $url,
|
||||||
private bool $isSubscribed
|
private bool $isSubscribed
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isSubscribed()
|
public function isSubscribed() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getUrl()
|
public function getUrl() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -6,14 +6,10 @@ namespace OCA\GPodderSync\Core\SubscriptionChange;
|
|||||||
|
|
||||||
class SubscriptionChangeRequestParser
|
class SubscriptionChangeRequestParser
|
||||||
{
|
{
|
||||||
public function __construct(private SubscriptionChangesReader $subscriptionChangeReader)
|
public function __construct(private SubscriptionChangesReader $subscriptionChangeReader) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return SubscriptionChange[]
|
* @return SubscriptionChange[]
|
||||||
*/
|
*/
|
||||||
public function createSubscriptionChangeList(array $urlsSubscribed, array $urlsUnsubscribed)
|
public function createSubscriptionChangeList(array $urlsSubscribed, array $urlsUnsubscribed) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,5 @@ namespace OCA\GPodderSync\Core\SubscriptionChange;
|
|||||||
|
|
||||||
class SubscriptionChangeSaver
|
class SubscriptionChangeSaver
|
||||||
{
|
{
|
||||||
public function saveSubscriptionChanges(array $urlsSubscribed, array $urlsUnsubscribed, string $userId): void
|
public function saveSubscriptionChanges(array $urlsSubscribed, array $urlsUnsubscribed, string $userId): void {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,5 @@ class SubscriptionChangesReader
|
|||||||
/**
|
/**
|
||||||
* @return SubscriptionChange[]
|
* @return SubscriptionChange[]
|
||||||
*/
|
*/
|
||||||
public static function mapToSubscriptionsChanges(array $urls, bool $subscribed)
|
public static function mapToSubscriptionsChanges(array $urls, bool $subscribed) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,5 @@ class EpisodeActionEntity extends Entity implements \JsonSerializable
|
|||||||
/**
|
/**
|
||||||
* @return EpisodeActionType[]
|
* @return EpisodeActionType[]
|
||||||
*/
|
*/
|
||||||
public function jsonSerialize(): mixed
|
public function jsonSerialize(): mixed {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -13,29 +13,21 @@ use OCP\IDBConnection;
|
|||||||
*/
|
*/
|
||||||
class EpisodeActionMapper extends QBMapper
|
class EpisodeActionMapper extends QBMapper
|
||||||
{
|
{
|
||||||
public function __construct(IDBConnection $db)
|
public function __construct(IDBConnection $db) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return EpisodeActionEntity[]
|
* @return EpisodeActionEntity[]
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function findAll(int $sinceTimestamp, string $userId)
|
public function findAll(int $sinceTimestamp, string $userId) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ?EpisodeActionEntity
|
* @return ?EpisodeActionEntity
|
||||||
*/
|
*/
|
||||||
public function findByEpisodeUrl(string $episodeIdentifier, string $userId)
|
public function findByEpisodeUrl(string $episodeIdentifier, string $userId) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ?EpisodeActionEntity
|
* @return ?EpisodeActionEntity
|
||||||
*/
|
*/
|
||||||
public function findByGuid(string $guid, string $userId)
|
public function findByGuid(string $guid, string $userId) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -8,32 +8,22 @@ use OCA\GPodderSync\Core\EpisodeAction\EpisodeAction;
|
|||||||
|
|
||||||
class EpisodeActionRepository
|
class EpisodeActionRepository
|
||||||
{
|
{
|
||||||
public function __construct(private EpisodeActionMapper $episodeActionMapper)
|
public function __construct(private EpisodeActionMapper $episodeActionMapper) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return EpisodeAction[]
|
* @return EpisodeAction[]
|
||||||
*/
|
*/
|
||||||
public function findAll(int $sinceEpoch, string $userId)
|
public function findAll(int $sinceEpoch, string $userId) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ?EpisodeAction
|
* @return ?EpisodeAction
|
||||||
*/
|
*/
|
||||||
public function findByEpisodeUrl(string $episodeUrl, string $userId)
|
public function findByEpisodeUrl(string $episodeUrl, string $userId) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ?EpisodeAction
|
* @return ?EpisodeAction
|
||||||
*/
|
*/
|
||||||
public function findByGuid(string $guid, string $userId)
|
public function findByGuid(string $guid, string $userId) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function deleteEpisodeActionByEpisodeUrl(string $episodeUrl, string $userId): void
|
public function deleteEpisodeActionByEpisodeUrl(string $episodeUrl, string $userId): void {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -8,23 +8,17 @@ use OCP\DB\Exception;
|
|||||||
|
|
||||||
class EpisodeActionWriter
|
class EpisodeActionWriter
|
||||||
{
|
{
|
||||||
public function __construct(private EpisodeActionMapper $episodeActionMapper)
|
public function __construct(private EpisodeActionMapper $episodeActionMapper) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return EpisodeActionEntity
|
* @return EpisodeActionEntity
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function save(EpisodeActionEntity $episodeActionEntity)
|
public function save(EpisodeActionEntity $episodeActionEntity) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return EpisodeActionEntity
|
* @return EpisodeActionEntity
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function update(EpisodeActionEntity $episodeActionEntity)
|
public function update(EpisodeActionEntity $episodeActionEntity) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,5 @@ class SubscriptionChangeEntity extends Entity implements \JsonSerializable
|
|||||||
/**
|
/**
|
||||||
* @return array<string,mixed>
|
* @return array<string,mixed>
|
||||||
*/
|
*/
|
||||||
public function jsonSerialize(): mixed
|
public function jsonSerialize(): mixed {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -12,32 +12,22 @@ use OCP\IDBConnection;
|
|||||||
*/
|
*/
|
||||||
class SubscriptionChangeMapper extends QBMapper
|
class SubscriptionChangeMapper extends QBMapper
|
||||||
{
|
{
|
||||||
public function __construct(IDBConnection $db)
|
public function __construct(IDBConnection $db) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return SubscriptionChangeEntity[]
|
* @return SubscriptionChangeEntity[]
|
||||||
*/
|
*/
|
||||||
public function findAll(string $userId)
|
public function findAll(string $userId) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ?SubscriptionChangeEntity
|
* @return ?SubscriptionChangeEntity
|
||||||
*/
|
*/
|
||||||
public function findByUrl(string $url, string $userId)
|
public function findByUrl(string $url, string $userId) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function remove(SubscriptionChangeEntity $subscriptionChangeEntity): void
|
public function remove(SubscriptionChangeEntity $subscriptionChangeEntity): void {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return SubscriptionChangeEntity[]
|
* @return SubscriptionChangeEntity[]
|
||||||
*/
|
*/
|
||||||
public function findAllSubscriptionState(bool $subscribed, \DateTime $sinceTimestamp, string $userId)
|
public function findAllSubscriptionState(bool $subscribed, \DateTime $sinceTimestamp, string $userId) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -6,35 +6,25 @@ namespace OCA\GPodderSync\Db\SubscriptionChange;
|
|||||||
|
|
||||||
class SubscriptionChangeRepository
|
class SubscriptionChangeRepository
|
||||||
{
|
{
|
||||||
public function __construct(private SubscriptionChangeMapper $subscriptionChangeMapper)
|
public function __construct(private SubscriptionChangeMapper $subscriptionChangeMapper) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return SubscriptionChangeEntity[]
|
* @return SubscriptionChangeEntity[]
|
||||||
*/
|
*/
|
||||||
public function findAll()
|
public function findAll() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ?SubscriptionChangeEntity
|
* @return ?SubscriptionChangeEntity
|
||||||
*/
|
*/
|
||||||
public function findByUrl(string $episode, string $userId)
|
public function findByUrl(string $episode, string $userId) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return SubscriptionChangeEntity[]
|
* @return SubscriptionChangeEntity[]
|
||||||
*/
|
*/
|
||||||
public function findAllSubscribed(\DateTime $sinceTimestamp, string $userId)
|
public function findAllSubscribed(\DateTime $sinceTimestamp, string $userId) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return SubscriptionChangeEntity[]
|
* @return SubscriptionChangeEntity[]
|
||||||
*/
|
*/
|
||||||
public function findAllUnSubscribed(\DateTime $sinceTimestamp, string $userId)
|
public function findAllUnSubscribed(\DateTime $sinceTimestamp, string $userId) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -6,25 +6,17 @@ namespace OCA\GPodderSync\Db\SubscriptionChange;
|
|||||||
|
|
||||||
class SubscriptionChangeWriter
|
class SubscriptionChangeWriter
|
||||||
{
|
{
|
||||||
public function __construct(private SubscriptionChangeMapper $subscriptionChangeMapper)
|
public function __construct(private SubscriptionChangeMapper $subscriptionChangeMapper) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function purge(): void
|
public function purge(): void {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return SubscriptionChangeEntity
|
* @return SubscriptionChangeEntity
|
||||||
*/
|
*/
|
||||||
public function create(SubscriptionChangeEntity $subscriptionChangeEntity)
|
public function create(SubscriptionChangeEntity $subscriptionChangeEntity) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return SubscriptionChangeEntity
|
* @return SubscriptionChangeEntity
|
||||||
*/
|
*/
|
||||||
public function update(SubscriptionChangeEntity $subscriptionChangeEntity)
|
public function update(SubscriptionChangeEntity $subscriptionChangeEntity) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user