diff --git a/src/main/kotlin/fr/shikkanime/controllers/admin/AdminAnimeController.kt b/src/main/kotlin/fr/shikkanime/controllers/admin/AdminAnimeController.kt index a947c9a6..10804f51 100644 --- a/src/main/kotlin/fr/shikkanime/controllers/admin/AdminAnimeController.kt +++ b/src/main/kotlin/fr/shikkanime/controllers/admin/AdminAnimeController.kt @@ -2,7 +2,7 @@ package fr.shikkanime.controllers.admin import com.google.inject.Inject import fr.shikkanime.converters.AbstractConverter -import fr.shikkanime.dtos.AnimeDto +import fr.shikkanime.dtos.animes.AnimeDto import fr.shikkanime.entities.enums.Link import fr.shikkanime.services.AnimeService import fr.shikkanime.utils.routes.AdminSessionAuthenticated diff --git a/src/main/kotlin/fr/shikkanime/controllers/api/SimulcastController.kt b/src/main/kotlin/fr/shikkanime/controllers/api/SimulcastController.kt index b7cccf28..d0e49186 100644 --- a/src/main/kotlin/fr/shikkanime/controllers/api/SimulcastController.kt +++ b/src/main/kotlin/fr/shikkanime/controllers/api/SimulcastController.kt @@ -2,7 +2,7 @@ package fr.shikkanime.controllers.api import com.google.inject.Inject import fr.shikkanime.converters.AbstractConverter -import fr.shikkanime.dtos.SimulcastDto +import fr.shikkanime.dtos.simulcasts.SimulcastDto import fr.shikkanime.services.SimulcastService import fr.shikkanime.utils.routes.* import fr.shikkanime.utils.routes.method.Get diff --git a/src/main/kotlin/fr/shikkanime/controllers/site/SiteController.kt b/src/main/kotlin/fr/shikkanime/controllers/site/SiteController.kt index f15cd619..69063a10 100644 --- a/src/main/kotlin/fr/shikkanime/controllers/site/SiteController.kt +++ b/src/main/kotlin/fr/shikkanime/controllers/site/SiteController.kt @@ -71,8 +71,17 @@ class SiteController { @Path("sitemap.xml") @Get private fun sitemap(): Response { - val simulcasts = simulcastCacheService.findAll()!! - val animes = animeCacheService.findAll()!! + val simulcasts = simulcastCacheService.findAllUpdated()!! + + val animes = simulcasts.flatMap { + animeCacheService.findAllByUpdated( + CountryCode.FR, + it.uuid, + listOf(SortParameter("name", SortParameter.Order.ASC)), + 1, + 102 + )!!.data + } val episode = episodeCacheService.findAllBy( CountryCode.FR, @@ -87,8 +96,8 @@ class SiteController { null, mutableMapOf( "episode" to episode, - "simulcasts" to simulcasts, - "animes" to animes + "simulcastsUpdated" to simulcasts, + "animesUpdated" to animes ), contentType = ContentType.Text.Xml ) diff --git a/src/main/kotlin/fr/shikkanime/converters/anime/AnimeDtoToAnimeConverter.kt b/src/main/kotlin/fr/shikkanime/converters/anime/AnimeDtoToAnimeConverter.kt index 8b22577b..517fd1f7 100644 --- a/src/main/kotlin/fr/shikkanime/converters/anime/AnimeDtoToAnimeConverter.kt +++ b/src/main/kotlin/fr/shikkanime/converters/anime/AnimeDtoToAnimeConverter.kt @@ -2,7 +2,7 @@ package fr.shikkanime.converters.anime import com.google.inject.Inject import fr.shikkanime.converters.AbstractConverter -import fr.shikkanime.dtos.AnimeDto +import fr.shikkanime.dtos.animes.AnimeDto import fr.shikkanime.entities.Anime import fr.shikkanime.entities.Simulcast import fr.shikkanime.entities.enums.CountryCode diff --git a/src/main/kotlin/fr/shikkanime/converters/anime/AnimeToAnimeDtoConverter.kt b/src/main/kotlin/fr/shikkanime/converters/anime/AnimeToAnimeDtoConverter.kt index a64e1049..ebfd240d 100644 --- a/src/main/kotlin/fr/shikkanime/converters/anime/AnimeToAnimeDtoConverter.kt +++ b/src/main/kotlin/fr/shikkanime/converters/anime/AnimeToAnimeDtoConverter.kt @@ -1,13 +1,10 @@ package fr.shikkanime.converters.anime -import com.google.inject.Inject import fr.shikkanime.converters.AbstractConverter -import fr.shikkanime.dtos.AnimeDto -import fr.shikkanime.dtos.SimulcastDto +import fr.shikkanime.dtos.animes.AnimeDto import fr.shikkanime.dtos.enums.Status +import fr.shikkanime.dtos.simulcasts.SimulcastDto import fr.shikkanime.entities.Anime -import fr.shikkanime.entities.SortParameter -import fr.shikkanime.services.caches.EpisodeCacheService import fr.shikkanime.utils.StringUtils import fr.shikkanime.utils.withUTC import org.apache.tika.language.detect.LanguageDetector @@ -17,24 +14,13 @@ import java.time.format.DateTimeFormatter class AnimeToAnimeDtoConverter : AbstractConverter() { private val languageDetector: LanguageDetector = LanguageDetector.getDefaultLanguageDetector().loadModels() - @Inject - private lateinit var episodeCacheService: EpisodeCacheService - override fun convert(from: Anime): AnimeDto { - val lastReleaseDate = episodeCacheService.findAllBy( - from.countryCode!!, - from.uuid, - listOf(SortParameter("releaseDateTime", SortParameter.Order.DESC)), - 1, - 1 - )?.data?.firstOrNull()?.releaseDateTime - val status = if ( from.image.isNullOrBlank() || from.banner.isNullOrBlank() || from.description.isNullOrBlank() || from.description?.startsWith("(") == true || - languageDetector.detect(from.description).language.lowercase() != from.countryCode.name.lowercase() + languageDetector.detect(from.description).language.lowercase() != from.countryCode!!.name.lowercase() ) Status.INVALID else Status.VALID return AnimeDto( @@ -43,7 +29,7 @@ class AnimeToAnimeDtoConverter : AbstractConverter() { .format(DateTimeFormatter.ISO_OFFSET_DATE_TIME), image = from.image, banner = from.banner, - countryCode = from.countryCode, + countryCode = from.countryCode!!, name = from.name!!, shortName = StringUtils.getShortName(from.name!!), description = from.description, @@ -53,7 +39,6 @@ class AnimeToAnimeDtoConverter : AbstractConverter() { ) else null, status = status, slug = from.slug, - lastReleaseDateTime = lastReleaseDate ) } } \ No newline at end of file diff --git a/src/main/kotlin/fr/shikkanime/converters/anime/AnimeToUpdatedAnimeDtoConverter.kt b/src/main/kotlin/fr/shikkanime/converters/anime/AnimeToUpdatedAnimeDtoConverter.kt new file mode 100644 index 00000000..9c860c12 --- /dev/null +++ b/src/main/kotlin/fr/shikkanime/converters/anime/AnimeToUpdatedAnimeDtoConverter.kt @@ -0,0 +1,59 @@ +package fr.shikkanime.converters.anime + +import com.google.inject.Inject +import fr.shikkanime.converters.AbstractConverter +import fr.shikkanime.dtos.animes.UpdatedAnimeDto +import fr.shikkanime.dtos.enums.Status +import fr.shikkanime.dtos.simulcasts.SimulcastDto +import fr.shikkanime.entities.Anime +import fr.shikkanime.entities.SortParameter +import fr.shikkanime.services.caches.EpisodeCacheService +import fr.shikkanime.utils.StringUtils +import fr.shikkanime.utils.withUTC +import org.apache.tika.language.detect.LanguageDetector +import org.hibernate.Hibernate +import java.time.format.DateTimeFormatter + +class AnimeToUpdatedAnimeDtoConverter : AbstractConverter() { + private val languageDetector: LanguageDetector = LanguageDetector.getDefaultLanguageDetector().loadModels() + + @Inject + private lateinit var episodeCacheService: EpisodeCacheService + + override fun convert(from: Anime): UpdatedAnimeDto { + val lastReleaseDate = episodeCacheService.findAllBy( + from.countryCode!!, + from.uuid, + listOf(SortParameter("releaseDateTime", SortParameter.Order.DESC)), + 1, + 1 + )?.data?.firstOrNull()?.releaseDateTime + + val status = if ( + from.image.isNullOrBlank() || + from.banner.isNullOrBlank() || + from.description.isNullOrBlank() || + from.description?.startsWith("(") == true || + languageDetector.detect(from.description).language.lowercase() != from.countryCode.name.lowercase() + ) Status.INVALID else Status.VALID + + return UpdatedAnimeDto( + uuid = from.uuid, + releaseDateTime = from.releaseDateTime.withUTC() + .format(DateTimeFormatter.ISO_OFFSET_DATE_TIME), + image = from.image, + banner = from.banner, + countryCode = from.countryCode, + name = from.name!!, + shortName = StringUtils.getShortName(from.name!!), + description = from.description, + simulcasts = if (Hibernate.isInitialized(from.simulcasts)) convert( + from.simulcasts, + SimulcastDto::class.java + ) else null, + status = status, + slug = from.slug, + lastReleaseDateTime = lastReleaseDate + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/fr/shikkanime/converters/episode/EpisodeToEpisodeDtoConverter.kt b/src/main/kotlin/fr/shikkanime/converters/episode/EpisodeToEpisodeDtoConverter.kt index 1864c2d4..60637bc7 100644 --- a/src/main/kotlin/fr/shikkanime/converters/episode/EpisodeToEpisodeDtoConverter.kt +++ b/src/main/kotlin/fr/shikkanime/converters/episode/EpisodeToEpisodeDtoConverter.kt @@ -1,8 +1,8 @@ package fr.shikkanime.converters.episode import fr.shikkanime.converters.AbstractConverter -import fr.shikkanime.dtos.AnimeDto import fr.shikkanime.dtos.EpisodeDto +import fr.shikkanime.dtos.animes.AnimeDto import fr.shikkanime.entities.Episode import fr.shikkanime.utils.withUTC import java.time.format.DateTimeFormatter diff --git a/src/main/kotlin/fr/shikkanime/converters/simulcast/SimulcastDtoToSimulcastConverter.kt b/src/main/kotlin/fr/shikkanime/converters/simulcast/SimulcastDtoToSimulcastConverter.kt index ac8fd5e9..e776b8d5 100644 --- a/src/main/kotlin/fr/shikkanime/converters/simulcast/SimulcastDtoToSimulcastConverter.kt +++ b/src/main/kotlin/fr/shikkanime/converters/simulcast/SimulcastDtoToSimulcastConverter.kt @@ -2,7 +2,7 @@ package fr.shikkanime.converters.simulcast import com.google.inject.Inject import fr.shikkanime.converters.AbstractConverter -import fr.shikkanime.dtos.SimulcastDto +import fr.shikkanime.dtos.simulcasts.SimulcastDto import fr.shikkanime.entities.Simulcast import fr.shikkanime.services.SimulcastService diff --git a/src/main/kotlin/fr/shikkanime/converters/simulcast/SimulcastToSimulcastDtoConverter.kt b/src/main/kotlin/fr/shikkanime/converters/simulcast/SimulcastToSimulcastDtoConverter.kt index a193972b..d2781842 100644 --- a/src/main/kotlin/fr/shikkanime/converters/simulcast/SimulcastToSimulcastDtoConverter.kt +++ b/src/main/kotlin/fr/shikkanime/converters/simulcast/SimulcastToSimulcastDtoConverter.kt @@ -1,26 +1,11 @@ package fr.shikkanime.converters.simulcast -import com.google.inject.Inject import fr.shikkanime.converters.AbstractConverter -import fr.shikkanime.dtos.SimulcastDto +import fr.shikkanime.dtos.simulcasts.SimulcastDto import fr.shikkanime.entities.Simulcast -import fr.shikkanime.entities.SortParameter -import fr.shikkanime.entities.enums.CountryCode -import fr.shikkanime.services.caches.AnimeCacheService class SimulcastToSimulcastDtoConverter : AbstractConverter() { - @Inject - private lateinit var animeCacheService: AnimeCacheService - override fun convert(from: Simulcast): SimulcastDto { - val lastReleaseDateTime = animeCacheService.findAllBy( - CountryCode.FR, - from.uuid, - listOf(SortParameter("releaseDateTime", SortParameter.Order.DESC)), - 1, - 1 - )?.data?.firstOrNull()?.releaseDateTime - return SimulcastDto( uuid = from.uuid, season = from.season!!, @@ -33,7 +18,6 @@ class SimulcastToSimulcastDtoConverter : AbstractConverter "Automne" else -> "Inconnu" } + " ${from.year}", - lastReleaseDateTime = lastReleaseDateTime ) } } \ No newline at end of file diff --git a/src/main/kotlin/fr/shikkanime/converters/simulcast/SimulcastToUpdatedSimulcastDtoConverter.kt b/src/main/kotlin/fr/shikkanime/converters/simulcast/SimulcastToUpdatedSimulcastDtoConverter.kt new file mode 100644 index 00000000..57de40ff --- /dev/null +++ b/src/main/kotlin/fr/shikkanime/converters/simulcast/SimulcastToUpdatedSimulcastDtoConverter.kt @@ -0,0 +1,39 @@ +package fr.shikkanime.converters.simulcast + +import com.google.inject.Inject +import fr.shikkanime.converters.AbstractConverter +import fr.shikkanime.dtos.simulcasts.UpdatedSimulcastDto +import fr.shikkanime.entities.Simulcast +import fr.shikkanime.entities.SortParameter +import fr.shikkanime.entities.enums.CountryCode +import fr.shikkanime.services.caches.AnimeCacheService + +class SimulcastToUpdatedSimulcastDtoConverter : AbstractConverter() { + @Inject + private lateinit var animeCacheService: AnimeCacheService + + override fun convert(from: Simulcast): UpdatedSimulcastDto { + val lastReleaseDateTime = animeCacheService.findAllBy( + CountryCode.FR, + from.uuid, + listOf(SortParameter("releaseDateTime", SortParameter.Order.DESC)), + 1, + 1 + )?.data?.firstOrNull()?.releaseDateTime + + return UpdatedSimulcastDto( + uuid = from.uuid, + season = from.season!!, + year = from.year!!, + slug = "${from.season.lowercase()}-${from.year}", + label = when (from.season) { + "WINTER" -> "Hiver" + "SPRING" -> "Printemps" + "SUMMER" -> "Été" + "AUTUMN" -> "Automne" + else -> "Inconnu" + } + " ${from.year}", + lastReleaseDateTime = lastReleaseDateTime + ) + } +} \ No newline at end of file diff --git a/src/main/kotlin/fr/shikkanime/dtos/EpisodeDto.kt b/src/main/kotlin/fr/shikkanime/dtos/EpisodeDto.kt index d1e82959..a3301f28 100644 --- a/src/main/kotlin/fr/shikkanime/dtos/EpisodeDto.kt +++ b/src/main/kotlin/fr/shikkanime/dtos/EpisodeDto.kt @@ -1,5 +1,6 @@ package fr.shikkanime.dtos +import fr.shikkanime.dtos.animes.AnimeDto import fr.shikkanime.entities.enums.EpisodeType import fr.shikkanime.entities.enums.LangType import fr.shikkanime.entities.enums.Platform diff --git a/src/main/kotlin/fr/shikkanime/dtos/AnimeDto.kt b/src/main/kotlin/fr/shikkanime/dtos/animes/AnimeDto.kt similarity index 85% rename from src/main/kotlin/fr/shikkanime/dtos/AnimeDto.kt rename to src/main/kotlin/fr/shikkanime/dtos/animes/AnimeDto.kt index 0647e37a..26100a06 100644 --- a/src/main/kotlin/fr/shikkanime/dtos/AnimeDto.kt +++ b/src/main/kotlin/fr/shikkanime/dtos/animes/AnimeDto.kt @@ -1,6 +1,7 @@ -package fr.shikkanime.dtos +package fr.shikkanime.dtos.animes import fr.shikkanime.dtos.enums.Status +import fr.shikkanime.dtos.simulcasts.SimulcastDto import fr.shikkanime.entities.enums.CountryCode import java.io.Serializable import java.util.* @@ -17,5 +18,4 @@ data class AnimeDto( val simulcasts: List?, val status: Status? = null, val slug: String? = null, - val lastReleaseDateTime: String? = null ) : Serializable diff --git a/src/main/kotlin/fr/shikkanime/dtos/animes/UpdatedAnimeDto.kt b/src/main/kotlin/fr/shikkanime/dtos/animes/UpdatedAnimeDto.kt new file mode 100644 index 00000000..2e2253d1 --- /dev/null +++ b/src/main/kotlin/fr/shikkanime/dtos/animes/UpdatedAnimeDto.kt @@ -0,0 +1,22 @@ +package fr.shikkanime.dtos.animes + +import fr.shikkanime.dtos.enums.Status +import fr.shikkanime.dtos.simulcasts.SimulcastDto +import fr.shikkanime.entities.enums.CountryCode +import java.io.Serializable +import java.util.* + +data class UpdatedAnimeDto( + val uuid: UUID?, + val countryCode: CountryCode, + var name: String, + var shortName: String, + var releaseDateTime: String, + val image: String? = null, + val banner: String? = null, + val description: String?, + val simulcasts: List?, + val status: Status? = null, + val slug: String? = null, + val lastReleaseDateTime: String? = null +) : Serializable diff --git a/src/main/kotlin/fr/shikkanime/dtos/simulcasts/SimulcastDto.kt b/src/main/kotlin/fr/shikkanime/dtos/simulcasts/SimulcastDto.kt new file mode 100644 index 00000000..1b8c72ad --- /dev/null +++ b/src/main/kotlin/fr/shikkanime/dtos/simulcasts/SimulcastDto.kt @@ -0,0 +1,12 @@ +package fr.shikkanime.dtos.simulcasts + +import java.io.Serializable +import java.util.* + +data class SimulcastDto( + val uuid: UUID?, + val season: String, + val year: Int, + val slug: String, + val label: String, +) : Serializable diff --git a/src/main/kotlin/fr/shikkanime/dtos/SimulcastDto.kt b/src/main/kotlin/fr/shikkanime/dtos/simulcasts/UpdatedSimulcastDto.kt similarity index 75% rename from src/main/kotlin/fr/shikkanime/dtos/SimulcastDto.kt rename to src/main/kotlin/fr/shikkanime/dtos/simulcasts/UpdatedSimulcastDto.kt index a2e7ba29..a950d0c8 100644 --- a/src/main/kotlin/fr/shikkanime/dtos/SimulcastDto.kt +++ b/src/main/kotlin/fr/shikkanime/dtos/simulcasts/UpdatedSimulcastDto.kt @@ -1,9 +1,9 @@ -package fr.shikkanime.dtos +package fr.shikkanime.dtos.simulcasts import java.io.Serializable import java.util.* -data class SimulcastDto( +data class UpdatedSimulcastDto( val uuid: UUID?, val season: String, val year: Int, diff --git a/src/main/kotlin/fr/shikkanime/services/caches/AnimeCacheService.kt b/src/main/kotlin/fr/shikkanime/services/caches/AnimeCacheService.kt index c626fffd..51617387 100644 --- a/src/main/kotlin/fr/shikkanime/services/caches/AnimeCacheService.kt +++ b/src/main/kotlin/fr/shikkanime/services/caches/AnimeCacheService.kt @@ -4,8 +4,9 @@ import com.google.inject.Inject import fr.shikkanime.caches.CountryCodeNamePaginationKeyCache import fr.shikkanime.caches.CountryCodeUUIDSortPaginationKeyCache import fr.shikkanime.converters.AbstractConverter -import fr.shikkanime.dtos.AnimeDto import fr.shikkanime.dtos.PageableDto +import fr.shikkanime.dtos.animes.AnimeDto +import fr.shikkanime.dtos.animes.UpdatedAnimeDto import fr.shikkanime.entities.Anime import fr.shikkanime.entities.SortParameter import fr.shikkanime.entities.enums.CountryCode @@ -25,6 +26,14 @@ class AnimeCacheService : AbstractCacheService() { ) } + private val findAllByUpdatedCache = + MapCache>(classes = listOf(Anime::class.java)) { + PageableDto.fromPageable( + animeService.findAllBy(it.countryCode, it.uuid, it.sort, it.page, it.limit), + UpdatedAnimeDto::class.java + ) + } + private val findAllByNameCache = MapCache>(classes = listOf(Anime::class.java)) { PageableDto.fromPageable( animeService.findAllByName(it.name, it.countryCode, it.page, it.limit), @@ -52,6 +61,14 @@ class AnimeCacheService : AbstractCacheService() { limit: Int ) = findAllByCache[CountryCodeUUIDSortPaginationKeyCache(countryCode, uuid, sort, page, limit)] + fun findAllByUpdated( + countryCode: CountryCode?, + uuid: UUID?, + sort: List, + page: Int, + limit: Int + ) = findAllByUpdatedCache[CountryCodeUUIDSortPaginationKeyCache(countryCode, uuid, sort, page, limit)] + fun findAllByName(name: String, countryCode: CountryCode?, page: Int, limit: Int) = findAllByNameCache[CountryCodeNamePaginationKeyCache(countryCode, name, page, limit)] diff --git a/src/main/kotlin/fr/shikkanime/services/caches/SimulcastCacheService.kt b/src/main/kotlin/fr/shikkanime/services/caches/SimulcastCacheService.kt index c9b97749..868f39c6 100644 --- a/src/main/kotlin/fr/shikkanime/services/caches/SimulcastCacheService.kt +++ b/src/main/kotlin/fr/shikkanime/services/caches/SimulcastCacheService.kt @@ -2,7 +2,8 @@ package fr.shikkanime.services.caches import com.google.inject.Inject import fr.shikkanime.converters.AbstractConverter -import fr.shikkanime.dtos.SimulcastDto +import fr.shikkanime.dtos.simulcasts.SimulcastDto +import fr.shikkanime.dtos.simulcasts.UpdatedSimulcastDto import fr.shikkanime.entities.Simulcast import fr.shikkanime.services.SimulcastService import fr.shikkanime.utils.MapCache @@ -15,5 +16,10 @@ class SimulcastCacheService : AbstractCacheService() { AbstractConverter.convert(simulcastService.findAll(), SimulcastDto::class.java) } + private val updatedCache = MapCache>(classes = listOf(Simulcast::class.java)) { + AbstractConverter.convert(simulcastService.findAll(), UpdatedSimulcastDto::class.java) + } + fun findAll() = cache["all"] + fun findAllUpdated() = updatedCache["all"] } \ No newline at end of file diff --git a/src/main/resources/templates/_freemarker_implicit.ftl b/src/main/resources/templates/_freemarker_implicit.ftl index 43459cdc..20ba3e85 100644 --- a/src/main/resources/templates/_freemarker_implicit.ftl +++ b/src/main/resources/templates/_freemarker_implicit.ftl @@ -7,17 +7,19 @@ [#-- @ftlvariable name="platforms" type="kotlin.collections.AbstractList" --] [#-- @ftlvariable name="platform" type="fr.shikkanime.entities.enums.Platform" --] [#-- @ftlvariable name="error" type="kotlin.NumbersKt" --] -[#-- @ftlvariable name="anime" type="fr.shikkanime.dtos.AnimeDto" --] +[#-- @ftlvariable name="anime" type="fr.shikkanime.dtos.animes.AnimeDto" --] [#-- @ftlvariable name="simulcast_config" type="fr.shikkanime.platforms.configuration.PlatformSimulcast" --] [#-- @ftlvariable name="episode" type="fr.shikkanime.dtos.EpisodeDto" --] [#-- @ftlvariable name="episodeTypes" type="kotlin.collections.AbstractList" --] [#-- @ftlvariable name="langTypes" type="kotlin.collections.AbstractList" --] [#-- @ftlvariable name="config" type="fr.shikkanime.dtos.ConfigDto" --] -[#-- @ftlvariable name="animes" type="kotlin.collections.AbstractList" --] +[#-- @ftlvariable name="animes" type="kotlin.collections.AbstractList" --] [#-- @ftlvariable name="episodes" type="kotlin.collections.AbstractList" --] [#-- @ftlvariable name="size" type="java.lang.Integer" --] [#-- @ftlvariable name="originalSize" type="java.lang.String" --] [#-- @ftlvariable name="compressedSize" type="java.lang.String" --] -[#-- @ftlvariable name="simulcasts" type="kotlin.collections.AbstractList" --] -[#-- @ftlvariable name="currentSimulcast" type="fr.shikkanime.dtos.SimulcastDto" --] -[#-- @ftlvariable name="googleSiteVerification" type="java.lang.String" --] \ No newline at end of file +[#-- @ftlvariable name="simulcasts" type="kotlin.collections.AbstractList" --] +[#-- @ftlvariable name="currentSimulcast" type="fr.shikkanime.dtos.simulcasts.SimulcastDto" --] +[#-- @ftlvariable name="googleSiteVerification" type="java.lang.String" --] +[#-- @ftlvariable name="animesUpdated" type="kotlin.collections.AbstractList" --] +[#-- @ftlvariable name="simulcastsUpdated" type="kotlin.collections.AbstractList" --] \ No newline at end of file diff --git a/src/main/resources/templates/site/anime.ftl b/src/main/resources/templates/site/anime.ftl index f89e56ed..46da6eb0 100644 --- a/src/main/resources/templates/site/anime.ftl +++ b/src/main/resources/templates/site/anime.ftl @@ -17,7 +17,7 @@ -
+
<#list episodes as episode> <@episodeComponent.display episode=episode /> diff --git a/src/main/resources/templates/site/catalog.ftl b/src/main/resources/templates/site/catalog.ftl index 95d0e268..398ca3fc 100644 --- a/src/main/resources/templates/site/catalog.ftl +++ b/src/main/resources/templates/site/catalog.ftl @@ -14,7 +14,7 @@ -
+
<#list animes as anime> <@animeComponent.display anime=anime /> diff --git a/src/main/resources/templates/site/home.ftl b/src/main/resources/templates/site/home.ftl index 84431ea5..f08d3731 100644 --- a/src/main/resources/templates/site/home.ftl +++ b/src/main/resources/templates/site/home.ftl @@ -3,30 +3,26 @@ <#import "components/anime.ftl" as animeComponent /> <@navigation.display> -
-

Nouveaux épisodes

+

Nouveaux épisodes

-
- <#list episodes as episode> - <@episodeComponent.display episode=episode /> - -
+
+ <#list episodes as episode> + <@episodeComponent.display episode=episode /> +
-
-
-

Simulcast en cours

- - PLUS - - -
+
+

Simulcast en cours

+ + PLUS + + +
-
- <#list animes as anime> - <@animeComponent.display anime=anime /> - -
+
+ <#list animes as anime> + <@animeComponent.display anime=anime /> +
diff --git a/src/main/resources/templates/site/seo/sitemap.ftl b/src/main/resources/templates/site/seo/sitemap.ftl index a2996a27..8d97bf04 100644 --- a/src/main/resources/templates/site/seo/sitemap.ftl +++ b/src/main/resources/templates/site/seo/sitemap.ftl @@ -4,13 +4,13 @@ https://www.shikkanime.fr/ ${episode.releaseDateTime?replace("Z", "+00:00")} - <#list simulcasts as simulcast> + <#list simulcastsUpdated as simulcast> https://www.shikkanime.fr/catalog/${simulcast.slug} ${simulcast.lastReleaseDateTime?replace("Z", "+00:00")} - <#list animes as anime> + <#list animesUpdated as anime> https://www.shikkanime.fr/animes/${anime.slug} ${anime.lastReleaseDateTime?replace("Z", "+00:00")} diff --git a/src/test/kotlin/fr/shikkanime/controllers/api/AnimeControllerTest.kt b/src/test/kotlin/fr/shikkanime/controllers/api/AnimeControllerTest.kt index 11854be3..dc08152f 100644 --- a/src/test/kotlin/fr/shikkanime/controllers/api/AnimeControllerTest.kt +++ b/src/test/kotlin/fr/shikkanime/controllers/api/AnimeControllerTest.kt @@ -3,9 +3,9 @@ package fr.shikkanime.controllers.api import com.google.gson.reflect.TypeToken import com.google.inject.Inject import fr.shikkanime.converters.AbstractConverter -import fr.shikkanime.dtos.AnimeDto import fr.shikkanime.dtos.MessageDto import fr.shikkanime.dtos.PageableDto +import fr.shikkanime.dtos.animes.AnimeDto import fr.shikkanime.entities.Anime import fr.shikkanime.entities.enums.CountryCode import fr.shikkanime.module diff --git a/src/test/kotlin/fr/shikkanime/controllers/api/EpisodeControllerTest.kt b/src/test/kotlin/fr/shikkanime/controllers/api/EpisodeControllerTest.kt index 10b9eeb7..aab87f3f 100644 --- a/src/test/kotlin/fr/shikkanime/controllers/api/EpisodeControllerTest.kt +++ b/src/test/kotlin/fr/shikkanime/controllers/api/EpisodeControllerTest.kt @@ -3,9 +3,9 @@ package fr.shikkanime.controllers.api import com.google.gson.reflect.TypeToken import com.google.inject.Inject import fr.shikkanime.converters.AbstractConverter -import fr.shikkanime.dtos.AnimeDto import fr.shikkanime.dtos.EpisodeDto import fr.shikkanime.dtos.PageableDto +import fr.shikkanime.dtos.animes.AnimeDto import fr.shikkanime.entities.Anime import fr.shikkanime.entities.Episode import fr.shikkanime.entities.enums.EpisodeType