Snd-R / komf

Komga and Kavita metadata fetcher
MIT License
314 stars 19 forks source link

UnkownPropertyException with example config #27

Closed papaj-na-wrotkach closed 1 year ago

papaj-na-wrotkach commented 1 year ago

I tried to make my config (based on the example config)

komga:
  baseUri: http://localhost:8080 #or env:KOMF_KOMGA_BASE_URI
  komgaUser: email@example.com #or env:KOMF_KOMGA_USER
  komgaPassword: pass #or env:KOMF_KOMGA_PASSWORD
  eventListener:
    enabled: false # if disabled will not connect to komga and won't pick up newly added entries
    libraries: [ ]  # listen to all events if empty
  notifications:
    libraries: [ ]  # Will send notifications if any notification source is enabled. If empty will send notifications for all libraries
  aggregateMetadata: true #if enabled will search and aggregate metadata from all configured providers
  metadataUpdate:
    # Update modes is the way komf will update metadata.
    # If you're using anything other than API then your existing files might be modified with embedded metadata
    modes: [ COMIC_INFO ] # can use multiple options at once. available options are API, COMIC_INFO
    bookThumbnails: false # update book thumbnails
    seriesThumbnails: false # update series thumbnails
    seriesTitle: true # update series title
    titleType: LOCALIZED # "LOCALIZED" "ROMAJI" or "NATIVE"
    readingDirectionValue: RIGHT_TO_LEFT # override reading direction for all series. should be one of these: LEFT_TO_RIGHT, RIGHT_TO_LEFT, VERTICAL, WEBTOON
    languageValue: en # set default language for series. Must use BCP 47 format e.g. "en"
    orderBooks: true # will order books using parsed volume or chapter number
kavita:
  baseUri: "http://localhost:5000" #or env:KOMF_KAVITA_BASE_URI
  apiKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" #or env:KOMF_KAVITA_API_KEY
  eventListener:
    enabled: true # if disabled will not connect to kavita and won't pick up newly added entries
    libraries: [ ]  # listen to all events if empty
  notifications:
    libraries: [ ]  # Will send notifications if any notification source is enabled. If empty will send notifications for all libraries
  aggregateMetadata: true #if enabled will search and aggregate metadata from all configured providers
  metadataUpdate:
    # Update modes is the way komf will update metadata.
    # If you're using anything other than API then your existing files might be modified with embedded metadata
    modes: [ COMIC_INFO ] # can use multiple options at once. available options are API, COMIC_INFO
    bookThumbnails: false #update book thumbnails
    seriesThumbnails: false #update series thumbnails
    seriesTitle: true #update series title
    titleType: LOCALIZED # Can be "LOCALIZED" "ROMAJI" or "NATIVE". Sets Localized Name api field and series comicinfo field.
    languageValue: en # set default language for series. Must use BCP 47 format e.g. "en"
discord:
  webhooks: #list of discord webhook urls. Will call these webhooks after series or books were added
  templatesDirectory: "./" #path to a directory with discordWebhook.vm template
database:
  file: ./database.sqlite #database file location.
metadataProviders:
  mangaUpdates:
    priority: 80
    enabled: true
    seriesMetadata:
      useOriginalPublisher: false
  mal: #requires clientId. See https://myanimelist.net/forum/?topicid=1973077
    clientId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    priority: 80
    enabled: true
  nautiljon:
    priority: 90
    enabled: true
  aniList:
    priority: 80
    enabled: true
  yenPress:
    priority: 20
    enabled: true
  kodansha:
    priority: 20
    enabled: true
  viz:
    priority: 20
    enabled: true
  bookWalker:
    priority: 80
    enabled: true
server:
  port: 8085 #or env:KOMF_SERVER_PORT
logLevel: INFO #or env:KOMF_LOG_LEVEL

output:

18:28:18.198 [main] ERROR org.snd.Application - Failed to start the app
com.charleskorn.kaml.UnknownPropertyException: Unknown property 'titleType'. Known properties are: bookThumbnails, mode, modes, readingDirectionValue, seriesThumbnails, seriesTitle
        at com.charleskorn.kaml.YamlObjectInput.throwUnknownProperty(YamlObjectInput.kt:73)
        at com.charleskorn.kaml.YamlObjectInput.decodeElementIndex(YamlObjectInput.kt:43)
        at org.snd.config.MetadataUpdateConfig$$serializer.deserialize(AppConfig.kt:49)
        at org.snd.config.MetadataUpdateConfig$$serializer.deserialize(AppConfig.kt:49)
        at kotlinx.serialization.encoding.Decoder$DefaultImpls.decodeSerializableValue(Decoding.kt:257)
        at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:16)
        at com.charleskorn.kaml.YamlInput.decodeSerializableValue(YamlInput.kt:103)
        at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
        at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70)
        at org.snd.config.KomgaConfig$$serializer.deserialize(AppConfig.kt:21)
        at org.snd.config.KomgaConfig$$serializer.deserialize(AppConfig.kt:21)
        at kotlinx.serialization.encoding.Decoder$DefaultImpls.decodeSerializableValue(Decoding.kt:257)
        at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:16)
        at com.charleskorn.kaml.YamlInput.decodeSerializableValue(YamlInput.kt:103)
        at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:43)
        at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:70)
        at org.snd.config.AppConfig$$serializer.deserialize(AppConfig.kt:10)
        at org.snd.config.AppConfig$$serializer.deserialize(AppConfig.kt:10)
        at kotlinx.serialization.encoding.Decoder$DefaultImpls.decodeSerializableValue(Decoding.kt:257)
        at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:16)
        at com.charleskorn.kaml.YamlInput.decodeSerializableValue(YamlInput.kt:103)
        at com.charleskorn.kaml.Yaml.decodeFromReader(Yaml.kt:54)
        at com.charleskorn.kaml.Yaml.decodeFromString(Yaml.kt:43)
        at org.snd.infra.ConfigLoader.loadConfig(ConfigLoader.kt:17)
        at org.snd.cli.Komf.run(Komf.kt:32)
        at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:198)
        at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:18)
        at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:400)
        at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:397)
        at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:415)
        at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:440)
        at org.snd.ApplicationKt.main(Application.kt:18)

