Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Castopod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Patryk Miś
Castopod
Commits
38899124
Commit
38899124
authored
3 years ago
by
Yassine Doghri
Browse files
Options
Downloads
Patches
Plain Diff
fix: rewrite regenerate image function to use saveSizes method from Image entity
parent
24136613
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/Entities/Media/Image.php
+1
-1
1 addition, 1 deletion
app/Entities/Media/Image.php
modules/Admin/Controllers/SettingsController.php
+15
-9
15 additions, 9 deletions
modules/Admin/Controllers/SettingsController.php
themes/cp_app/podcast/about.php
+1
-1
1 addition, 1 deletion
themes/cp_app/podcast/about.php
with
17 additions
and
11 deletions
app/Entities/Media/Image.php
+
1
−
1
View file @
38899124
...
...
@@ -82,7 +82,7 @@ class Image extends BaseMedia
$this
->
deleteSizes
();
}
p
rivate
function
saveSizes
():
void
p
ublic
function
saveSizes
():
void
{
// save derived sizes
$imageService
=
service
(
'image'
);
...
...
This diff is collapsed.
Click to expand it.
modules/Admin/Controllers/SettingsController.php
+
15
−
9
View file @
38899124
...
...
@@ -110,7 +110,10 @@ class SettingsController extends BaseController
$allPodcasts
=
(
new
PodcastModel
())
->
findAll
();
foreach
(
$allPodcasts
as
$podcast
)
{
$podcastImages
=
glob
(
ROOTPATH
.
"public/media/podcasts/
{
$podcast
->
handle
}
/*_*"
);
$podcastImages
=
glob
(
ROOTPATH
.
'public/'
.
config
(
'App'
)
->
mediaRoot
.
"/podcasts/
{
$podcast
->
handle
}
/*_*
{
jpg,png,webp
}
"
,
GLOB_BRACE
);
if
(
$podcastImages
)
{
foreach
(
$podcastImages
as
$podcastImage
)
{
...
...
@@ -119,19 +122,22 @@ class SettingsController extends BaseController
}
}
}
$podcast
->
setCover
(
$podcast
->
cover
);
if
(
$podcast
->
banner_
path
!==
null
)
{
$podcast
->
setB
anner
(
$podcast
->
banner
);
$podcast
->
cover
->
saveSizes
(
);
if
(
$podcast
->
banner_
id
!==
null
)
{
$podcast
->
b
anner
->
saveSizes
(
);
}
foreach
(
$podcast
->
episodes
as
$episode
)
{
if
(
$episode
->
cover_
path
!==
null
)
{
$episode
->
setCover
(
$episode
->
cover
);
if
(
$episode
->
cover_
id
!==
null
)
{
$episode
->
cover
->
saveSizes
(
);
}
}
}
$personsImages
=
glob
(
ROOTPATH
.
'public/media/persons/*_*'
);
$personsImages
=
glob
(
ROOTPATH
.
'public/'
.
config
(
'App'
)
->
mediaRoot
.
'/persons/*_*{jpg,png,webp}'
,
GLOB_BRACE
);
if
(
$personsImages
)
{
foreach
(
$personsImages
as
$personsImage
)
{
if
(
is_file
(
$personsImage
))
{
...
...
@@ -142,8 +148,8 @@ class SettingsController extends BaseController
$persons
=
(
new
PersonModel
())
->
findAll
();
foreach
(
$persons
as
$person
)
{
if
(
$person
->
avatar_
path
!==
null
)
{
$person
->
setA
vatar
(
$person
->
av
atar
);
if
(
$person
->
avatar_
id
!==
null
)
{
$person
->
a
vatar
->
s
av
eSizes
(
);
}
}
...
...
This diff is collapsed.
Click to expand it.
themes/cp_app/podcast/about.php
+
1
−
1
View file @
38899124
...
...
@@ -40,7 +40,7 @@
<?=
location_link
(
$podcast
->
location
,
'text-xs font-semibold p-2'
)
?>
<?php
endif
;
?>
</div>
<div
class=
"mt-
4
"
>
<div
class=
"mt-
6
"
>
<h2
class=
"text-xs font-bold tracking-wider text-gray-600 uppercase border-b-2 border-subtle font-display"
>
<?=
lang
(
'Podcast.stats.title'
)
?>
</h2>
<div
class=
"flex flex-col text-sm"
>
<?php
foreach
(
$stats
as
$key
=>
$value
)
:
?>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment