Bug 398101 - Insufficient documentation
Summary: Insufficient documentation
Status: REPORTED
Alias: None
Product: frameworks-kfilemetadata
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.49.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Pinak Ahuja
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2018-08-31 16:32 UTC by yhi06754
Modified: 2023-11-16 20:46 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yhi06754 2018-08-31 16:32:08 UTC
Today I tried to write a simple external metadata plugin based on the documentation of your library [1] but it turns out at its current state it's near impossible to use it. To be clear I'm not a KDE dev, just a dev who uses KDE.

[1] https://phabricator.kde.org/source/kfilemetadata/browse/master/README.md

Here are my questions not answered by your documentation:


What's the usual `libexec` path on actual systems? Examples would be useful. Is it only possible to define external plugins on system-level or does it support plugins from the users' home directories?

What's the format of the required `manifest.json` files? There's an example in the tests directory but the actual JSON schema is not defined anywhere.

If every plugin is placed in the `libexec/kf5/kfilemetadata/externalextractors` directory how external extractors and external writers are distinguished? Shouldn't external writers be placed in a separate `libexec/kf5/kfilemetadata/externalwriters` directory?

The doc states both kind of plugins accept a file as an argument. This is too ambiguous. Is it a command-line argument, or is this refers to a field of the JSON stdin inputs? If this is a command-line argument, does it use a specific flag or it's always argument position one?

What format does external writers expect via the standard input? I assume it's JSON but it's not stated in the docs.

What's the actual format of JSON inputs and responses? No JSON schemas, no idea what my plugin could receive and should return.

What's the order of magnitude of the timeouts? Do I have 50 milliseconds or 50 seconds for my plugin to finish?

What happens if my plugin fails or crashes? Is it possible to retrieve the stderr of my plugin somehow via KFileMetaData for debugging reasons or should I provide my own logging functionality?

What happens if my plugin produces invalid output? How does KFileMetaData handles invalid output? Also there are no schemas for the JSON output so I cannot validate I'm sending valid responses.

How is it possible to check if my plugin is loaded by the users of this library like Dolphin or Baloo?


If you don't find these question unreasonable, would be useful to have your documentation updated with answers to them.
Comment 1 skierpage 2021-06-12 09:05:58 UTC
(In reply to yhi06754 from comment #0)
> If every plugin is placed in the
> `libexec/kf5/kfilemetadata/externalextractors` directory...

In Fedora 34, the plugin extractors are in /usr/lib64/qt5/plugins/kf5/kfilemetadata/ and the one writer is /usr/lib64/qt5/plugins/kf5/kfilemetadata/writers/kfilemetadata_taglibwriter.so . So README.md is even more wrong.
Comment 2 Stefan Brüns 2023-11-11 02:15:19 UTC
@skierpage - That are extractors implemented as shared libraries, not standalone executables for external extractors, so the README.md is correct.
Comment 3 Stefan Brüns 2023-11-16 20:46:25 UTC
Git commit e8a7446ad77f2259957e7bb3c325451fe7affe14 by Stefan Brüns.
Committed on 14/11/2023 at 02:02.
Pushed by bruns into branch 'master'.

[ExternalExtractorTest] Test TypeInfo and Properties

M  +8    -2    autotests/externalextractortest.cpp
M  +10   -2    autotests/samplefiles/testexternalextractor/main.py

https://invent.kde.org/frameworks/kfilemetadata/-/commit/e8a7446ad77f2259957e7bb3c325451fe7affe14