Skip to content

Commit

Permalink
add update progress logs. closes #41
Browse files Browse the repository at this point in the history
  • Loading branch information
Snd-R committed Feb 9, 2023
1 parent 17ad1bd commit 9821b2c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/kotlin/org/snd/mediaserver/MetadataUpdateService.kt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9821b2c

Please sign in to comment.