Is it currently possible or would it be feasible to have *.groovy files as arguments to the --db option?
This would make the database support easier to extend (e.g. I'm interested in IMVDb which is niche but has an official API).
Custom databases via --db db.groovy
Custom databases via --db db.groovy
I only work in black and sometimes very, very dark grey. (Batman)
Re: Custom databases via --db db.groovy
Sorry, not supported.
Re: Custom databases via --db db.groovy
I've seen quite a few posts requesting niche databases to be added, like SetList.fm, something for books, comics, and alternative TV/movie DBs.
I realise adding support for all would be completely unfeasible, but would a pluggable DB be feasible?
Scripts would just have to perform requests to an API (likely with personal keys) and return a flexible structure (?) to FileBot for further processing.
Maybe this could be considered as a feature request for v5?
I realise adding support for all would be completely unfeasible, but would a pluggable DB be feasible?
Scripts would just have to perform requests to an API (likely with personal keys) and return a flexible structure (?) to FileBot for further processing.
Maybe this could be considered as a feature request for v5?
I only work in black and sometimes very, very dark grey. (Batman)
Re: Custom databases via --db db.groovy
Well, the main reason we don't have support for niche databases isn't APIs, those can be implemented in a day or two. The problem is support for niche content types. FileBot has no way of identifying and matching "books" or "comics" or even "music" for that matter.
That being said, if you use --db file then you could effectively write your own "agent" as part of your own custom --format expression. You have the file name, file attributes, MediaInfo, etc. The rest is up to your code.
e.g. you can create your own web service that transforms original file name to desired file name and then have your plain file format just refer to that:
That being said, if you use --db file then you could effectively write your own "agent" as part of your own custom --format expression. You have the file name, file attributes, MediaInfo, etc. The rest is up to your code.
e.g. you can create your own web service that transforms original file name to desired file name and then have your plain file format just refer to that:
Code: Select all
{
def url = new URL("https://postman-echo.com/get?fn=${fn}")
def json = new groovy.json.JsonSlurper().parse(url)
return json.args.fn
}
Re: Custom databases via --db db.groovy
Good enough for me.
I’ll try and report, but this way I’d be missing a lot of the name processing and cleaning that Fb does, right?
Any way or docs to take advantage of it before querying?
Also I’d better hope the first result is the one I want as no refinement will be made on query results, right?
I’ll try and report, but this way I’d be missing a lot of the name processing and cleaning that Fb does, right?
Any way or docs to take advantage of it before querying?
Also I’d better hope the first result is the one I want as no refinement will be made on query results, right?
I only work in black and sometimes very, very dark grey. (Batman)
Re: Custom databases via --db db.groovy
What kind of cleaning and processing are you looking for in the context of books and comics? You can write all your code in a big local format, but I don't think FileBot has much to offer in this context.
My example is just an example. It's raw Groovy code. As simple as possible. Send HTTP request. Parse result as JSON. Select JSON element. No more. No less. No magic.

Re: Custom databases via --db db.groovy
Cleaning would be for names such as:
I believe some of this is already done by FB.
Code: Select all
Packing_for_Mars__The_Curious_Science_of_Life_in_the_Void.epub # replace _ with space and multiple _ with -
'Revival By Stephen King [pdf epub mobi azw3 pdb]' # remove formats
'[REQ] James S A Corey - The Expanse Series - book 4 Cibola Burn (epub and azw3)' # remove initial [REQ] and formats
'Manuali delle giovani marmotte - Vol. 2 Vol. 3 Vol. 5 Vol. 6 Vol. 7 Vol. 8 Vol. 9' # remove Vol.
I only work in black and sometimes very, very dark grey. (Batman)
Re: Custom databases via --db db.groovy
Well, String.space() is a built-in helper that you can use. The rest is tricky, because it's rather specific to books, so the existing Movie / Episode specific code won't help much here. Besides, isn't each of those uses cases just a simple regex one-liner? Checking through the FileBot API for potentially useful functions will take much longer, and probably work less well, when you can easily write the code yourself in a few minutes.
e.g.
e.g.
Code: Select all
/[ ._]+/
/\[.+?\]/
/Vol\D*\d+/