Giter VIP home page Giter VIP logo

Comments (5)

sandreas avatar sandreas commented on May 30, 2024

it would be useful to have a flag to "preserve-order"

You are absolutely right. But instead of another flag like --preserve-order, here is my proposal. The file ordering is a bit complex, because m4b-tool reads directories recursive by default. But if ONLY files are provided and no directory is included, i would preserve order by default, without the need of providing an extra flag.

What do you think? If you are happy with this, i take a look into this in the next days...

from m4b-tool.

Dekker500 avatar Dekker500 commented on May 30, 2024

Actually, I just thought of another wrinkle: Track numbers already embedded in the input files.

I'm not at the PC to test, but I don't think so OSes guarantee the order of expansion when wildcards are provided as an argument. Perhaps the flag is simplest - Alpha, Track Number, As-provided.

I haven't used it with folders. Would each folder produce a seperate output, or are they all merged? If they are separate, the sitting should be per output file...

from m4b-tool.

sandreas avatar sandreas commented on May 30, 2024

At the moment, all input arguments are recursively loaded if directory and added if file, then merged and then sorted alphabetically... so if you provide the following:

a.mp3
c.mp3
b.mp3

the merged result would be:

a.mp3
b.mp3
c.mp3

If you use folders, all files of the folder are loaded and sorted... e.g.:

m4b-tool my-folder2 my-folder --output-file="testing.m4b"

# although my-folder2 comes as first argument, it would result in:
my-folder/001.mp3
my-folder/002.mp3
my-folder/003.mp3
# ...
my-folder2/001.mp3
my-folder2/002.mp3
my-folder2/003.mp3

I never thought of a use case, where files are not named and sorted like they should be merged, but as i said: You are right... i think i will rework the file loading algorithm and think over a sane default behaviour instead of having extra flags for sorting... I'll provide a proposal in the next days.

As an idea: The arguments order should be left as is, regardless if it is a directory or a file - but directories should be loaded recursively and sorted, since as you say it is not guaranteed, that OS gives the correct order of files if a directory is provided.

from m4b-tool.

sandreas avatar sandreas commented on May 30, 2024

Ok, should be fixed. Sorting is only applied for single directories... if you provide more than one input argument (no matter if directory or file) the order is retained. Here is a nightly build for download, would be nice if you could give some feedback...

from m4b-tool.

Dekker500 avatar Dekker500 commented on May 30, 2024

Thanks for the prompt action!

Unfortunately I won't be able to test until Tues earliest - I'm not near the machine until then!

Will update when I do.

from m4b-tool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.