From 9821b2cebd41c4f33266de8b4d13bd3af1f4cf31 Mon Sep 17 00:00:00 2001 From: Snd-R <76580768+snd-r@users.noreply.github.com> Date: Thu, 9 Feb 2023 11:36:55 +0300 Subject: [PATCH] add update progress logs. closes #41 --- src/main/kotlin/org/snd/mediaserver/MetadataUpdateService.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/kotlin/org/snd/mediaserver/MetadataUpdateService.kt b/src/main/kotlin/org/snd/mediaserver/MetadataUpdateService.kt index b9cf11f4..64376594 100644 --- a/src/main/kotlin/org/snd/mediaserver/MetadataUpdateService.kt +++ b/src/main/kotlin/org/snd/mediaserver/MetadataUpdateService.kt @@ -1,5 +1,6 @@ package org.snd.mediaserver +import mu.KotlinLogging import org.snd.mediaserver.UpdateMode.API import org.snd.mediaserver.UpdateMode.COMIC_INFO import org.snd.mediaserver.model.MediaServerBook @@ -20,6 +21,8 @@ import org.snd.metadata.model.Image import org.snd.metadata.model.SeriesMetadata import java.nio.file.Path +private val logger = KotlinLogging.logger {} + class MetadataUpdateService( private val mediaServerClient: MediaServerClient, private val seriesThumbnailsRepository: SeriesThumbnailsRepository, @@ -47,6 +50,7 @@ class MetadataUpdateService( updateModes.forEach { when (it) { API -> { + logger.info { "updating series ${series.name}" } val metadataUpdate = metadataUpdateMapper.toSeriesMetadataUpdate(metadata, series.metadata) mediaServerClient.updateSeriesMetadata(series.id, metadataUpdate) } @@ -89,6 +93,7 @@ class MetadataUpdateService( seriesMeta: SeriesMetadata, writeSeriesMetadata: Boolean ) { + logger.info { "updating book ${book.name}" } updateModes.forEach { mode -> when (mode) { API -> metadataUpdateMapper.toBookMetadataUpdate(metadata, seriesMeta, book)