Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmenich committed Feb 1, 2024
2 parents ed50629 + 289125c commit 3376945
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 87 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/.idea
/.ddev
/craft
.editorconfig
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 3.3.1 - 2024-02-01

### Added

- `mediamanager/schedule/run` console command to run the scheduled sync jobs.

## 3.3.0 - 2024-01-12

### Added
Expand Down
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "moon/pbs-media-manager-craft-gacraft",
"description": "Media Manager 3 for PBS API",
"version": "3.3.0",
"version": "3.3.1",
"type": "craft-plugin",
"keywords": ["craftcms", "pbs", "media-manager"],
"license": "MIT",
Expand Down Expand Up @@ -32,5 +32,11 @@
"name": "Media Manager",
"documentationUrl": "https://projects.pbs.org/bitbucket/projects/MOON/repos/pbs-media-manager-craft-plugin/browse/README.md",
"class": "papertiger\\mediamanager\\MediaManager"
},
"config": {
"allow-plugins": {
"craftcms/plugin-installer": true,
"yiisoft/yii2-composer": true
}
}
}
46 changes: 46 additions & 0 deletions src/console/controllers/ScheduleController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
* Media Manager
*
* @package PaperTiger:MediaManager
* @author Paper Tiger
* @copyright Copyright (c) 2020 Paper Tiger
* @link https://www.papertiger.com/
*/

namespace papertiger\mediamanager\console\controllers;

use Craft;
use papertiger\mediamanager\jobs\ShowSync;
use yii\console\ExitCode;

use yii\console\Controller;
use papertiger\mediamanager\MediaManager;

class ScheduleController extends Controller
{
// Protected
// =========================================================================
protected $allowAnonymous = [ 'run' ];


// Public Methods
// =========================================================================
public function actionRun()
{
$scheduledSyncService = MediaManager::$plugin->scheduledSync;
$pushableSyncs = $scheduledSyncService->getPushableSyncs();

foreach ($pushableSyncs as $pushableSync) {
Craft::$app->getQueue()->push(new ShowSync([
'showId' => $pushableSync->showId,
'regenerateThumbnails' => $pushableSync->regenerateThumbnail,
'scheduledSync' => $pushableSync->id
]));

$pushableSync->processed = 1;
$scheduledSyncService->saveScheduledSync($pushableSync);
}
return ExitCode::OK;
}
}
86 changes: 0 additions & 86 deletions src/console/controllers/SchedulerConsoleController.php

This file was deleted.

0 comments on commit 3376945

Please sign in to comment.