Skip to content

Commit

Permalink
Merge pull request #613 from Shikkanime/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Ziedelth authored Aug 9, 2024
2 parents ead2470 + da80799 commit 1cd8f09
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
val ktorVersion = "2.3.12"
val ktorSwaggerUiVersion = "2.10.0"
val hibernateCoreVersion = "6.5.2.Final"
val hibernateCoreVersion = "6.6.0.Final"
val ehcacheVersion = "3.10.8"
val glassfishJaxbVersion = "4.0.5"
val hibernateSearchVersion = "7.1.1.Final"
Expand Down
7 changes: 6 additions & 1 deletion src/main/kotlin/fr/shikkanime/jobs/UpdateEpisodeJob.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ class UpdateEpisodeJob : AbstractJob {

val originalEpisode = episodes.firstOrNull { it.original }
?: episodes.firstOrNull()
?: return@forEach
?: return@forEach run {
logger.warning("No episode found for $mappingIdentifier")
mapping.lastUpdateDateTime = ZonedDateTime.now()
episodeMappingService.update(mapping)
logger.info("Episode $mappingIdentifier updated")
}

if (originalEpisode.image != Constant.DEFAULT_IMAGE_PREVIEW && mapping.image != originalEpisode.image) {
mapping.image = originalEpisode.image
Expand Down
8 changes: 7 additions & 1 deletion src/main/kotlin/fr/shikkanime/services/AnimeService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,13 @@ class AnimeService : AbstractService<Anime, AnimeRepository>() {
mappings.maxOfOrNull { it.number!! },
mappings.firstOrNull()?.number
)
}.sortedWith(compareBy({ ZonedDateTime.parse(it.releaseDateTime).withZoneSameInstant(zoneId).toLocalTime() }, { it.anime.shortName }))
}.sortedWith(
compareBy(
{ ZonedDateTime.parse(it.releaseDateTime).withZoneSameInstant(zoneId).toLocalTime() },
{ it.anime.shortName },
{ it.langType }
)
)
)
}
}
Expand Down
19 changes: 10 additions & 9 deletions src/main/resources/templates/site/calendar.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

<article x-data="{ hover: false }" class="shikk-element mb-3 position-relative<#if release.isMultipleReleased()> mt-2</#if>">
<#if release.isMultipleReleased()>
<div>
<div data-multiple-released>
<div class="shikk-element-collection-2"></div>
<div class="shikk-element-collection-1"></div>
</div>
Expand Down Expand Up @@ -150,19 +150,20 @@
});
document.querySelectorAll('.img-fluid').forEach(img => {
const closest = img.closest('.shikk-element');
if (!closest.querySelector('[data-multiple-released]')) return;
img.crossOrigin = 'Anonymous';
img.onload = function () {
const processImage = () => {
const rgb = getAverageRGB(img);
img.closest('.shikk-element').querySelectorAll('.shikk-element-collection-1, .shikk-element-collection-2').forEach(collection => {
collection.style.backgroundColor = 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')';
});
closest.querySelectorAll('.shikk-element-collection-1, .shikk-element-collection-2')
.forEach(collection => {
collection.style.backgroundColor = 'rgb(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ')';
});
};
if (img.complete) {
img.onload();
}
img.complete ? processImage() : img.onload = processImage;
});
function getAverageRGB(imgEl) {
Expand Down

0 comments on commit 1cd8f09

Please sign in to comment.