Skip to content

Commit

Permalink
Merge pull request #236 from Shikkanime/dev
Browse files Browse the repository at this point in the history
Fix media image
  • Loading branch information
Ziedelth authored Mar 3, 2024
2 parents b71b60e + 720f7f7 commit 0a42250
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/global_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
run: ./gradlew sonar --info

- name: Analyse pull request
# If pull request, we analyze the code
if: github.event_name == 'pull_request'
# If pull request, we analyze the code, and if the target branch is not master
if: github.event_name == 'pull_request' && github.event.pull_request.base.ref != 'master'
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
Expand Down
4 changes: 3 additions & 1 deletion src/main/kotlin/fr/shikkanime/services/ImageService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,9 @@ object ImageService {

private fun loadResources(episode: EpisodeDto): Tuple<BufferedImage, BufferedImage, Font, BufferedImage, BufferedImage?> {
val mediaImageFolder =
File(ClassLoader.getSystemClassLoader().getResource("media-image")!!.file).takeIf { it.exists() } ?: File(
ClassLoader.getSystemClassLoader()
.getResource("media-image")?.file?.let { File(it).takeIf { file -> file.exists() } }
?: File(
Constant.dataFolder,
"media-image"
)
Expand Down

0 comments on commit 0a42250

Please sign in to comment.