-
-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add media library operator. #3115
Conversation
I think that it's a great idea. What do you think of making this a separate |
This reverts commit bc78544.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this an awesome idea and a tool that will be very useful to our users.
I mostly made some generic comments. I really think that this should be on its own independent opam package. Couple of reasons I can think is:
- Visibility: the tool existence would be more obvious to the user
- Maintainability: once people start using it, more likely than not there will be requests for improvements, bug fixes etc. Having it separate would allow for point releases without having to wait for a main release. We also try to stick to stable bugfixes on minor liquidsoap relesse. A separate package would allow to decouple development effort on this module from the main release cycles.
- Load: we already know the standard library is too big. In fact, I think we should consider having a
liquidsoap-libs-extra
package for the next release.
If the scope is too limited to a separate package, we could bundle it up with other tools and make it a liquidsoap-libs-mediatools
package.
Lang.float_t | ||
(fun p -> | ||
let fname = List.assoc "" p |> Lang.to_string in | ||
try Lang.float (Unix.stat fname).st_mtime with _ -> Lang.float 0.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we return the whole stat record? Do we need user-friendly human readable attributes on the result?
let file = List.assoc "" p |> Lang.to_string in | ||
let m = try Metadata.parse_file file with _ -> [] in | ||
let m = List.map (fun (k, v) -> (String.lowercase_ascii k, v)) m in | ||
Lang.metadata (Frame.metadata_of_list m)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the decoder is registered as a mresolvers
plugin, this should already be declared here: https://github.com/savonet/liquidsoap/blob/main/src/core/builtins/builtins_files.ml#L473
# @method refresh Update metadatas and look for new files. | ||
# @method add_directory Add a new directory which should be scanned. | ||
# @method clear Remove all known metadata. | ||
def medialib(~id=null(), ~persistency=null(), ~refresh=null(), ~standardize=fun(m)->m, ~initial_progress=true, ~directories=[], dir=null()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need tests?
Co-authored-by: Romain Beauxis <toots@rastageeks.org>
Co-authored-by: Romain Beauxis <toots@rastageeks.org>
We are able to do something like
Before I complete it further, any comments on useablity / design?
We should be able to store the db persistently (using json) and update only new files...