I tried to comment out all titleType, languageValue and orderBooks fields, which cause the exception and now app starts

komga:
  baseUri: http://localhost:8080 #or env:KOMF_KOMGA_BASE_URI
  komgaUser: email@example.com #or env:KOMF_KOMGA_USER
  komgaPassword: pass #or env:KOMF_KOMGA_PASSWORD
  eventListener:
    enabled: false # if disabled will not connect to komga and won't pick up newly added entries
    libraries: [ ]  # listen to all events if empty
  notifications:
    libraries: [ ]  # Will send notifications if any notification source is enabled. If empty will send notifications for all libraries
  aggregateMetadata: true #if enabled will search and aggregate metadata from all configured providers
  metadataUpdate:
    # Update modes is the way komf will update metadata.
    # If you're using anything other than API then your existing files might be modified with embedded metadata
    modes: [ COMIC_INFO ] # can use multiple options at once. available options are API, COMIC_INFO
    bookThumbnails: false # update book thumbnails
    seriesThumbnails: false # update series thumbnails
    seriesTitle: true # update series title
    # titleType: LOCALIZED # "LOCALIZED" "ROMAJI" or "NATIVE"
    readingDirectionValue: RIGHT_TO_LEFT # override reading direction for all series. should be one of these: LEFT_TO_RIGHT, RIGHT_TO_LEFT, VERTICAL, WEBTOON
    # languageValue: en # set default language for series. Must use BCP 47 format e.g. "en"
    # orderBooks: true # will order books using parsed volume or chapter number
kavita:
  baseUri: "http://localhost:5000" #or env:KOMF_KAVITA_BASE_URI
  apiKey: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" #or env:KOMF_KAVITA_API_KEY
  eventListener:
    enabled: true # if disabled will not connect to kavita and won't pick up newly added entries
    libraries: [ ]  # listen to all events if empty
  notifications:
    libraries: [ ]  # Will send notifications if any notification source is enabled. If empty will send notifications for all libraries
  aggregateMetadata: true #if enabled will search and aggregate metadata from all configured providers
  metadataUpdate:
    # Update modes is the way komf will update metadata.
    # If you're using anything other than API then your existing files might be modified with embedded metadata
    modes: [ COMIC_INFO ] # can use multiple options at once. available options are API, COMIC_INFO
    bookThumbnails: false #update book thumbnails
    seriesThumbnails: false #update series thumbnails
    seriesTitle: true #update series title
    # titleType: LOCALIZED # Can be "LOCALIZED" "ROMAJI" or "NATIVE". Sets Localized Name api field and series comicinfo field.
    # languageValue: en # set default language for series. Must use BCP 47 format e.g. "en"
discord:
  webhooks: #list of discord webhook urls. Will call these webhooks after series or books were added
  templatesDirectory: "./" #path to a directory with discordWebhook.vm template
database:
  file: ./database.sqlite #database file location.
metadataProviders:
  mangaUpdates:
    priority: 80
    enabled: true
    seriesMetadata:
      useOriginalPublisher: false
  mal: #requires clientId. See https://myanimelist.net/forum/?topicid=1973077
    clientId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    priority: 80
    enabled: true
  nautiljon:
    priority: 90
    enabled: true
  aniList:
    priority: 80
    enabled: true
  yenPress:
    priority: 20
    enabled: true
  kodansha:
    priority: 20
    enabled: true
  viz:
    priority: 20
    enabled: true
  bookWalker:
    priority: 80
    enabled: true
server:
  port: 8085 #or env:KOMF_SERVER_PORT
logLevel: INFO #or env:KOMF_LOG_LEVEL

Did the mentioned fields' names change or are they not supported anymore?

Snd-R commented 1 year ago

Sorry, I pushed example config changes before releasing new version. Check latest release https://github.com/Snd-R/komf/releases/tag/0.16.0