mirror of
https://github.com/thrillfall/nextcloud-gpodder.git
synced 2024-12-27 16:23:00 +01:00
20920c5d84
EpisodeActionReader created (or appended to) file actionreader.log in Nextcloud base folder (with index.php & occ). This concluded in a Nextcloud warning about "additional files in Nextcloud folder" in the self-check feature.
26 lines
683 B
PHP
26 lines
683 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\GPodderSync\Core\EpisodeAction;
|
|
|
|
class EpisodeActionReader {
|
|
public function fromString(string $episodeActionString): EpisodeAction {
|
|
preg_match(
|
|
'/\[EpisodeAction{(podcast=\')(?<podcast>.*?)(\', episode=\')(?<episode>.*?)(\', action=)(?<action>.*?)(, timestamp=)(?<timestamp>.*?)(, started=)(?<started>.*?)(, position=)(?<position>.*?)(, total=)(?<total>.*?)}]*/',
|
|
$episodeActionString,
|
|
$matches
|
|
);
|
|
|
|
return new EpisodeAction(
|
|
$matches["podcast"],
|
|
$matches["episode"],
|
|
$matches["action"],
|
|
$matches["timestamp"],
|
|
(int)$matches["started"],
|
|
(int)$matches["position"],
|
|
(int)$matches["total"],
|
|
);
|
|
}
|
|
|
|
}
|