Snd-R / komf

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

Feature request: Allow Komf to write a comicinfo file after fetching metadata #16

Closed aeryl1999 closed 1 year ago

aeryl1999 commented 2 years ago

If Komf was able to write the fetched metadata fields into a comicinfo.xml or json file this would help with migrating large libraries when copying the sqlite file is not possible. This could also be used a backup in case the db gets corrupted/overwritten. This could also help reduce metadata processing if series with comicinfo files are skipped unless forced.

Hope you consider this. Thanks

Snd-R commented 2 years ago

ComicInfo write is already supported, although not documented or fully tested. You can enable it with

komga:
  metadataUpdate:
    mode: "FILE_EMBED"

It will only write book level metadata and will only add publisher and authors from series level

I have plans to add series.json file write to series folder. From what I recall, komga reads both ComicInfo.xml and series.json when scanning

aeryl1999 commented 2 years ago

Any plans of adding descriptions and tags? Some series like isekai are hard to differentiate with title and authors alone

Snd-R commented 2 years ago

description is possible but tags are not part of the spec for either comicInfo.xml or series.json You'd have to use komga to store your tags

Snd-R commented 2 years ago

~~series.json write was added in https://github.com/Snd-R/komf/releases/tag/0.13.0. Check readme for new configuration For now I don't have plans for adding ComicInfo sidecar to series directory the same way as it's done with series.json as it's not really supported by komga or anything else~~

I'm thinking about implementing this with comicinfo alone. if provider only has series level metadata then the description and some other fields can be written to the first volume and komga will be able to display it at series level.

Also if you're looking for a way to get description check aggregate option. yenpress, kodansha, viz and bookwalker have book level metadata that almost always have description

aeryl1999 commented 2 years ago

Thanks for the update. I tried the latest update with modes: [API, COMIC_INFO] but it's returning the following error An error occurred while trying to identify series: Request method 'POST' not supported

Snd-R commented 2 years ago

Did it work before? I can't reproduce this. What's your config and Is there anything in komf logs? The error you describing is usually returned by komga and not komf. If you're using userscript for identification check the url of komf

aeryl1999 commented 2 years ago

Did it work before? I can't reproduce this. What's your config and Is there anything in komf logs? The error you describing is usually returned by komga and not komf. If you're using userscript for identification check the url of komf

nvm. I got it working. Going to use this to insert comicinfo for every series. All it needs now is the description or summary. Tried to enable every metadata provider but it keeps failing to add a summary. Only the following were printed

<?xml version="1.0" encoding="UTF-8"?>
<ComicInfo>
  <Writer>HINO Haruto</Writer>
  <Penciller>HINO Haruto</Penciller>
  <Inker>HINO Haruto</Inker>
  <Colorist>HINO Haruto</Colorist>
  <Letterer>HINO Haruto</Letterer>
  <CoverArtist>HINO Haruto</CoverArtist>
  <Editor></Editor>
  <Translator></Translator>
  <Publisher>Kadokawa</Publisher>
  <Genre>Comedy,Romance,Shounen,Slice of Life</Genre>
</ComicInfo>
Snd-R commented 2 years ago

Komf detects volume number by filename. If it can't find volume number it won't set specific metadata for that book and will only set common metadata like in your example

Detection only works for volumes and komf will detect book as volume if filename contains v<number> or t<number> in the filename

Snd-R commented 1 year ago

issue seem to have been resolved. Closing