Ambrevar / demlo

[MOVED TO GITLAB] A dynamic and extensible music library organizer
https://gitlab.com/ambrevar/demlo
MIT License
11 stars 1 forks source link

Modularize path.lua into basename.lua and directory.lua #10

Open Ambrevar opened 6 years ago

Ambrevar commented 6 years ago

As mentioned here, it would give more flexibility to the user.

path.lua would remain for backward compatibility and simply enable the other two.

fictionic commented 6 years ago

Note that my path.lua does more than simply enable basename.lua and directory.lua—it also deals with the output file extension (including setting it to any override value provided by the user), and takes care of the weird ffmpeg mp4 subformat behavior (you probably don't want an audio file with a mov extension, for example)

In fact, in my setup, if path.lua is not run, then neither of the other two path-related scripts will have an effect. path.lua is the master script for determining the output path; basename.lua and directory.lua are toggleable. You would only disable path.lua if you wanted to ensure that the operation was in-place (since the default for output.path is input.path).

Ambrevar commented 6 years ago

it also deals with the output file extension (including setting it to any override value provided by the user), and takes care of the weird ffmpeg mp4 subformat behavior (you probably don't want an audio file with a mov extension, for example)

Why not moving this to basename.lua?

fictionic commented 6 years ago

Why not moving this to basename.lua?

Because, while I admit that the word "basename" means "the file path minus the directory", and thus includes the extension, I think that generally users want the correct file extension on their files; or, if they don't, it's not related to their desires about the rest of the basename. Basically, I want people to be able to disable basename without preventing the correct extension from being set.