@@ -30,9 +30,9 @@ |
||
| 30 | 30 | $table->primary(['episode_id', 'tag_id']); |
| 31 | 31 | |
| 32 | 32 | $table->foreign('episode_id')->references('id')->on('cosmicradiotv_podcast_episodes') |
| 33 | - ->onUpdate('cascade')->onDelete('cascade'); |
|
| 33 | + ->onUpdate('cascade')->onDelete('cascade'); |
|
| 34 | 34 | $table->foreign('tag_id')->references('id')->on('cosmicradiotv_podcast_tags') |
| 35 | - ->onUpdate('cascade')->onDelete('cascade'); |
|
| 35 | + ->onUpdate('cascade')->onDelete('cascade'); |
|
| 36 | 36 | }); |
| 37 | 37 | }); |
| 38 | 38 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | $table->timestamps(); |
| 31 | 31 | |
| 32 | 32 | $table->foreign('show_id')->references('id')->on('cosmicradiotv_podcast_shows') |
| 33 | - ->onUpdate('cascade'); |
|
| 33 | + ->onUpdate('cascade'); |
|
| 34 | 34 | $table->unique(['show_id', 'slug']); |
| 35 | 35 | }); |
| 36 | 36 | }); |
@@ -36,9 +36,9 @@ |
||
| 36 | 36 | $table->timestamps(); |
| 37 | 37 | |
| 38 | 38 | $table->foreign('episode_id')->references('id')->on('cosmicradiotv_podcast_episodes') |
| 39 | - ->onUpdate('cascade'); |
|
| 39 | + ->onUpdate('cascade'); |
|
| 40 | 40 | $table->foreign('release_type_id')->references('id')->on('cosmicradiotv_podcast_release_types') |
| 41 | - ->onUpdate('cascade'); |
|
| 41 | + ->onUpdate('cascade'); |
|
| 42 | 42 | |
| 43 | 43 | }); |
| 44 | 44 | }); |
@@ -7,7 +7,8 @@ |
||
| 7 | 7 | use October\Rain\Database\Updates\Migration; |
| 8 | 8 | use Schema; |
| 9 | 9 | |
| 10 | -class CreateReleasesTable extends Migration { |
|
| 10 | +class CreateReleasesTable extends Migration |
|
| 11 | +{ |
|
| 11 | 12 | |
| 12 | 13 | /** |
| 13 | 14 | * Migration |
@@ -9,29 +9,29 @@ |
||
| 9 | 9 | |
| 10 | 10 | class AddSortOrderToReleaseTypes extends Migration |
| 11 | 11 | { |
| 12 | - /** |
|
| 13 | - * Migration |
|
| 14 | - */ |
|
| 15 | - public function up() |
|
| 16 | - { |
|
| 17 | - DB::transaction(function() { |
|
| 18 | - Schema::table('cosmicradiotv_podcast_release_types', function (Blueprint $table) { |
|
| 19 | - $table->unsignedInteger('sort_order'); |
|
| 20 | - }); |
|
| 21 | - }); |
|
| 22 | - } |
|
| 12 | + /** |
|
| 13 | + * Migration |
|
| 14 | + */ |
|
| 15 | + public function up() |
|
| 16 | + { |
|
| 17 | + DB::transaction(function() { |
|
| 18 | + Schema::table('cosmicradiotv_podcast_release_types', function (Blueprint $table) { |
|
| 19 | + $table->unsignedInteger('sort_order'); |
|
| 20 | + }); |
|
| 21 | + }); |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * Rollback |
|
| 26 | - */ |
|
| 27 | - public function down() |
|
| 28 | - { |
|
| 29 | - DB::transaction(function() { |
|
| 30 | - Schema::table('cosmicradiotv_podcast_release_types', function (Blueprint $table) { |
|
| 31 | - $table->dropColumn([ |
|
| 32 | - 'sort_order', |
|
| 33 | - ]); |
|
| 34 | - }); |
|
| 35 | - }); |
|
| 36 | - } |
|
| 24 | + /** |
|
| 25 | + * Rollback |
|
| 26 | + */ |
|
| 27 | + public function down() |
|
| 28 | + { |
|
| 29 | + DB::transaction(function() { |
|
| 30 | + Schema::table('cosmicradiotv_podcast_release_types', function (Blueprint $table) { |
|
| 31 | + $table->dropColumn([ |
|
| 32 | + 'sort_order', |
|
| 33 | + ]); |
|
| 34 | + }); |
|
| 35 | + }); |
|
| 36 | + } |
|
| 37 | 37 | } |
| 38 | 38 | \ No newline at end of file |
@@ -6,8 +6,8 @@ |
||
| 6 | 6 | use CosmicRadioTV\Podcast\Models\Episode; |
| 7 | 7 | use CosmicRadioTV\Podcast\Models\Show; |
| 8 | 8 | /** |
| 9 | - * Episodes Back-end Controller |
|
| 10 | - */ |
|
| 9 | + * Episodes Back-end Controller |
|
| 10 | + */ |
|
| 11 | 11 | class Episodes extends Controller |
| 12 | 12 | { |
| 13 | 13 | public $implement = [ |
@@ -34,8 +34,9 @@ discard block |
||
| 34 | 34 | if (($checkedIds = post('checked')) && is_array($checkedIds) && count($checkedIds)) { |
| 35 | 35 | |
| 36 | 36 | foreach ($checkedIds as $episodeId) { |
| 37 | - if (!$episode = Episode::find($episodeId)) |
|
| 38 | - continue; |
|
| 37 | + if (!$episode = Episode::find($episodeId)) { |
|
| 38 | + continue; |
|
| 39 | + } |
|
| 39 | 40 | |
| 40 | 41 | $episode->delete(); |
| 41 | 42 | } |
@@ -46,7 +47,8 @@ discard block |
||
| 46 | 47 | return $this->listRefresh(); |
| 47 | 48 | } |
| 48 | 49 | |
| 49 | - public function listExtendQuery($query, $definition = null) { |
|
| 50 | + public function listExtendQuery($query, $definition = null) |
|
| 51 | + { |
|
| 50 | 52 | $user = BackendAuth::getUser(); |
| 51 | 53 | |
| 52 | 54 | if (!$user->hasAccess(['cosmicradiotv.podcast.access_episodes_all'])) { |
@@ -103,7 +103,8 @@ discard block |
||
| 103 | 103 | * @param boolean $ofShow If true returns the next episode of the same show |
| 104 | 104 | * @return Episode The next episode |
| 105 | 105 | */ |
| 106 | - public function nextCached($ofShow = false) { |
|
| 106 | + public function nextCached($ofShow = false) |
|
| 107 | + { |
|
| 107 | 108 | if (empty($this->nextEpisodeCache[$ofShow])) { |
| 108 | 109 | $this->nextEpisodeCache[$ofShow] = $this->next($ofShow); |
| 109 | 110 | } |
@@ -115,7 +116,8 @@ discard block |
||
| 115 | 116 | * @param boolean $ofShow If true returns the next episode of the same show |
| 116 | 117 | * @return Episode The previous episode |
| 117 | 118 | */ |
| 118 | - public function previousCached($ofShow = false) { |
|
| 119 | + public function previousCached($ofShow = false) |
|
| 120 | + { |
|
| 119 | 121 | if (empty($this->previousEpisodeCache[$ofShow])) { |
| 120 | 122 | $this->previousEpisodeCache[$ofShow] = $this->previous($ofShow); |
| 121 | 123 | } |
@@ -127,7 +129,8 @@ discard block |
||
| 127 | 129 | * @param boolean $ofShow If true returns the next episode of the same show |
| 128 | 130 | * @return Episode The next episode |
| 129 | 131 | */ |
| 130 | - public function next($ofShow = false) { |
|
| 132 | + public function next($ofShow = false) |
|
| 133 | + { |
|
| 131 | 134 | $query = self::query(); |
| 132 | 135 | if ($ofShow) { |
| 133 | 136 | $query = $query->where('show_id',$this->show_id); |
@@ -139,7 +142,8 @@ discard block |
||
| 139 | 142 | * @param boolean $ofShow If true returns the previous episode of the same show |
| 140 | 143 | * @return Episode The previous episode |
| 141 | 144 | */ |
| 142 | - public function previous($ofShow = false) { |
|
| 145 | + public function previous($ofShow = false) |
|
| 146 | + { |
|
| 143 | 147 | $query = self::query(); |
| 144 | 148 | if ($ofShow) { |
| 145 | 149 | $query = $query->where('show_id',$this->show_id); |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | curl_exec($ch); |
| 90 | 90 | |
| 91 | 91 | if (!curl_errno($ch)) { |
| 92 | - $this->size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD); |
|
| 92 | + $this->size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD); |
|
| 93 | 93 | } |
| 94 | 94 | curl_close($ch); |
| 95 | 95 | } |
@@ -76,7 +76,8 @@ |
||
| 76 | 76 | /** |
| 77 | 77 | * Used to automatically set the size of the release (if size is set to 0) |
| 78 | 78 | */ |
| 79 | - public function beforeSave() { |
|
| 79 | + public function beforeSave() |
|
| 80 | + { |
|
| 80 | 81 | $dirty = $this->getDirty(); |
| 81 | 82 | if (in_array($this->release_type->type,['video','audio']) && $this->size == 0 && (isset($dirty['size']) || isset($dirty['url']))) { |
| 82 | 83 | $ch = curl_init(); |
@@ -5,7 +5,8 @@ |
||
| 5 | 5 | use Cms\Classes\CodeBase; |
| 6 | 6 | use Cms\Classes\ComponentBase as OctoberComponentBase; |
| 7 | 7 | |
| 8 | -abstract class ComponentBase extends OctoberComponentBase { |
|
| 8 | +abstract class ComponentBase extends OctoberComponentBase |
|
| 9 | +{ |
|
| 9 | 10 | |
| 10 | 11 | public function __construct(CodeBase $cmsObject = null, $properties = []) |
| 11 | 12 | { |
@@ -74,8 +74,8 @@ |
||
| 74 | 74 | $showSlugFilter = $this->property('showSlugFilter'); |
| 75 | 75 | if (!empty($showSlugFilter)) { |
| 76 | 76 | $this->show = Show::query() |
| 77 | - ->where('slug', $showSlugFilter) |
|
| 78 | - ->firstOrFail(); |
|
| 77 | + ->where('slug', $showSlugFilter) |
|
| 78 | + ->firstOrFail(); |
|
| 79 | 79 | |
| 80 | 80 | $this->episode = $this->show->episodes() |
| 81 | 81 | ->getQuery() |