Skip to content

Commit

Permalink
Fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziedelth committed May 5, 2024
1 parent a62b3ac commit 7342b3a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ class EpisodeMappingService : AbstractService<EpisodeMapping, EpisodeMappingRepo
entity.variants.forEach { variantDto ->
val variant = episodeVariantService.find(variantDto.uuid) ?: return@forEach
variant.mapping = update

if (variantDto.releaseDateTime.isNotBlank() && variantDto.releaseDateTime != variant.releaseDateTime.toString()) {
variant.releaseDateTime = ZonedDateTime.parse(variantDto.releaseDateTime)
}

oldList.removeIf { it.uuid == variantDto.uuid }
episodeVariantService.update(variant)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class EpisodeVariantService : AbstractService<EpisodeVariant, EpisodeVariantRepo
)
)

MapCache.invalidate(EpisodeVariant::class.java)
MapCache.invalidate(EpisodeMapping::class.java, EpisodeVariant::class.java)
return savedEntity
}

Expand Down
20 changes: 15 additions & 5 deletions src/main/resources/templates/admin/episodes/edit.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
aria-describedby="basic-addon">

<a class="input-group-text" id="basic-addon"
@click="" style="cursor: pointer" target="_blank" x-bind:href="episode.image">
style="cursor: pointer" target="_blank" :href="episode.image">
<i class="bi bi-box-arrow-up-right"></i>
</a>
</div>
Expand All @@ -170,7 +170,8 @@
<label for="variantReleaseDateTime" class="form-label">Release date time</label>
<input type="datetime-local" class="form-control" id="variantReleaseDateTime"
name="variantReleaseDateTime"
x-model="variant.releaseDateTime.substring(0, 16)" disabled>
:value="variant.releaseDateTime.substring(0, 16)"
@input="variant.releaseDateTime = $event.target.value + ':00Z'">
</div>
<div class="col-md-auto">
<label for="variantPlatform" class="form-label">Platform</label>
Expand All @@ -192,8 +193,17 @@
</div>
<div class="col-md-auto">
<label for="variantUrl" class="form-label">URL</label>
<input type="text" class="form-control" id="variantUrl" name="variantUrl"
x-model="variant.url" disabled>

<div class="input-group">
<input type="text" class="form-control" id="variantUrl" name="variantUrl"
x-model="variant.url" aria-label="Image"
aria-describedby="basic-addon" disabled>

<a class="input-group-text" id="basic-addon" style="cursor: pointer"
target="_blank" :href="variant.url">
<i class="bi bi-box-arrow-up-right"></i>
</a>
</div>
</div>
<div class="col-md-auto">
<input type="checkbox" class="form-check-input" id="variantUncensored"
Expand All @@ -202,7 +212,7 @@
<label for="variantUncensored" class="form-label">Uncensored</label>
</div>
<div class="col-md-auto">
<img x-bind:src="'/api/v1/episode-mappings/' + variant.uuid + '/media-image'"
<img :src="'/api/v1/episode-mappings/' + variant.uuid + '/media-image'"
class="rounded-4 w-25" alt="Variant image">
</div>
</div>
Expand Down

0 comments on commit 7342b3a

Please sign in to comment.